Allow admin push on release/ branch #1756
Merged
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.
Closes AINFRA-1120
Why
@mzorz encountered an issue during the last
complete_code_freezebecause therelease/*branch was already protected by the timecomplete-code_freezetried to push some changes to update the release notes for translations.In practice, we need the wpmobile-bot to be able to push directly to the
release/branch not only duringcomplete_code_freezebut also during other parts of the release automation, especially duringnew_beta_releasethat needs to push the version bump ofversion.propertieswithout needing to do a pull request.Fix
After having copied the branch protection settings from
trunkto the newly-createdrelease/*branch duringstart_code_freeze, we now make an additional call toset_branch_protectionthat allows admins to bypass those branch protections. Given the bot has admin role, this should resolve the issue.📝 Note that this is the same approach that we already applied to other repos and
Fastfile(like inpocket-casts-androidandpocket-casts-ios), which is where I copied the code comments from.Test
We'll only be able to fully test those changes during the next
start_code_freeze, which will only happen during the next release, as the current release for 2.36 has already started and already runstart_code_freezeand applied the branch protections.For the time being, I have manually edited the current branch protection settings of
release/2.36in GitHub Settings to uncheck the "Do not allow bypassing the above settings" box manually, then retried the task running thecomplete_code_freezestep from ReleasesV2, which succeeded this time (and both triggered the expected beta build and created the expected backmerge PR), confirming that such update of the branch protection settings will solve the issue in future releases too.