-
Notifications
You must be signed in to change notification settings - Fork 224
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
[Tooling] Introduce pipelines to trigger release tasks on CI #3514
Conversation
📲 You can test the changes from this Pull Request in 📱 Mobile by scanning the QR code below to install the corresponding build.
📲 You can test the changes from this Pull Request in 🚗 Automotive by scanning the QR code below to install the corresponding build.
📲 You can test the changes from this Pull Request in ⌚ Wear by scanning the QR code below to install the corresponding build.
|
@@ -362,9 +361,7 @@ platform :android do | |||
version = release_version_current | |||
|
|||
# Wrap up | |||
remove_branch_protection(repository: GITHUB_REPO, branch: "release/#{version}") |
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.
This is already done later during publish_release
, which is a better moment to remove the release branch protection anyway (see https://github.com/Automattic/apps-infra-plans/issues/83)
04a1230
to
fc65e8d
Compare
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.
Looking good as far as I can see.
A similar feeling to what you wrote in regards to testing this:
I think the only way to test this is during the next release process that will adopt those changes (likely during 7.82)
However, I'll say that the more of these we implement, the more confident I become because I can see the code being ported from one already real-world-tested implementation to a new one.
echo '--- 🤖 Use bot for Git operations' | ||
source use-bot-for-git | ||
|
||
echo '--- :ruby: Setup Ruby Tools' | ||
install_gems | ||
|
||
echo '--- 🔐 Access Secrets' | ||
bundle exec fastlane run configure_apply |
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.
I don't think this is something we've ever done in the release pipelines, but how do you feel about extracting these common steps in a script to source
?
Could be a followup / mini-project to log and pick up once someone has time to implement consistently. Just thought I'd toss the idea there for DRYing.
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.
Yeah, as I copy/pasted the release-pipelines/code-freeze.yml
multiple times to create the other release-pipelines/
and seeing how similar they all were I thought about it too; a good idea to implement cross-repo in a subsequent iteration indeed!
pipeline_args = { | ||
pipeline_file: 'release-builds.yml', | ||
environment: { | ||
RELEASE_VERSION: release_version_current | ||
} | ||
} | ||
if is_ci? | ||
buildkite_pipeline_upload(**pipeline_args) | ||
else | ||
buildkite_trigger_build( | ||
buildkite_organization: 'automattic', | ||
buildkite_pipeline: 'pocket-casts-android', | ||
branch: branch_to_build, | ||
**pipeline_args | ||
) | ||
end |
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.
Nice DRYing
Side note: Glad you used consistent naming with I feel like the confusing of seeing some files with dashes and some with underscores would be bigger than the feeling of inconsistency with the file being called |
Otherwise we get a crash trying to load the `release-toolkit`—which depends on `nokogiri`—on certain agents like `tumblr-metal` because the version of `libc.so` (`GLIBC_2.28`) required by the pre-build `nokogiri.so` lib is not found on those agents (due to an older Linux OS, iinm)
Newly detected since the update of the `rubocop` gem to a more recent version
Especially since this fastlane built-in action relies on CI env vars to check the branch instead of checking the actual git branch being checked out at the time it's called, leading to it checking the `BUILDKITE_BRANCH` value (the branch on which the pipeline was started from) even if we since called `Fastlane::Helper::GitHelper.checkout_and_pull(DEFAULT_BRANCH)` right before that to switch to a different branch…
That lane does not have a `skip_confirm:` param
- We don't need to create the next milestone via Fastfile anymore since GitHub milestones creation is now handled by ReleasesV2 - We don't want to remove the branch protection of the `release/*` branch as soon as `finalize_release` but instead only during `publish_release` (where that action was also called already)
Co-authored-by: Gio Lodi <gio@mokacoding.com>
4439e93
to
c3b2138
Compare
For safety and reducing risk of injection
Description
As part of this Project Thread: paaHJt-78B-p2, this introduces
.buildkite/release-pipelines/*.yml
files that will take care of callingfastlane code_freeze
and similar lanes called during the release process.Those lanes are currently called by the Release Manager on their own Mac, so the point of introducing those pipelines is to be able to instead switch to make those kicker lanes be run on CI instead.
Created pipelines
List of
.buildkite/release-pipelines/*.yml
files calling their associatedfastlane
lane during ReleaseV2 scenario:code_freeze
update_rollouts
new_beta_release
finalize_release
publish_release
new_hotfix_release
finalize_hotfix_release
Scenario steps update in ReleasesV2
Once this lands, we will be able to also land the companion PR in wpcom to update the Release Scenario in MC (internal ref: 171698-ghe-Automattic/wpcom) to replace the currently-manual tasks like "Call
bundle exec fastlane code_freeze
" and the likes with automated tasks instead—i.e. tasks that will present a clickable button on ReleasesV2 which, when clicked, will trigger those lanes on CI—thus not requiring Release Managers to run those from their personal Macs anymore.Testing Instructions
oha/test-release-on-ci
branch and pushing it to the remote will work thanks touse-bot-for-git
release-build.yml
would properly ensure togit checkout release/$RELEASE_VERSION
before starting the build, to account for the fact that when the steps of this pipeline are added to the current build that was started frommain
(as opposed to being triggered as a separate CI build directly from therelease/*
branch afterwards like was the case so far), therelease-build.yml
will ensure to switch to the right release branch firstOtherwise I think the only way to test this is during the next release process that will adopt those changes (likely during
7.82
)