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

Cannot halt staged rollout #21431

Open
4 tasks done
nico-gonzalez opened this issue Jul 31, 2023 · 1 comment · May be fixed by #22004
Open
4 tasks done

Cannot halt staged rollout #21431

nico-gonzalez opened this issue Jul 31, 2023 · 1 comment · May be fixed by #22004

Comments

@nico-gonzalez
Copy link

nico-gonzalez commented Jul 31, 2023

New Issue Checklist

Issue Description

I'm not being able to halt a staged rollout. Everything looks as if it is running successfully, and no error messages are displayed but the rollout for version 359 that its on the alpha track at 10% is not halted. Am I missing something?

We are using upload_to_play_store this way to update our alpha track:

upload_to_play_store(
      track: "alpha",
      version_code: 359,
      release_status: "halted",
      skip_upload_apk: true,
      skip_upload_aab: true,
      skip_upload_metadata: true,
      skip_upload_changelogs: true,
      skip_upload_images: true,
      skip_upload_screenshots: true,
    )
[12:12:04***: ----------------------------------
[12:12:04***: --- Step: upload_to_play_store ---
[12:12:04***: ----------------------------------
+------------------------------------+-----------------------------+
|                    Summary for supply 2.214.0                    |
+------------------------------------+-----------------------------+
| track                              | alpha                       |
| version_code                       | 359                         |
| release_status                     | halted                      |
| skip_upload_apk                    | true                        |
| skip_upload_aab                    | true                        |
| skip_upload_metadata               | true                        |
| skip_upload_changelogs             | true                        |
| skip_upload_images                 | true                        |
| skip_upload_screenshots            | true                        |
| package_name                       | XXX            |
| metadata_path                      | ./fastlane/metadata/android |
| json_key                           | google-play-service.json    |
| track_promote_release_status       | completed                   |
| 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                       |
+------------------------------------+-----------------------------+
[12:12:04***: Uploading all changes to Google Play...
[12:12:06***: Successfully finished the upload to Google Play

Moreover, if I get the version_codes for the track previously, and send it in the version_codes_to_retain array, then it fails due to a missing user fraction for the halted release

version_codes = google_play_track_version_codes(
        track: "alpha",
    )

    upload_to_play_store(
      # using alpha for testing purposes. It will be changed to `production`,
      track: "alpha",
      version_code: version_codes.first,
      version_codes_to_retain: version_codes,
      release_status: "halted",
      skip_upload_apk: true,
      skip_upload_aab: true,
      skip_upload_metadata: true,
      skip_upload_changelogs: true,
      skip_upload_images: true,
      skip_upload_screenshots: true,
    )
[14:31:52***: ----------------------------------
[14:31:52***: --- Step: upload_to_play_store ---
[14:31:52***: ----------------------------------

+------------------------------------+-----------------------------+
|                    Summary for supply 2.214.0                    |
+------------------------------------+-----------------------------+
| track                              | alpha                       |
| version_code                       | 359                         |
| version_codes_to_retain            | [359, 158***                  |
| release_status                     | halted                      |
| skip_upload_apk                    | true                        |
| skip_upload_aab                    | true                        |
| skip_upload_metadata               | true                        |
| skip_upload_changelogs             | true                        |
| skip_upload_images                 | true                        |
| skip_upload_screenshots            | true                        |
| package_name                       | XXX.                 |
| metadata_path                      | ./fastlane/metadata/android |
| json_key                           | google-play-service.json    |
| track_promote_release_status       | completed                   |
| 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                       |
+------------------------------------+-----------------------------+

[14:31:53***: Updating track 'alpha'...
[14:31:53***: Google Api Error: Invalid request - HALTED release must have fraction
Command executed
Complete output when running fastlane, including the stack trace and command used
 [REPLACE THIS WITH YOUR INFORMATION] 

Environment

 [REPLACE THIS WITH YOUR INFORMATION] 
@mataku
Copy link
Contributor

mataku commented May 3, 2024

I have the same problem.

I thought that Fastfile like the following would halt the track. However, I noticed that only metadata was updated, and no status change was sent to the Google Publisher API.

upload_to_play_store(
  # Target track to halt
  track: 'alpha',
  version_code: 1, # to identify the track to be halted
  # No need to specify `track_remote_to` because stage will not change
  track_promote_release_status: 'halted'
  # Skip uploading binary and metadata processing because I just want to halt
  skip_upload_apk: true,
  skip_upload_aab: true,
  skip_upload_metadata: true,
  skip_upload_changelogs: true,
  skip_upload_images: true,
  skip_upload_screenshots: true,
)

Supply::Uploader#perform_upload behaves as follows, therefore halted processing was skipped.

  1. Call update_track if skip_upload_aab or skip_upload_apk is false
  2. If not step 1, call promote_track if track_promote_to is specified
  3. If not steps 1 and 2, call update_rollout if rollout and track are specified

When halting the track, there should be no binary change and no change to track_promote_to and rollout, so I think it's better to handle additional logic rather than modifying existing steps.

apk_version_codes = []
apk_version_codes.concat(upload_apks) unless Supply.config[:skip_upload_apk]
apk_version_codes.concat(upload_bundles) unless Supply.config[:skip_upload_aab]
upload_mapping(apk_version_codes)
track_to_update = Supply.config[:track]
apk_version_codes.concat(Supply.config[:version_codes_to_retain]) if Supply.config[:version_codes_to_retain]
if !apk_version_codes.empty?
# Only update tracks if we have version codes
# update_track handle setting rollout if needed
# Updating a track with empty version codes can completely clear out a track
update_track(apk_version_codes)
else
# Only promote or rollout if we don't have version codes
if Supply.config[:track_promote_to]
track_to_update = Supply.config[:track_promote_to]
promote_track
elsif !Supply.config[:rollout].nil? && Supply.config[:track].to_s != ""
update_rollout
end
end

@mataku mataku linked a pull request May 3, 2024 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants