Skip to content
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] Release-on-CI automation improvements #23585

Merged
merged 16 commits into from
Sep 19, 2024

Conversation

iangmaia
Copy link
Contributor

@iangmaia iangmaia commented Sep 11, 2024

This PR implements a few additions for our release automation on CI:

  • Automatically move PRs from the current release milestone to the next one
  • Uses the shared create_release_backmerge_pull_request Action from release-toolkit, assigning a milestone to the backmerge PR.
  • Make sure release tasks won't fail due to milestones already being closed
  • Annotate builds triggering other builds with their URL
  • Close hotfix milestone
  • Updated release pipelines to not allow manual retry
  • Added ensure_branch_does_not_exist in the beginning of code_freeze, to avoid unexpected behavior and errors.
  • Removed the :trigger_ testing lanes, as testing can happen either via Rv2 or the Buildkite web UI. (moved to the PR Remove unused release_management_in_ci.rb lanes #23589)

Update:

@iangmaia iangmaia added the Tooling Build, Release, and Validation Tools label Sep 11, 2024
@iangmaia iangmaia requested review from mokagio and a team September 11, 2024 20:28
@iangmaia iangmaia self-assigned this Sep 11, 2024
@iangmaia iangmaia force-pushed the iangmaia/release-on-ci-improvements branch from fe6e62d to 0c13250 Compare September 12, 2024 10:04
@wpmobilebot
Copy link
Contributor

wpmobilebot commented Sep 12, 2024

Jetpack Alpha📲 You can test the changes from this Pull Request in Jetpack Alpha by scanning the QR code below to install the corresponding build.
App NameJetpack Alpha Jetpack Alpha
ConfigurationRelease-Alpha
Build Numberpr23585-536b1c0
Version25.3
Bundle IDcom.jetpack.alpha
Commit536b1c0
App Center Buildjetpack-installable-builds #9758
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Sep 12, 2024

WordPress Alpha📲 You can test the changes from this Pull Request in WordPress Alpha by scanning the QR code below to install the corresponding build.
App NameWordPress Alpha WordPress Alpha
ConfigurationRelease-Alpha
Build Numberpr23585-536b1c0
Version25.3
Bundle IDorg.wordpress.alpha
Commit536b1c0
App Center BuildWPiOS - One-Offs #10715
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@iangmaia iangmaia added this to the 25.4 milestone Sep 12, 2024
@iangmaia iangmaia force-pushed the iangmaia/release-on-ci-improvements branch from 51b44db to e41f2b7 Compare September 13, 2024 18:06
@iangmaia iangmaia modified the milestones: 25.4, 25.5 Sep 16, 2024
Copy link
Contributor

@mokagio mokagio left a comment

Choose a reason for hiding this comment

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

Looking good. However it's always hard to tell withe these, short of running them 😞 Easy to miss a rename or trivial things like that.

None of my suggestions and nitpicks are blocking, so leaving it up to you whether to merge or to apply first.

Probably a conversation for an RFC in P2, but I wonder what you think of my approach from Simplenote Android where:

  • create_backmerge_pr is create_backmerge_pr! to account for the UI.user_error! call
  • We also have create_backmerge_prs! to differentiate between lanes that expect one backmerge PR only vs lanes that expect more (e.g. finalizing a hotfix)

I think it would be quite unlikely, especially in WordPress which now releases slowly, but if by chance we get a pr_url array instead of a single element, the annotation we then print it in might be confusing.

@@ -11,10 +11,18 @@ steps:
command: ".buildkite/commands/release-build-wordpress.sh $BETA_RELEASE"
plugins: [$CI_TOOLKIT_PLUGIN]
notify:
- slack: "#build-and-ship"
- slack: "#build-and-ship"
Copy link
Contributor

Choose a reason for hiding this comment

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

On seeing this I wondered "How has it worked all this time?!" but it turns out YAML (or at least the Ruby parser and Buildkite's parser) are flexible on array indentation:

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, I was also surprised 🙂

Copy link
Contributor

@AliSoftware AliSoftware Sep 19, 2024

Choose a reason for hiding this comment

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

Was surprised as well 😅

💡 Tip of the day: If you want to test how buildkite-agent itself would interpret your YAML (and thus be sure to rely on its implementation of YAML parser), you can use buildkite-agent pipeline upload --dry-run to print its interpretation of the pipeline. It prints the interpreted pipeline to stdout—in JSON by default, but you can use --format=yaml if you prefer YAML output that would be closer to the input file you provided.

For example, using a pipe to pass the YML to parse:

# Note: you need to provide the `-i` flag (but not add the `-t` flag!) for `docker run` to be able to read from STDIN through the pipe properly
echo "notify:\n- x" | docker run --rm -i buildkite/agent pipeline upload --dry-run
cat .buildkite/release-builds.yml | docker run --rm -i buildkite/agent pipeline upload --dry-run --format=yaml

Or if you want to pass it a file path to parse:

docker run --rm -v ./:/app -w /app buildkite/agent pipeline upload --dry-run --format=yaml .buildkite/pipeline.yml

@@ -11,10 +11,18 @@ steps:
command: ".buildkite/commands/release-build-wordpress.sh $BETA_RELEASE"
plugins: [$CI_TOOLKIT_PLUGIN]
notify:
- slack: "#build-and-ship"
- slack: "#build-and-ship"
Copy link
Contributor

Choose a reason for hiding this comment

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

On seeing this I wondered "How has it worked all this time?!" but it turns out YAML (or at least the Ruby parser and Buildkite's parser) are flexible on array indentation:

image

.buildkite/release-builds.yml Outdated Show resolved Hide resolved
fastlane/lanes/release.rb Outdated Show resolved Hide resolved
fastlane/lanes/release.rb Outdated Show resolved Hide resolved
fastlane/lanes/release.rb Outdated Show resolved Hide resolved
fastlane/lanes/release.rb Outdated Show resolved Hide resolved
@mokagio mokagio added this pull request to the merge queue Sep 19, 2024
Merged via the queue into trunk with commit 83cd9a0 Sep 19, 2024
24 checks passed
@mokagio mokagio deleted the iangmaia/release-on-ci-improvements branch September 19, 2024 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Tooling Build, Release, and Validation Tools
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants