Skip to content

Conversation

@AliSoftware
Copy link
Contributor

@AliSoftware AliSoftware commented Aug 11, 2025

Closes AINFRA-1120

Why

@mzorz encountered an issue during the last complete_code_freeze because the release/* branch was already protected by the time complete-code_freeze tried to push some changes to update the release notes for translations.

remote: error: GH006: Protected branch update failed for refs/heads/release/2.36.        
remote: 
remote: - Changes must be made through a pull request.        
remote: 
remote: - 2 of 2 required status checks are expected.        
To http://github.com:Automattic/simplenote-android.git|github.com:Automattic/simplenote-android.git
 ! [remote rejected]   release/2.36 -> release/2.36 (protected branch hook declined)
error: failed to push some refs to 'http://github.com:Automattic/simplenote-android.git|github.com:Automattic/simplenote-android.git'

In practice, we need the wpmobile-bot to be able to push directly to the release/ branch not only during complete_code_freeze but also during other parts of the release automation, especially during new_beta_release that needs to push the version bump of version.properties without needing to do a pull request.

Fix

After having copied the branch protection settings from trunk to the newly-created release/* branch during start_code_freeze, we now make an additional call to set_branch_protection that 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 in pocket-casts-android and pocket-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 run start_code_freeze and applied the branch protections.

For the time being, I have manually edited the current branch protection settings of release/2.36 in GitHub Settings to uncheck the "Do not allow bypassing the above settings" box manually, then retried the task running the complete_code_freeze step 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.

image

Especially to allow release automation and bot to push version bumps direclty without a PR
@dangermattic
Copy link
Collaborator

dangermattic commented Aug 11, 2025

1 Warning
⚠️ PR is not assigned to a milestone.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Aug 11, 2025

📲 You can test the changes from this Pull Request in Simplenote Android by scanning the QR code below to install the corresponding build.

App NameSimplenote Android
Build TypeDebug
Commitaf5581f
Direct Downloadsimplenote-android-prototype-build-pr1756-af5581f-0198a2a8-b588-43c5-975d-c8b97815c586.apk

@AliSoftware AliSoftware self-assigned this Aug 11, 2025
@AliSoftware AliSoftware added the tooling Related to anything that supports the building & maintaining of the project. label Aug 11, 2025
@AliSoftware AliSoftware marked this pull request as ready for review August 11, 2025 14:31
@AliSoftware AliSoftware requested review from iangmaia and mzorz August 11, 2025 14:31
@AliSoftware AliSoftware enabled auto-merge August 11, 2025 14:38
Co-authored-by: Ian G. Maia <[email protected]>
Copy link
Contributor

@iangmaia iangmaia left a comment

Choose a reason for hiding this comment

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

👍

@AliSoftware AliSoftware merged commit b69459c into trunk Aug 13, 2025
15 checks passed
@AliSoftware AliSoftware deleted the ainfra-1120-simplenote-android-protected-branch-make-ci-fails-during branch August 13, 2025 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tooling Related to anything that supports the building & maintaining of the project.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants