Repository navigation
ci: align Buildkite step labels, emoji, and keys - #714
Conversation
1087f34 to
c311317
Compare
XCFramework BuildThis PR's XCFramework is available for testing. Add the following to your .package(url: "https://github.com/wordpress-mobile/GutenbergKit", branch: "pr-build/714")Built from 424a6a5 |
c311317 to
2543a71
Compare
2543a71 to
a877041
Compare
a877041 to
c801525
Compare
| - label: ':ios: Validate Swift Release ${NEW_VERSION:-(no version)}' | ||
| key: validate-release | ||
| if: build.env("NEW_VERSION") != null && build.branch == "trunk" && build.pull_request.id == null | ||
| command: | | ||
| install_gems | ||
| bundle exec fastlane validate "version:$NEW_VERSION" | ||
| plugins: *plugins |
There was a problem hiding this comment.
Due to the CI label renames, the repository's required checks configuration must be changed in order to merge this PR. To receive passing CI results, pending PRs will need to rebase atop trunk once this merges.
To avoid this issue cropping up in the future, we can 1) required every step and group to use notify.github_commit_status; 2) update the pipeline setting to force reporting the custom status instead of deriving from the label name (that's outside of this repo's scope)
Example for 1:
| - label: ':ios: Validate Swift Release ${NEW_VERSION:-(no version)}' | |
| key: validate-release | |
| if: build.env("NEW_VERSION") != null && build.branch == "trunk" && build.pull_request.id == null | |
| command: | | |
| install_gems | |
| bundle exec fastlane validate "version:$NEW_VERSION" | |
| plugins: *plugins | |
| - label: ':ios: Validate Swift Release ${NEW_VERSION:-(no version)}' | |
| key: validate-release | |
| if: build.env("NEW_VERSION") != null && build.branch == "trunk" && build.pull_request.id == null | |
| command: | | |
| install_gems | |
| bundle exec fastlane validate "version:$NEW_VERSION" | |
| plugins: *plugins | |
| notify: | |
| - github_commit_status: | |
| context: Validate Swift Release |
There was a problem hiding this comment.
- update the pipeline setting to force reporting the custom status instead of deriving from the label name (that's outside of this repo's scope)
If this suggestion resonates, I opened a PR in our private Buildkite configuration repository.
If it doesn't and you want to merge sooner without coordination, that's fine, too. My team will eventually get to adopt the approach in all repos and we'll update the GitHub checks settings one more time then. No dramas.
There was a problem hiding this comment.
@mokagio Wouldn't that move the same problem to a different layer? If we do this, the next time a rename happens we'll have to make a decision on whether to rename the custom labels or not. If we rename, we are back to square one with more to maintain, if we don't, now the action and the label are potentially out of sync or doesn't match the current naming scheme.
Especially in a small repo that won't impact many branches, nor would it require expensive rebases, the fix sounds like it creates more problems than it solves. But, that's just my take on it. Happy to leave the decision to you regardless.
There was a problem hiding this comment.
@mokagio interested in your thoughts on @oguzkocer perspective when you have time, no rush. I plan to leave this PR for the time being as it is not urgent.
There was a problem hiding this comment.
Gio has gone AFK for ≈ a month, but here's my take:
Sure it moves the problem to a different layer, but one key is that the notify: { github_commit_status: "…" } approach allows you to have a clean GitHub check name that is free of formatting or emojis etc, while keeping the label of the step in Buildkite's own UI nicer and fancier.
1️⃣ Indeed when only relying on the label: of the step, Buildkite will derive the GitHub check name by replacing emojis with :code:, add buildkite/gutenbergkit/ prefixes, etc, which (at leasts IMHO) makes them less readable in GitHub PRs' UI. So personally I think the benefit of using notify: { github_commit_status: "…" } is also about better readability of the GitHub check names on GitHub PRs' UI.
For example, using an explicit notify: { github_commit_status: "Test iOS App E2E" } on the label: ':ios: Test iOS App E2E' step will allow you to have it shown as a nice "Test iOS App E2E" line in the GitHub checks at the bottom of the PR rather than the more ugly buildkite/gutenbergkit/ios-test-ios-app-e2e.
2️⃣ To Gio's point though, the other benefit of decoupling github_commit_status from label is that if you decide to make a minimal change to the label: of a step (e.g. changing label: ':s3: Publish XCFramework to S3' to label: ':ios: Publish XCFramework to S3', or changing label: ':swift: :package: Publish PR XCFramework' to label: ':ios: Publish PR XCFramework'), at least this won't change the GitHub Check name/identifier under you, and thus if you used a commit_status that still makes senses before/after (e.g. github_commit_status: 'Publish XCFramework to S3' / github_commit_status: 'Publish PR XCFramework' without the emoji), this won't require you to update the GitHub repo's settings to update the "Required Checks" list on the branch protection settings just for that. The label: and the GitHub check name can be kept independent instead of every little change of a label implicitly changing the GitHub check name under you.
Of course, if you do change the semantics of what a step does and that you end up changing its label: not just for a typo fix or for a change of emoji, but for a change in meaning, you'll probably still want to also update the notify: { github_commit_status: "…" } part of the step alongside your change of its label: to make the GitHub check name reflect that change of semantics too (e.g. for label: ':android: Test Android Library Instrumented' -> label: ':android: Test Android Library E2E' you'd probably also want to update github_commit_status: 'Test Android Library Instrumented' -> github_commit_status: 'Test Android Library E2E'). And thus would still have to update the branch protection settings accordingly.
But at least:
- You only need to do that when you change the semantics of the step—and that also changing the GitHub check name would also make sense—not just when you change an emoji or small typo fix
- You can provide a more readable GitHub check name than the one derived by Buildkite from the label (no more
buildkite/gutenbergkit/prefix, no transformation of:ios:emoji code from thelabel:into anios-prefix in the check name…) - It's immediately clear from the diff when your change will require updating the branch protection settings. If you change just the
label:but not thegithub_commit_status, no need to update the branch protection settings; only if your PR makes changes to thegithub_commit_statuswill it be an explicit signal/reminder to update the settings. While today with the GitHub commit status name derived from thelabel:it might not be as obvious to PR authors or reviewers that changing thelabel:will have this unfortunate consequence, making them more likely to forget to update the settings.
There was a problem hiding this comment.
Thank you for the helpful explanation. 🙇🏻♂️ I added the suggested notify.github_commit_status to each task. I believe the next steps are:
- Update the repository's required checks to the new tasks
- Merge this PR
- Merge and deploy the Buildkite CI PR Gio referenced earlier
I believe No. 3 must occur last, and the only impact between merges will be that duplicate tasks will show up on PR reports.
@AliSoftware would you be willing to help with No. 3 after this PR merges? I can merge early next week.
There was a problem hiding this comment.
@AliSoftware would you be willing to help with No. 3 after this PR merges? I can merge early next week.
Sure thing. It'd be easy enough since Gio already prepared the PR, which is here. So it'd just be a matter of (rebasing it + undraft it +) hit the button to deploy it once you did 1 & 2.
There was a problem hiding this comment.
@AliSoftware thank you! This PR was merged and the project's required checks are updated. We can proceed with the Buildkite CI PR.
hit the button to deploy
Is this the PR merge button or a separate deploy action? I originally requested your assistance because I presumed it was the latter, a separate deploy step for which I lack permissions. If it is simply merging the PR, I'm happy to manage that, just let me know. 🙇🏻♂️
There was a problem hiding this comment.
It's a different button, I can take care of it 🙂
There was a problem hiding this comment.
Done, the buildkite/gutenbergkit/… entries on GitHub PR checks should not appear on new PRs, only keeping the explicit ones you provided now.
c801525 to
b8e04b6
Compare
Keys had drifted from the targets they invoke (`swift-test-swift-package` ran `make test-swift-simulator`), and four Android steps had no key at all. Keying each step by its make target makes the mapping mechanical. `build-react` keeps a descriptive key because that step does more than `make build`, and steps that run Gradle or scripts directly have no target to mirror. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Emoji mixed platforms, languages, and tools (`:swift:`, `:xcode:`, `:rocket:`, `:eslint:`, `:npm:`, `:react:`), so the same codebase area appeared under several icons and GitHub's alphabetical check list scattered related steps. Each step now carries one platform emoji — `:javascript:` standing in for web, since there is no clean web glyph — and a verb-first, title-case label. Labels become GitHub check names, so six of the nine contexts the trunk ruleset requires change here and need a matching ruleset update. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The step runs `make build` after its own prerequisites, so `build-react` broke the key-by-target rule and no longer matched the step's label. The rule now also covers the SwiftLint step, which mirrors `make lint-ios` with the same pinned version and config. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Keeps each key equal to the make target its step runs after the Makefile renames, including the XCFramework key the release scripts download artifacts by. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Labels now match the renamed targets they run. This renames two more of the checks the trunk ruleset requires, Test JavaScript and Test Android Library, so eight of its nine required contexts now change. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Decouples GitHub check names from step labels, so emoji or wording tweaks no longer rename required checks. Pairs with Automattic/buildkite-ci#990, which disables the label-derived statuses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
b8e04b6 to
424a6a5
Compare
Note
Due to the CI label renames, the repository's required checks configuration must be changed in order to merge this PR. To receive passing CI results, pending PRs will need to rebase atop trunk once this merges.
What?
Rename CI tasks for consistency.
Why?
Overtime, CI tasks labels became increasingly inconsistent, making it more difficult to quickly assess CI results.
How?
<verb>[-<what>][-<how>]grammar from refactor: align Makefile target names with a documented grammar #705Testing Instructions
N/A, no user-facing changes.
Accessibility Testing Instructions
N/A, no user-facing changes.
Screenshots or screencast
AI-generated details
Step emoji mixed platforms, languages, and tools (
:swift:,:xcode:,:rocket:,:eslint:,:npm:,:react:), so one area of the codebase appeared under several icons and GitHub's alphabetical check list scattered related steps. Keys had also drifted from the make targets they run.Rule
Documented in a comment above
steps:::javascript:(standing in for web — there is no clean web glyph),:ios:, or:android:.notify: github_commit_statuscontext, which is the label minus its emoji (and minus the release version). Label tweaks no longer rename required checks, and a diff that changes a context signals a ruleset update (review thread).Labels
:react: Build React App:javascript: Build Web Bundle:eslint: Lint React App:javascript: Lint Web:javascript: Test JavaScript:javascript: Test Web Unit:npm: Check @wordpress package versions:javascript: Check @wordpress Package Versions:performing_arts: Test Web E2E:javascript: Test Web E2E:swift: SwiftLint:ios: Lint iOS:swift: iOS Simulator Tests:ios: Test iOS Library Simulator:swift: Library Tests:ios: Test iOS Library Host:xcode: Build XCFramework:ios: Build XCFramework:s3: Publish XCFramework to S3:ios: Publish XCFramework to S3:swift: :package: Publish PR XCFramework:ios: Publish PR XCFramework:white_check_mark: Validate Swift release:ios: Validate Swift Release:rocket: Publish Swift release:ios: Publish Swift Release:ios: Test iOS E2E:ios: Test iOS App E2E:android: Test Android Library:android: Test Android Library Unit:android: Test Android E2E:android: Test Android App E2E:android: Test Android Library Instrumented:android: Test Android Library E2E:wastebasket: Clean up … branches for closed PRs:ios: Clean Up … Branches for Closed PRsLabels follow the platform-named make targets from #705.
:ios:also covers the Swift host tests, which run on macOS: the emoji names the platform the code is for, matching how:android:already covers the Android library's JVM unit tests.References to the renamed steps are updated in
AGENTS.md,docs/releases.md,bin/release.sh, and an Android test comment. The--- :emoji:log section headers inside commands and scripts are log formatting, not step labels, and are left alone.Keys
build-reactbuildlint-jslint-webtest-jstest-web-unitlint-swiftlint-iosswift-test-swift-packagetest-ios-library-simulatorswift-test-librarytest-ios-library-hostbuild-xcframeworkbuild-ios-resources-xcframeworktest-ios-e2etest-ios-app-e2elint-android,test-android-library-unit,test-android-app-e2e,test-android-library-e2eThe web bundle step runs
make buildafter its own prerequisites, so it takes that key.lint-iosruns the SwiftLint Docker image rather thanmake lint-ios, but mirrors it with the same pinned version and config. The release scripts'--stepartifact downloads follow the XCFramework key.All nine checks the Protect default branch ruleset requires move from label-derived names to the explicit contexts:
buildkite/gutenbergkit/…)react-build-react-appBuild Web Bundleeslint-lint-react-appLint Webjavascript-test-javascriptTest Web Unitperforming-arts-test-web-e2eTest Web E2Eswift-ios-simulator-testsTest iOS Library Simulatorswift-library-testsTest iOS Library Hostios-test-ios-e2eTest iOS App E2Eandroid-test-android-libraryTest Android Library Unitandroid-publish-android-libraryPublish Android LibraryThe new contexts are confirmed against this PR's CI run (build #3180), posted by the same Buildkite app as the old ones. Until the Buildkite CI configuration PR disables the label-derived statuses, every step reports under both names.
Merge in this order:
🤖 Generated with Claude Code