Skip to content

chore: add automated PR labeling workflow - #1091

Merged
Lash-L merged 3 commits into
Python-roborock:mainfrom
allenporter:chore/pr-labeler
Nov 25, 2026
Merged

Lash-L merged 3 commits into
Python-roborock:mainfrom
allenporter:chore/pr-labeler

Conversation

@allenporter

@allenporter allenporter commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds automated path-based PR labeling using actions/labeler to apply the repository's existing platform and scope labels automatically on PR open/update.

What's included

  • .github/labeler.yml: Path-based rules for existing labels:
    • Platforms: V1, Q10, Q7, A01, Mower
    • Scope: Data model changes (roborock/data/**), documentation (docs/**, **/*.md), github_actions (.github/**)
  • .github/workflows/labeler.yml:
    • Runs actions/labeler (v7.0.0) on pull_request_target (opened, synchronize, reopened) with minimal permissions (contents: read, pull-requests: write) and no checkout of untrusted PR code so external fork PRs are labeled safely.
    • Additive labeling (preserves manually applied labels).

Note

Because pull_request_target executes from the base branch (main), this workflow will not run on this PR itself and will activate once merged.

@allenporter
allenporter marked this pull request as ready for review November 24, 2026 16:35
Copilot AI balanced review requested due to automatic review settings November 24, 2026 16:35

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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@allenporter
allenporter requested a review from Lash-L November 24, 2026 16:43

@Lash-L Lash-L left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Automated code review by Claude Opus 5.5 in Claude Code using our /review (/code-review) skill (.agents/skills/code-review/SKILL.md / AGENTS.md).

Summary

Verdict: Passes /review with nits.

This PR only touches CI (.github/labeler.yml, .github/workflows/labeler.yml), so the trait, lifecycle and protocol layers (Priority 1 to 3) don't apply. I reviewed it for workflow security, whether the labels exist, and whether it clashes with the labels we apply by hand.

Security: no problems found

  • pull_request_target is used the safe way. There is no actions/checkout and no run: step, and no ${{ github.event.* }} value is interpolated anywhere. actions/labeler reads .github/labeler.yml through the API at the base ref, so a PR from a fork cannot change the rules that get applied to it.
  • Permissions are set per job and kept small (contents: read, pull-requests: write). issues: write isn't needed, because every label in the config already exists.

Labels: all exist and match the repo's labels exactly

  • The repo already has V1, Q10, Q7, A01, Mower, Data model changes, documentation and github_actions, with the same spelling and case.
  • sync-labels defaults to false in v7, so the action only adds labels and never removes them. It won't touch /review run, Passed /review, Small PR or Feature. No workflow in the repo reacts to labeled events, so these added labels don't set anything else off.

I tested every glob against all the files on main. Each platform label lands on its intended directories (roborock/data/<platform>, roborock/devices/traits/<platform>, roborock/protocols/*_protocol.py, tests/..., tests/protocols/testdata/b01_*_protocol).

Nits (non-blocking)

  1. .github/workflows/labeler.yml:14: pin the action by SHA. This is the one workflow in the repo that runs a third-party action with a write token on fork PRs, so a mutable @v7 tag is riskier here than anywhere else. Dependabot keeps SHA pins up to date when they carry a version comment:

    -      - uses: actions/labeler@v7
    +      - uses: actions/labeler@bf12e9b00b37c5c0ca2b87b79b2daf7891dbda13 # v7.0.0
    
  2. .github/labeler.yml: two map modules get no platform label.

    • roborock/map/map_parser.py is the V1 map parser (its docstring says "parsing v1 Roborock map content"), but none of the V1 globs match it.
    • roborock/map/b01_grid_layers.py is shared by Q10 and Q7, and it matches neither.

    Q7 already lists roborock/map/b01_map_parser.py by name. Listing these two the same way would keep map PRs labeled the same way (map_parser.py under V1, b01_grid_layers.py under both Q10 and Q7).

  3. .github/labeler.yml:54-57: .github/** also matches .github/skills. Because of that, a PR that only edits a skill gets labeled github_actions ("Pull requests that update GitHub Actions code"). Consider narrowing it to .github/workflows/** and .github/dependabot.yml. Along the same lines, "**/*.md" labels skill and agent instruction files (.agents/skills/**/SKILL.md, AGENTS.md, CLAUDE.md) as documentation. That is probably fine; I'm only noting it.

Tests & PR hygiene

  • CI is green: lint, commitlint, the test matrix, build, and the semantic-release dry run. The commits follow the chore: convention, and the branch merges cleanly into main.
  • As the PR description says, pull_request_target runs the workflow from the base branch, so it can't run on this PR. The first real run will be on the next PR opened after this merges.

This is an automated review and can be incorrect, so please reply if any finding looks wrong.

@Lash-L Lash-L added /review run Code review skill (/review) has been run Passed /review Passed the /review skill check labels Nov 25, 2026
@Lash-L
Lash-L merged commit dfb8159 into Python-roborock:main Nov 25, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Passed /review Passed the /review skill check /review run Code review skill (/review) has been run

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants