INNER CODE UNIT · Ruby
rollout_signature
wordpress-mobile/WordPress-Android · fastlane/lanes/promote.rb:627
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.
def next_production_rollout_target(current_fraction:)
next_step = PRODUCTION_ROLLOUT_STEPS.find { |step| step > current_fraction }
return { status: ROLLOUT_STATUS_IN_PROGRESS, user_fraction: next_step } if next_step
{ status: ROLLOUT_STATUS_COMPLETED, user_fraction: nil }
end
# A readable percentage label for a rollout target, for logs and Slack (e.g. `5%`, `100% (complete)`).
def rollout_target_label(target)
return '100% (complete)' if target[:status] == ROLLOUT_STATUS_COMPLETED