INNER CODE UNIT · Ruby
in_flight_release
wordpress-mobile/WordPress-Android · fastlane/lanes/promote.rb:617
def in_flight_release(track)
releases = track&.releases || []
[ROLLOUT_STATUS_IN_PROGRESS, ROLLOUT_STATUS_HALTED, ROLLOUT_STATUS_DRAFT]
.filter_map { |status| releases.find { |release| release.status == status } }
.first
end
# A comparable signature of an app's rollout state, so WordPress and Jetpack can be checked for
# lockstep. nil (no in-flight release) collapses to `:steady`; the fraction is rounded so a float
# round-tripping through JSON can't spuriously fail the comparison.
def rollout_signature(state)
return :steady if state.nil?
[state[:status], state[:version_code], state[:user_fraction]&.round(4)]
end
# The next rollout target from the current fraction: the smallest ladder step strictly above it as an
# `inProgress` bump, or a finalize to 100% (`completed`, no `user_fraction`) once past the top step.