Add workflow to auto-label PRs with plugin labels and assign dominant-plugin milestone#2525
Closed
sarthak-19 wants to merge 1 commit into
Closed
Add workflow to auto-label PRs with plugin labels and assign dominant-plugin milestone#2525sarthak-19 wants to merge 1 commit into
sarthak-19 wants to merge 1 commit into
Conversation
Member
|
@sarthak-19 thanks for the PR, but one is already open for this: #2513 Please review that PR and suggest any changes. |
Contributor
Author
|
@westonruter Sure, but as mentioned here : #2513 (comment)
I tried to cover the whole issue. |
Member
|
Ah, ok. Yeah, let's first get that PR reciewed and merged. The. We can follow up with a PR that assigns the milestone. The milestone is trickier |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes : #2484
Summary
This PR implements automated plugin labelling and milestone assignment for pull requests in the WordPress Performance monorepo, as requested in the linked issue.
Changes
.github/workflows/auto-label-milestone.yml(new file)A
pull_request_targetworkflow that runs on every PRopened,synchronize, andreopenedevent againsttrunk,release/**, andfeature/**branches.Label synchronisation
plugins/<slug>/to its corresponding[Plugin] …label using a hardcoded slug → label table derived from each plugin'sPlugin Nameheader.Milestone assignment
<dominant-plugin-slug>(convention:embed-optimizer n.e.x.t).The full slug → label mapping:
auto-sizes[Plugin] Enhanced Responsive Imagesdominant-color-images[Plugin] Image Placeholdersembed-optimizer[Plugin] Embed Optimizerimage-prioritizer[Plugin] Image Prioritizeroptimization-detective[Plugin] Optimization Detectiveperformance-lab[Plugin] Performance Labspeculation-rules[Plugin] Speculative Loadingview-transitions[Plugin] View Transitionsweb-worker-offloading[Plugin] Web Worker Offloadingwebp-uploads[Plugin] Modern Image Formatsbin/plugin/commands/changelog.js(updated)Implements the bonus changelog enhancement described in the issue.
PLUGIN_SLUG_TO_LABEL_MAPconstant (same mapping as the workflow).--plugin-label / -lCLI argument. When omitted the plugin label is automatically derived from the milestone title by extracting the leading slug (e.g.embed-optimizer n.e.x.t→embed-optimizer→[Plugin] Embed Optimizer).fetchCrossPluginPullRequests()which queries the GitHub API for closed, merged PRs that carry the plugin label and are assigned to any currently-open milestone.fetchAllPullRequests()to merge cross-plugin PRs into the primary result set, deduplicating by PR number. This ensures a PR that touchesembed-optimizerandimage-prioritizerbut was milestoned underembed-optimizer n.e.x.twill also appear in theimage-prioritizerchangelog automatically.Use of AI Tools
I used copilot for scoping and PoA and documentation.