Skip to content

[code-infra] Add workflow to check version label and cherry pick#1039

Open
JCQuintas wants to merge 6 commits intomasterfrom
version-tag-cherry-pick
Open

[code-infra] Add workflow to check version label and cherry pick#1039
JCQuintas wants to merge 6 commits intomasterfrom
version-tag-cherry-pick

Conversation

@JCQuintas
Copy link
Member

Rule Implementation
Make vX.x label required ✅ Fails if no version label found
IS main_branch AND HAS current_version_label → ignore ✅ currentBranchLabel = mainVersionLabel, no cherry-pick if only that label
IS main_branch AND HAS other_version_branch_label → open PR ✅ Cherry-picks to labels that aren't mainVersionLabel
IS version_branch AND HAS version_branch_label → ignore ✅ currentBranchLabel = baseBranch (e.g., v8.x), no cherry-pick if only that label
IS version_branch AND HAS other_version_branch_label → open PR ✅ Cherry-picks to labels that aren't the branch name

@JCQuintas JCQuintas requested a review from Copilot January 15, 2026 13:09
@JCQuintas JCQuintas self-assigned this Jan 15, 2026
@JCQuintas JCQuintas added the scope: code-infra Involves the code-infra product (https://www.notion.so/mui-org/5562c14178aa42af97bc1fa5114000cd). label Jan 15, 2026
@netlify
Copy link

netlify bot commented Jan 15, 2026

Deploy Preview for mui-internal ready!

Name Link
🔨 Latest commit 6f35470
🔍 Latest deploy log https://app.netlify.com/projects/mui-internal/deploys/6971056b126e0a0008dac82d
😎 Deploy Preview https://deploy-preview-1039--mui-internal.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@mui-bot
Copy link

mui-bot commented Jan 15, 2026

Bundle size report

Bundle Parsed size Gzip size
@base-ui-components/react 0B(0.00%) 0B(0.00%)
@mui/x-charts-pro 0B(0.00%) 0B(0.00%)

Details of bundle changes


Check out the code infra dashboard for more information about this PR.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds automated workflow infrastructure to validate version labels on PRs and automatically create cherry-pick PRs to target version branches based on those labels. It ensures every PR has at least one version label (e.g., v9.x, v8.x) and intelligently determines when cherry-picks are needed by comparing the PR's base branch with the version labels applied.

Changes:

  • Adds version label validation logic with intelligent cherry-pick target detection
  • Creates reusable workflow for checking version labels and opening cherry-pick PRs
  • Implements conditional logic to skip cherry-picks when PR targets match its version labels

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
.github/workflows/scripts/prs/checkVersionLabel.js JavaScript module that validates version labels and determines cherry-pick targets based on PR base branch
.github/workflows/prs_check-version-label-and-cherry-pick.yml Reusable workflow that orchestrates version label checking and cherry-pick PR creation

@JCQuintas JCQuintas requested a review from a team January 15, 2026 13:23
steps:
- name: Check out mui-public repo
id: checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
Copy link
Member

Choose a reason for hiding this comment

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

🤔 It just has to compare PR labels, afaics it shouldn't be necessary to check out any repo for this, neither should it be necessary to call github API, all info should be available in the action context of pull request event

Copy link
Member Author

@JCQuintas JCQuintas Jan 15, 2026

Choose a reason for hiding this comment

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

It needs to if we are using a function from the repo

const script = require('./.github/workflows/scripts/prs/checkVersionLabel.js')

I could move the code here, it is just that the js can be typechecked

Copy link
Member

@Janpot Janpot Jan 15, 2026

Choose a reason for hiding this comment

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

versioning is kind of problematic, i.e. we would use the sha to version the workflow where we call it, but then the script itself is versioned differently (e.g. someone could change the script on master and break users of this workflow, even if the workflow call is pinned to a specific sha)

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, though we use this pattern in many other workflows.

I've moved the script inside this file directly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: code-infra Involves the code-infra product (https://www.notion.so/mui-org/5562c14178aa42af97bc1fa5114000cd).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants