ci(labeler): auto-apply Port labels from changed driver files#3673
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 48a292f7f6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| - uses: actions/labeler@v5 | ||
| with: | ||
| configuration-path: .github/labeler.yml | ||
| sync-labels: false |
There was a problem hiding this comment.
Keep Port labels in sync after reverted changes
Because this job now reruns on pull_request_target.synchronize, leaving sync-labels disabled makes Port labels accumulate: a PR that initially touches src/portable/synopsys/dwc2/** gets Port DWC2, but if a later push removes all DWC2 changes, actions/labeler will not remove the stale label. I checked the actions/labeler docs for this input, which describe it as removing labels when matching files are reverted/no longer changed, so this setting leaves maintainers with incorrect port triage on updated PRs.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Pull request overview
This PR enhances the repository’s GitHub label automation by (1) updating the author-based priority labeling script to use the emoji-renamed labels and (2) adding path-based “Port <ip>” auto-labeling for PRs that touch src/portable/ driver code via actions/labeler@v5.
Changes:
- Update author-based hardcoded label names to the emoji-renamed versions.
- Add a new
label-portjob to apply Port labels based on file paths using a new.github/labeler.ymlmapping. - Expand
pull_request_targettrigger types while guarding the author-based job to run only on PR open events.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| .github/workflows/labeler.yml | Adds the label-port job and updates priority label names; adjusts PR event triggers/guards. |
| .github/labeler.yml | New path→label mapping for auto-applying Port … labels based on src/portable/ changes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| permissions: | ||
| contents: read | ||
| pull-requests: write |
Add path-based labeling so a PR touching a dcd/hcd driver under src/portable/ gets the matching "Port <ip>" label automatically. - new .github/labeler.yml maps each portable driver dir to its Port label - new label-port job runs actions/labeler on pull_request_target (opened/synchronize/reopened), sync-labels: false so manual removals stick - guard the existing author-based label-priority job to opened-only so it isn't re-run on PR updates - WCH is split per-IP: *usbfs* -> Port WCH USBFS, *usbhs* -> Port WCH USBHS Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
48a292f to
32c0e1a
Compare
Address review feedback on the label-port job: - sync-labels: true so a Port label is removed when a PR no longer touches that driver (job reruns on synchronize); only labeler.yml-listed labels are managed, so author-based Prio/Sponsor labels are unaffected (Codex) - add issues: write so actions/labeler can auto-create a Port label that doesn't exist yet, matching upstream's recommended permissions (Copilot) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 51973a8a74
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # Maps changed dcd/hcd files under src/portable/ to their "Port <ip>" label. | ||
| # Consumed by actions/labeler (see .github/workflows/labeler.yml -> label-port job). | ||
|
|
||
| "Port DWC2": |
There was a problem hiding this comment.
Use the existing Synopsys DWC2 label
For PRs that touch src/portable/synopsys/dwc2/**, this config applies Port DWC2, but the repository's current label set already uses Port Synopsys DWC2. Since the workflow grants issues: write specifically to create missing labels, these PRs will get a new duplicate label instead of showing up under the existing DWC2 triage label and saved filters.
Useful? React with 👍 / 👎.
| - changed-files: | ||
| - any-glob-to-any-file: 'src/portable/ohci/**' | ||
|
|
||
| "Port FSDev": |
There was a problem hiding this comment.
Use the existing STM32 FSDev label
For PRs that touch src/portable/st/stm32_fsdev/**, this config applies Port FSDev, but the repository's existing label is Port STM32 FSDev. With label auto-creation enabled, STM32 FSDev changes will be split onto a duplicate label and will not appear in existing triage views for the current label.
Useful? React with 👍 / 👎.
| # sync-labels so a Port label is removed once a PR no longer touches | ||
| # that driver (job reruns on synchronize). Only labels listed in | ||
| # labeler.yml are managed, so author-based Prio/Sponsor labels are untouched. | ||
| sync-labels: true |
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
| issues: write # allow auto-creating a Port label that doesn't exist yet |
|
Summary
A PR touching a dcd/hcd driver under
src/portable/now gets the matchingPort <ip>label automatically..github/labeler.ymlmaps each portable driver dir → itsPortlabellabel-portjob runsactions/labeler@v5onpull_request_target(opened/synchronize/reopened),sync-labels: falseso manual removals sticklabel-priorityjob is guarded to opened-only so it isn't re-run on every PR push*usbfs*→Port WCH USBFS,*usbhs*→Port WCH USBHSLabels created
Added missing IP-core labels:
Port OHCI,Port MUSB,Port RUSB2,Port NXP IP3516,Port MAX3421,Port WCH USBFS,Port WCH USBHS.Backfill
Applied the new Port labels to 16 existing open PRs that modify
src/portable/drivers (e.g. #3666 →Port DWC2, #3642 →Port WCH USBHS, #2601 →Port RUSB2).🤖 Generated with Claude Code