Improve GHCR asset publishing and expand trigger events to include pull_request#78211
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
| # Add a mutable tag alongside the SHA tag so developers can pull "the latest build for this stream" | ||
| # (e.g. :trunk, :pr-12345, :release-19.5) without needing to update a pinned SHA. | ||
| - name: Add mutable tag for the built plugin | ||
| env: | ||
| SOURCE_SHA: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} | ||
| MUTABLE_TAG: ${{ steps.mutable_tag.outputs.value }} | ||
| run: | | ||
| oras tag "ghcr.io/wordpress/gutenberg/gutenberg-wp-develop-build:${SOURCE_SHA}" "${MUTABLE_TAG}" |
There was a problem hiding this comment.
So would the MUTABLE_TAG be usable in gutenberg.sha in the wordpress-develop package.json?
There was a problem hiding this comment.
That's right! I've created WordPress/wordpress-develop#11809 to show how I picture this working from a consumer standpoint.
Co-Authored-By: Weston Ruter <134745+westonruter@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Updates the build-plugin-zip.yml workflow to publish the wordpress-develop build artifact to GHCR for additional event types (including internal PRs), and to add a mutable “stream” tag alongside the existing immutable SHA tag so downstream consumers can reference “latest for X”.
Changes:
- Expand
publish-to-container-registryto run onworkflow_dispatchand internalpull_requestevents (excluding fork PRs). - Use ORAS to push the artifact under a SHA-based tag and then add a second mutable tag derived from branch name or PR number.
- Record a
SOURCE_SHAvalue in.gutenberg-hashand OCI annotations for PR runs (using the PR head SHA instead of the ephemeral merge SHA).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
westonruter
left a comment
There was a problem hiding this comment.
Thank you so much for this!
|
I'm going to merge this once the tests pass to give it a shot! I will commit WordPress/wordpress-develop#11809 tomorrow. |
|
This PR was manually merged into the wp/7.0 branch by #78324. |
This updates the pinned hash from the `gutenberg` from `3a4e8d1418d25da83b70158bcaabf65580690b6b ` to `a2a354cf35e5b69c3330d6c1cfd42d8dc2efb9fd`. The following changes are included: - Bump the github-actions group across 1 directory with 5 updates (WordPress/gutenberg#76530) (WordPress/gutenberg#78298) - Improve GHCR asset publishing and expand trigger events to include `pull_request` (WordPress/gutenberg#78211) (WordPress/gutenberg#78324) - I18N: Polyfill script module translations for WordPress < 7.0 (WordPress/gutenberg#77214) - Fonts: Move admin menu compat from experimental to wordpress-7.0 (WordPress/gutenberg#78227) (WordPress/gutenberg#78370) - Connectors: Consolidate WP 7.0 compat loading and move from experimental (WordPress/gutenberg#78228) (WordPress/gutenberg#78371) - RTC: Make sync/collaboration APIs private (WordPress/gutenberg#78267) - Interactivity API: Fix popover bind hydration (WordPress/gutenberg#77797) - Script Loader: Defer single-page admin init until DOMContentLoaded (Trac WordPress/gutenberg#65103) (WordPress/gutenberg#78136) A full list of changes can be found on GitHub: https://github.com/WordPress/gutenberg/compare/3a4e8d1418d25da83b70158bcaabf65580690b6b…a2a354cf35e5b69c3330d6c1cfd42d8dc2efb9fd. Log created with: git log --reverse --format="- %s" 3a4e8d1418d25da83b70158bcaabf65580690b6b..a2a354cf35e5b69c3330d6c1cfd42d8dc2efb9fd | sed 's|#\([0-9][0-9]*\)|https://github.com/WordPress/gutenberg/pull/\1|g; /github\.com\/WordPress\/gutenberg\/pull/!d' | pbcopy See #64595. git-svn-id: https://develop.svn.wordpress.org/trunk@62380 602fd350-edb4-49c9-b593-d223f7449a82
This updates the pinned hash from the `gutenberg` from `3a4e8d1418d25da83b70158bcaabf65580690b6b ` to `a2a354cf35e5b69c3330d6c1cfd42d8dc2efb9fd`. The following changes are included: - Bump the github-actions group across 1 directory with 5 updates (WordPress/gutenberg#76530) (WordPress/gutenberg#78298) - Improve GHCR asset publishing and expand trigger events to include `pull_request` (WordPress/gutenberg#78211) (WordPress/gutenberg#78324) - I18N: Polyfill script module translations for WordPress < 7.0 (WordPress/gutenberg#77214) - Fonts: Move admin menu compat from experimental to wordpress-7.0 (WordPress/gutenberg#78227) (WordPress/gutenberg#78370) - Connectors: Consolidate WP 7.0 compat loading and move from experimental (WordPress/gutenberg#78228) (WordPress/gutenberg#78371) - RTC: Make sync/collaboration APIs private (WordPress/gutenberg#78267) - Interactivity API: Fix popover bind hydration (WordPress/gutenberg#77797) - Script Loader: Defer single-page admin init until DOMContentLoaded (Trac WordPress/gutenberg#65103) (WordPress/gutenberg#78136) A full list of changes can be found on GitHub: https://github.com/WordPress/gutenberg/compare/3a4e8d1418d25da83b70158bcaabf65580690b6b…a2a354cf35e5b69c3330d6c1cfd42d8dc2efb9fd. Log created with: git log --reverse --format="- %s" 3a4e8d1418d25da83b70158bcaabf65580690b6b..a2a354cf35e5b69c3330d6c1cfd42d8dc2efb9fd | sed 's|#\([0-9][0-9]*\)|https://github.com/WordPress/gutenberg/pull/\1|g; /github\.com\/WordPress\/gutenberg\/pull/!d' | pbcopy See #64595. Built from https://develop.svn.wordpress.org/trunk@62380 git-svn-id: http://core.svn.wordpress.org/trunk@61661 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This updates the pinned hash from the `gutenberg` from `3a4e8d1418d25da83b70158bcaabf65580690b6b ` to `a2a354cf35e5b69c3330d6c1cfd42d8dc2efb9fd`. The following changes are included: - Bump the github-actions group across 1 directory with 5 updates (WordPress/gutenberg#76530) (WordPress/gutenberg#78298) - Improve GHCR asset publishing and expand trigger events to include `pull_request` (WordPress/gutenberg#78211) (WordPress/gutenberg#78324) - I18N: Polyfill script module translations for WordPress < 7.0 (WordPress/gutenberg#77214) - Fonts: Move admin menu compat from experimental to wordpress-7.0 (WordPress/gutenberg#78227) (WordPress/gutenberg#78370) - Connectors: Consolidate WP 7.0 compat loading and move from experimental (WordPress/gutenberg#78228) (WordPress/gutenberg#78371) - RTC: Make sync/collaboration APIs private (WordPress/gutenberg#78267) - Interactivity API: Fix popover bind hydration (WordPress/gutenberg#77797) - Script Loader: Defer single-page admin init until DOMContentLoaded (Trac WordPress/gutenberg#65103) (WordPress/gutenberg#78136) A full list of changes can be found on GitHub: https://github.com/WordPress/gutenberg/compare/3a4e8d1418d25da83b70158bcaabf65580690b6b…a2a354cf35e5b69c3330d6c1cfd42d8dc2efb9fd. Log created with: git log --reverse --format="- %s" 3a4e8d1418d25da83b70158bcaabf65580690b6b..a2a354cf35e5b69c3330d6c1cfd42d8dc2efb9fd | sed 's|#\([0-9][0-9]*\)|https://github.com/WordPress/gutenberg/pull/\1|g; /github\.com\/WordPress\/gutenberg\/pull/!d' | pbcopy Reviewed by audrasjb. Merges [62380] to the 7.0 branch. Fixes #64595. git-svn-id: https://develop.svn.wordpress.org/branches/7.0@62382 602fd350-edb4-49c9-b593-d223f7449a82
This updates the pinned hash from the `gutenberg` from `3a4e8d1418d25da83b70158bcaabf65580690b6b ` to `a2a354cf35e5b69c3330d6c1cfd42d8dc2efb9fd`. The following changes are included: - Bump the github-actions group across 1 directory with 5 updates (WordPress/gutenberg#76530) (WordPress/gutenberg#78298) - Improve GHCR asset publishing and expand trigger events to include `pull_request` (WordPress/gutenberg#78211) (WordPress/gutenberg#78324) - I18N: Polyfill script module translations for WordPress < 7.0 (WordPress/gutenberg#77214) - Fonts: Move admin menu compat from experimental to wordpress-7.0 (WordPress/gutenberg#78227) (WordPress/gutenberg#78370) - Connectors: Consolidate WP 7.0 compat loading and move from experimental (WordPress/gutenberg#78228) (WordPress/gutenberg#78371) - RTC: Make sync/collaboration APIs private (WordPress/gutenberg#78267) - Interactivity API: Fix popover bind hydration (WordPress/gutenberg#77797) - Script Loader: Defer single-page admin init until DOMContentLoaded (Trac WordPress/gutenberg#65103) (WordPress/gutenberg#78136) A full list of changes can be found on GitHub: https://github.com/WordPress/gutenberg/compare/3a4e8d1418d25da83b70158bcaabf65580690b6b…a2a354cf35e5b69c3330d6c1cfd42d8dc2efb9fd. Log created with: git log --reverse --format="- %s" 3a4e8d1418d25da83b70158bcaabf65580690b6b..a2a354cf35e5b69c3330d6c1cfd42d8dc2efb9fd | sed 's|#\([0-9][0-9]*\)|https://github.com/WordPress/gutenberg/pull/\1|g; /github\.com\/WordPress\/gutenberg\/pull/!d' | pbcopy Reviewed by audrasjb. Merges [62380] to the 7.0 branch. Fixes #64595. Built from https://develop.svn.wordpress.org/branches/7.0@62382 git-svn-id: http://core.svn.wordpress.org/branches/7.0@61663 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The `gutenberg.sha` property in the `package.json` file expects a full-length SHA value to be specified in order to download the built assets from the Gutenberg repository and include the files through the build script. After WordPress/gutenberg#78211, assets are now published for `pull_request` events in addition to `push` so long as the `HEAD` branch of the pull request exists in the repository and not in a fork. This makes the built assets for pull requests available for testing within `wordpress-develop` before they are merged through a `pr-###` tag on the GHCR package. To test a given pull request, just set the `gutenberg.sha` value to the corresponding `pr-###` tag. In addition to pull request-specific tags, each `wp/X.Y`, `release/X.Y`, and `trunk` now have a tag that can be used to test the latest changes. Each time `build` or `build:dev` is called the script will attempt to confirm the latest version of the assets are present locally, pulling down the latest changes when an update is available. All of the tags described in this changeset are mutable, so they should never be committed. Only immutable SHA values should be used for `gutenberg.sha` in commits to this repository. This commit also adds the related JavaScript files to the TypeScript configuration file. Props westonruter, jorbin, manhar. Fixes #65224. git-svn-id: https://develop.svn.wordpress.org/trunk@62422 602fd350-edb4-49c9-b593-d223f7449a82
The `gutenberg.sha` property in the `package.json` file expects a full-length SHA value to be specified in order to download the built assets from the Gutenberg repository and include the files through the build script. After WordPress/gutenberg#78211, assets are now published for `pull_request` events in addition to `push` so long as the `HEAD` branch of the pull request exists in the repository and not in a fork. This makes the built assets for pull requests available for testing within `wordpress-develop` before they are merged through a `pr-###` tag on the GHCR package. To test a given pull request, just set the `gutenberg.sha` value to the corresponding `pr-###` tag. In addition to pull request-specific tags, each `wp/X.Y`, `release/X.Y`, and `trunk` now have a tag that can be used to test the latest changes. Each time `build` or `build:dev` is called the script will attempt to confirm the latest version of the assets are present locally, pulling down the latest changes when an update is available. All of the tags described in this changeset are mutable, so they should never be committed. Only immutable SHA values should be used for `gutenberg.sha` in commits to this repository. This commit also adds the related JavaScript files to the TypeScript configuration file. Props westonruter, jorbin, manhar. Fixes #65224. Built from https://develop.svn.wordpress.org/trunk@62422 git-svn-id: http://core.svn.wordpress.org/trunk@61703 1a063a9b-81f0-0310-95a4-ce76da25c4cd
What?
Expands the
publish-to-container-registryjob inbuild-plugin-zip.ymlto run on more event types, and publishes a second, mutable tag alongside the existing SHA tag.Previously the job ran only on
pushtotrunk,release/**, andwp/**. It now also runs on:workflow_dispatchpull_request— only when the head branch lives inWordPress/gutenberg(fork PRs are explicitly excluded viagithub.event.pull_request.head.repo.full_name == github.repository)Every successful publish now produces two tags pointing at the same OCI manifest (added via
oras tag, so no duplicated blob storage):pushtotrunk<github.sha>trunkpushtorelease/X.Y<github.sha>release-X.Ypushtowp/X.Y<github.sha>wp-X.Yworkflow_dispatch<github.sha>pull_request(internal branch)<pull_request.head.sha>pr-<N>The SHA tag scheme is unchanged so that https://github.com/WordPress/wordpress-develop/ and any other downstream that pins to
gutenberg.shacontinues to work without modification.See WordPress/wordpress-develop#11809 as a companion PR that would add support for this in
wordpress-develop.Why?
There is currently no way to test unmerged changes in the Gutenberg repository in the context of https://github.com/WordPress/wordpress-develop/.
By publishing assets for pull requests, this is now possible. The mutable tag also gives contributors a stable "latest of stream" reference that doesn't require frequent updating of the pinned SHA on every new build. This is especially useful when working on a pull request to ensure the latest changes are present.
How?
This adjusts the workflow logic and makes changes to how the image is tagged through ORAS.
Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Opus 4.7
Used for: Analysis and initial draft patch.