Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[supply] force a track promotion #22025

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jfelipe72
Copy link

@jfelipe72 jfelipe72 commented May 15, 2024

Checklist

  • I've run bundle exec rspec from the root directory to see all new and existing tests pass
  • I've followed the fastlane code style and run bundle exec rubocop -a to ensure the code style is valid
  • I see several green ci/circleci builds in the "All checks have passed" section of my PR (connect CircleCI to GitHub if not)
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary.
  • I've added or updated relevant unit tests.

Motivation and Context

Resolves #18497

The AndroidPublisherV3 API now returns only the latest version of each track instead of multiple versions as before. This created a difficulty when trying to promote older versions, as they were not being returned by the API. See fastlane/fastlane#18497 for more info.

To work around this issue, a solution was implemented to force the submission of the version with version_code = 1, requiring the inclusion of the --version_name parameter and also the --track_promote_force parameter. This ensures that the older version is submitted correctly, even after the change in the API.

Description

In supply/lib/supply/uploader.rb, a new condition has been introduced to validate whether the user wants to force the promotion of a track (--track_promote_force). If this option is triggered, the use of the --version_name parameter becomes mandatory. Consequently, the values of name and version_codes are overridden by the information provided through the parameters. This ensures that the older version is correctly sent, even in the face of changes to the API.

Testing Steps

To diagnose the issue, simply attempt to promote an older version.

In my case, 870871 is an older version, with newer ones ahead, such as 870872, 870873...

When attempting to promote this version using Fastlane version 2.220.0, I receive the following error:

[!] Track 'internal' doesn't have any releases

After making the changes locally and rerunning the script to promote the version, it worked correctly.

❌ Error Case:

+----------------------------------------------------------------------------------------------------+
|                                     Summary for supply 2.220.0                                     |
+------------------------------------+---------------------------------------------------------------+
| version_name                       | 870871 (11.36.3)                                              |
| version_code                       | 870871                                                        |
| track                              | internal                                                      |
| track_promote_to                   | production                                                    |
| track_promote_release_status       | completed                                                     |
| json_key                           | service_account.json                                          |
| package_name                       | com.kobe.dengo                                                |
| skip_upload_apk                    | true                                                          |
| skip_upload_aab                    | true                                                          |
| skip_upload_metadata               | true                                                          |
| skip_upload_changelogs             | true                                                          |
| skip_upload_images                 | true                                                          |
| skip_upload_screenshots            | true                                                          |
| release_status                     | completed                                                     |
| sync_image_upload                  | false                                                         |
| validate_only                      | false                                                         |
| check_superseded_tracks            | false                                                         |
| timeout                            | 300                                                           |
| deactivate_on_promote              | true                                                          |
| changes_not_sent_for_review        | false                                                         |
| rescue_changes_not_sent_for_review | true                                                          |
| ack_bundle_installation_warning    | false                                                         |
+------------------------------------+---------------------------------------------------------------+

✅ Success Case:

+----------------------------------------------------------------------------------------------------+
|                                     Summary for supply 2.220.0                                     |
+------------------------------------+---------------------------------------------------------------+
| version_name                       | 870871 (11.36.3)                                              |
| version_code                       | 870871                                                        |
| track                              | internal                                                      |
| track_promote_to                   | production                                                    |
| track_promote_release_status       | completed                                                     |
| track_promote_force                | true                                                          |
| json_key                           | service_account.json                                          |
| package_name                       | com.kobe.dengo                                                |
| skip_upload_apk                    | true                                                          |
| skip_upload_aab                    | true                                                          |
| skip_upload_metadata               | true                                                          |
| skip_upload_changelogs             | true                                                          |
| skip_upload_images                 | true                                                          |
| skip_upload_screenshots            | true                                                          |
| release_status                     | completed                                                     |
| sync_image_upload                  | false                                                         |
| validate_only                      | false                                                         |
| check_superseded_tracks            | false                                                         |
| timeout                            | 300                                                           |
| deactivate_on_promote              | true                                                          |
| changes_not_sent_for_review        | false                                                         |
| rescue_changes_not_sent_for_review | true                                                          |
| ack_bundle_installation_warning    | false                                                         |
+------------------------------------+---------------------------------------------------------------+

@brainbicycle
Copy link

brainbicycle commented May 17, 2024

bump, without this we can't promote older builds on Android which is tough if you are shipping betas often.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Promoting non-latest alpha track version to production fails on Google Play Store
2 participants