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] Allow promoting draft release to inProgress with initial rollout #28960

Merged
merged 4 commits into from
Dec 10, 2024

Conversation

AliSoftware
Copy link
Contributor

@AliSoftware AliSoftware commented Dec 9, 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

If you already called upload_to_play_store with a release_status: 'draft' to initially create a draft release in Google Play, there was so far no option to submit that existing draft to review via supply—aka turn its release_status: 'inProgress' with a given initial rollout).

This is because when you call upload_to_play_store(track: …, version_code: …, release_status: 'inProgress', rollout: '0.2'), the update_rollout internal method of fastlane called fetch_track_and_release with a filter to only have the Google API return releases with a current status of IN_PROGRESS, thus failing to find the existing release if it was in "Draft" state instead of already "In Progress".

We ran into this issue while running our bundle exec fastlane update_rollouts percent:0.2 lane while we had a Release for the provided version_code in Draft status in the Play Store Console, but fastlane was erroring and complaining it was unable to find the release.

Description

I've updated the code of fetch_track_and_release to allow filtering on more than one status, and updated the call in update_rollout to filter on both IN_PROGRESS and DRAFT instead of only IN_PROGRESS.

I've then made sure that the rest of the implementation of update_rollout updated the release.status to the value of Supply.config[:release_status] if provided—instead of keeping it untouched unless rollout.to_f == 1, in order to allow the release in draft status to be turned into inProgress status

Testing Steps

I've updated the Gemfile of our app repo to point to these changes then ran our bundle exec fastlane update_rollouts percent:0.2 lane while we had a Release for the provided version_code in Draft status in the Play Store Console, and confirmed that it successfully submitted the draft release for review with the provided rollout.

So that one can create a release in draft status first, and then change its status from draft to inProgress at a later time
… release to inProgress with initial rollout
@AliSoftware AliSoftware marked this pull request as ready for review December 9, 2024 15:41
Copy link
Member

@mollyIV mollyIV left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for a great description, it was helpful to understand the issue and the fix. Let's ship it :shipit:

@@ -106,14 +106,14 @@ def perform_upload_meta(version_codes, track_name)
end
end

def fetch_track_and_release!(track, version_code, status = nil)
def fetch_track_and_release!(track, version_code, only_statuses = nil)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: maybe naming it statuses would be enough 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in dc60344

@AliSoftware AliSoftware merged commit 28222bd into master Dec 10, 2024
7 checks passed
@AliSoftware AliSoftware deleted the supply/update-draft-release-status branch December 10, 2024 10:15
@AliSoftware AliSoftware restored the supply/update-draft-release-status branch December 10, 2024 11:47
@AliSoftware AliSoftware deleted the supply/update-draft-release-status branch December 10, 2024 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tool: supply upload_to_playstore
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants