Repository navigation
ci: auto-label new issues and PRs by title pattern - #383
Conversation
Vendors the gh-copilot-review-loop skill from jorgeasaurus/agent-skills so PR feedback can be cycled through Copilot until a clean review lands. Changes from upstream: - Repoint the state script at .claude/skills/... instead of $CODEX_HOME, which does not exist under Claude Code. - Document the existing --repo/--pr flags and record provenance. - Skip agents/openai.yaml (Codex UI metadata) and the committed review_state.cpython-314.pyc bytecode. - Ignore __pycache__ so running the script leaves the tree clean. Verified with py_compile on Python 3.14.5 and a live run against PR #310, which returned the correct head SHA, Copilot review count, and thread state. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Mirrors the manual labeling scheme applied to the SCCM/Intune/JAMF epics: matches title keywords and conventional-commit prefixes to apply topic labels (sccm, intune, jamf, portal, device, apps, enrollment, windows, security, macos) plus a change-type label (feature, test, build, bug) and enhancement as a baseline. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 37 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Comment |
There was a problem hiding this comment.
Pull request overview
This PR introduces automation for applying labels to newly opened issues and pull requests based on title patterns, and also adds a new .claude skill for driving Copilot review-loop workflows.
Changes:
- Add a GitHub Actions workflow that auto-labels new issues (
issues: opened) and PRs (pull_request_target: opened) using title regex rules. - Add a new
.claude/skills/gh-copilot-review-loopskill, including a Python script to fetch thread-aware PR review state via the GitHub GraphQL API. - Add Python cache ignores for the new skill directory.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| .github/workflows/label-new-items.yml | New workflow to auto-apply topic + change-type labels on new issues/PRs via actions/github-script. |
| .claude/skills/gh-copilot-review-loop/SKILL.md | Documentation for the new Copilot review-loop skill (includes provenance note). |
| .claude/skills/gh-copilot-review-loop/scripts/review_state.py | Script to query PR reviews/threads and summarize Copilot review cycles. |
| .claude/skills/gh-copilot-review-loop/.gitignore | Ignores Python bytecode/cache artifacts for the skill script. |
| ## Provenance | ||
|
|
||
| Adapted from `gh-copilot-review-loop` in https://github.com/jorgeasaurus/agent-skills (upstream states no license). The only change is the state-script path, which upstream resolves under `$CODEX_HOME`. |
There was a problem hiding this comment.
Leaving this open for now rather than resolving it myself — this is a repo-policy/compliance call, not something I should decide unilaterally. For context: the SKILL.md already discloses the upstream source and that it "states no license" in its Provenance section, so the caveat isn't hidden. @adamgell, your call on whether to rewrite in-house, seek explicit permission from upstream, or accept as-is.
- Drop unneeded pull-requests:write permission from the labeling workflow; addLabels only needs issues:write. - Pin actions/github-script to a commit SHA to match this repo's supply-chain convention (see cmtrace-ci.yml). - Split review_state.py's reviews/threads pagination into independent loops so an exhausted cursor no longer resets the other connection back to page 1. - Exclude outdated threads from unresolved_thread_count so the script only reports the threads the loop workflow treats as actionable. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
Suppressed comments (3)
.claude/skills/gh-copilot-review-loop/SKILL.md:68
- The provenance note indicates the upstream repository has no declared license. Carrying adapted text/scripts from an unlicensed source can create compliance risk for this repository; either reimplement the skill content in-house or confirm permission/license compatibility before distributing it.
Adapted from `gh-copilot-review-loop` in https://github.com/jorgeasaurus/agent-skills (upstream states no license). The only change is the state-script path, which upstream resolves under `$CODEX_HOME`.
.github/workflows/label-new-items.yml:34
topicRulesis adding change-type labels (build,feature) based on keyword matches, but the workflow comment and PR description say change-type labels come from the conventional-commit-style prefix rules. This can produce conflicting labels (e.g., afix(...)title containing "elevation" would get bothbugandfeature). Consider keepingtopicRulesto domain/topic labels only and reserving change-type labels forprefixRules.
[/build\(macos\)|notarization|developer id signing/i, ['build', 'macos']],
[/restart as administrator|\belevation\b/i, ['windows', 'security', 'feature']],
.claude/skills/gh-copilot-review-loop/scripts/review_state.py:184
--repoparsing will raise a rawValueErrorif the argument isn't inowner/nameformat. Since this is a user-facing CLI, it should fail with a clear message and non-traceback exit code.
owner, repo = args.repo.split("/", 1)
number = args.pr
The workflow added in #383 has never succeeded on a pull request. All three pull_request_target runs so far failed with: POST /repos/adamgell/cmtraceopen/issues/<n>/labels 403 Resource not accessible by integration The script computes the labels correctly — the failing run for #397 had body '{"labels":["enhancement","intune","parser","device","feature"]}' — and then cannot write them. Cause: labelling a pull request requires `pull-requests: write`, even though the REST path is under /issues. The workflow declared only `issues: write`, and because an explicit `permissions:` block replaces the repository default rather than adding to it, and this repo's default_workflow_permissions is `read`, the token had no pull-request scope at all. The issues: opened trigger was unaffected. Adding `pull-requests: write` is the minimum needed; issue labelling keeps working through the existing `issues: write`. Verified: `gh run list --workflow=label-new-items.yml` shows failure on all three pull_request_target runs to date (#397, and the two before it), and `gh api repos/:owner/:repo/actions/permissions/workflow` reports default_workflow_permissions=read. Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Summary
.github/workflows/label-new-items.yml, triggered onissues: openedandpull_request_target: openedenhancementas a baseline.claude/skills/gh-copilot-review-loopskill (script + docs), which was already committed on this branch before this PR was opened and is not new work from this PR — included here because it's part of this branch's history relative tomainTest plan
pull-requests: writepermission, pinnedactions/github-scriptto a commit SHA, fixed a pagination bug and an outdated-thread-count bug inreview_state.py🤖 Generated with Claude Code