-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
Conversation
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
There was a problem hiding this 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
supply/lib/supply/uploader.rb
Outdated
@@ -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) |
There was a problem hiding this comment.
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 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in dc60344
Checklist
bundle exec rspec
from the root directory to see all new and existing tests passbundle exec rubocop -a
to ensure the code style is validci/circleci
builds in the "All checks have passed" section of my PR (connect CircleCI to GitHub if not)I've updated the documentation if necessary.Motivation and Context
If you already called
upload_to_play_store
with arelease_status: 'draft'
to initially create a draft release in Google Play, there was so far no option to submit that existing draft to review viasupply
—aka turn itsrelease_status: 'inProgress'
with a given initialrollout
).This is because when you call
upload_to_play_store(track: …, version_code: …, release_status: 'inProgress', rollout: '0.2')
, theupdate_rollout
internal method of fastlane calledfetch_track_and_release
with a filter to only have the Google API return releases with a current status ofIN_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 providedversion_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 inupdate_rollout
to filter on bothIN_PROGRESS
andDRAFT
instead of onlyIN_PROGRESS
.I've then made sure that the rest of the implementation of
update_rollout
updated therelease.status
to the value ofSupply.config[:release_status]
if provided—instead of keeping it untouched unlessrollout.to_f == 1
, in order to allow the release in draft status to be turned intoinProgress
statusTesting Steps
I've updated the
Gemfile
of our app repo to point to these changes then ran ourbundle exec fastlane update_rollouts percent:0.2
lane while we had a Release for the providedversion_code
in Draft status in the Play Store Console, and confirmed that it successfully submitted the draft release for review with the provided rollout.