Skip to content

ci(labeler): auto-apply Port labels from changed driver files#3673

Merged
hathach merged 2 commits into
masterfrom
claude/label-emoji
Jun 4, 2026
Merged

ci(labeler): auto-apply Port labels from changed driver files#3673
hathach merged 2 commits into
masterfrom
claude/label-emoji

Conversation

@hathach

@hathach hathach commented Jun 4, 2026

Copy link
Copy Markdown
Owner

Summary

A PR touching a dcd/hcd driver under src/portable/ now gets the matching Port <ip> label automatically.

  • new .github/labeler.yml maps each portable driver dir → its Port label
  • new label-port job runs actions/labeler@v5 on pull_request_target (opened/synchronize/reopened), sync-labels: false so manual removals stick
  • the existing author-based label-priority job is guarded to opened-only so it isn't re-run on every PR push
  • WCH split per-IP: *usbfs*Port WCH USBFS, *usbhs*Port WCH USBHS

Labels 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. #3666Port DWC2, #3642Port WCH USBHS, #2601Port RUSB2).

ESP32 is intentionally not path-mapped — it shares the synopsys/dwc2 driver, so it gets Port DWC2.

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings June 4, 2026 08:03

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread .github/workflows/labeler.yml Outdated
- uses: actions/labeler@v5
with:
configuration-path: .github/labeler.yml
sync-labels: false

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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-port job to apply Port labels based on file paths using a new .github/labeler.yml mapping.
  • Expand pull_request_target trigger 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.

Comment on lines +171 to +173
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>
@hathach hathach force-pushed the claude/label-emoji branch from 48a292f to 32c0e1a Compare June 4, 2026 08:07
@hathach hathach changed the title ci(labeler): emoji labels + auto-apply Port labels from driver files ci(labeler): auto-apply Port labels from changed driver files Jun 4, 2026
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>
@hathach hathach requested a review from Copilot June 4, 2026 08:09
@hathach

hathach commented Jun 4, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread .github/labeler.yml
# 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":

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Comment thread .github/labeler.yml
- changed-files:
- any-glob-to-any-file: 'src/portable/ohci/**'

"Port FSDev":

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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

Comment on lines +179 to +182
# 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
@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown

MemBrowse Memory Report

No memory changes detected across 2305 targets. View Project Dashboard →

@hathach hathach merged commit ac32fea into master Jun 4, 2026
251 of 280 checks passed
@hathach hathach deleted the claude/label-emoji branch June 4, 2026 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants