[Supply] Allow promoting draft release to inProgress with initial rollout #28960
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.