INNER CODE UNIT · Ruby

production_promotion_candidate

wordpress-mobile/WordPress-Android · fastlane/lanes/promote.rb:351

  def production_promotion_candidate
    beta_code = common_track_version_code(track: BETA_TRACK, label: 'beta')
    return nil if beta_code.nil?

    production_code = common_track_version_code(track: PRODUCTION_TRACK, label: 'production')
    return nil if production_code && beta_code <= production_code

    beta_code
  end

  # The version code both apps share on the given track (they promote together, so it must match), or
  # nil when neither app has a release there. Raises when the two apps disagree — a mismatch means an
  # earlier promotion only half-completed and must be reconciled by hand before releasing.
  def common_track_version_code(track:, label:)
    codes = %i[wordpress jetpack].map do |app|
      code = track_version_codes(package_name: APP_SPECIFIC_VALUES[app][:package_name], track: track).max
      UI.message("#{app}: #{label} version code = #{code.inspect}")
      code

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…