Repository navigation
Read the Comments Label Live Rather Than off the Event Payload - #2356
Conversation
The event payload's labels are a snapshot taken when the event fires, so a label applied after it, as gh pr create --label applies its own, never reaches that run or a rerun of it. The lint job now reads the pull request's labels through the API when it reaches the prose gate, and falls back to the payload, saying so in the log, only where the read fails. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A repository pinned before the live read has no fallback line to warn a driver, so the skills now name the positive line instead. The live read also matches the label case-insensitively, as the payload's contains() does. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The live read runs under the callers' contents-only grant, which reaches a public repository's labels and not a private one's, so the docs say a private repository falls back to the event snapshot. drive-pr now says to add the label after creating the pull request, since a label applied at create misses the opening event's snapshot. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The README now states the rerun the way the skills do, with the next-push remedy for a private repository or a fallback. The label-read test also asserts the jq projection gh receives. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #2356 +/- ##
========================================
Coverage 57.70% 57.70%
========================================
Files 16 16
Lines 7919 7919
========================================
Hits 4570 4570
Misses 3349 3349
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
Tests do not validate the workflow environment wiring used by the live label lookup.
Review effort: Lite
Findings: None
What changed in this PR
Updates comment-label handling to read labels live via the API, with payload fallback, tests, and synchronized documentation.
Changes:
- Adds live label lookup and fallback logging.
- Adds focused workflow-step tests.
- Updates guidance and generated skill copies.
| File | Description |
|---|---|
tests/test_prose_lint.py |
Tests live lookup and fallback behavior. |
scripts/README.md |
Documents live label behavior. |
.github/workflows/validate-task.yml |
Reads labels through the API. |
.github/skills/drive-pr/SKILL.md |
Updates PR workflow guidance. |
.github/skills/comment-and-doc-style/SKILL.md |
Documents label resolution. |
.claude-plugin/fleet-skills/skills/drive-pr/SKILL.md |
Updates generated guidance. |
.claude-plugin/fleet-skills/skills/comment-and-doc-style/SKILL.md |
Updates generated documentation. |
.claude-plugin/fleet-skills/.source-digests/drive-pr |
Refreshes source digest. |
.claude-plugin/fleet-skills/.source-digests/comment-and-doc-style |
Refreshes source digest. |
.agents/skills/drive-pr/SKILL.md |
Updates canonical PR guidance. |
.agents/skills/comment-and-doc-style/SKILL.md |
Updates canonical label guidance. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…nd Review Digest Tolerance (#2360) ## Summary Promotes `develop` to `main` with four pull requests, each already reviewed and merged into `develop`: - [#2352](#2352) asserts that `hub-fetch-run.py`'s fallback fetch uses the `main` path. - [#2355](#2355) tolerates a per-field `workflowRun` error in `pr_review.py`, keying unreadable Actions runs per suite so no failure is hidden. - [#2356](#2356) reads the `comments` label live in the validate task's lint job rather than off the event payload, on public repositories, with private repositories following in #2354. - [#2359](#2359) reads composite-action files through PyYAML under `uvx`, in isolated mode, where PyYAML is not importable, replacing the unprovisioned `yq` fallback. Closes #2339 Closes #2338 Closes #1703 Closes #2348 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Summary
The
commentslabel was computed fromgithub.event.pull_request.labels, a snapshot taken when the event fires.gh pr create --labelapplies its labels after theopenedevent, so that run saw no label, and a rerun reused the same snapshot.validate-task.yml: a newRead comments label stepin the lint job reads the pull request's labels through the API (gh api --paginate --jq '.[].name' repos/<repo>/issues/<n>/labels) with the job'sGITHUB_TOKEN, matchingcommentscase-insensitively ascontains()does. It writes a step output thatallow-commentsreads, beside the unchanged promotion clause. A failed read falls back to the payload value and says so in the log rather than turning into a silent false.contents: readonly, and a reusable workflow cannot raise that, so the live read works on public repositories and a private repository falls back to the payload. That is public-only by decision. Grantingpull-requests: readfleet-wide is the follow-up in Grant pull-requests: read So the Live comments Label Read Reaches Private Repositories #2354.comment-and-doc-style,drive-pr, andscripts/README.mdnow say the label is read live where the lint log shows "Read the pull request's labels live", so a rerun picks up a label added since, and otherwise (a private repository, or a fallback) the label applies to the next push.drive-prsays to add the label after creating the pull request.tests/test_prose_lint.pyruns the step's ownrun:body against a stubghand covers live-wins-both-ways, case-insensitive matching, the exact-line match, the call's path,--paginateand.[].nameprojection, and the payload fallback. Each of those was mutation-checked against the step.This PR's own lint log is the first real-API check of the live read under
contents: read.Addresses #1703
🤖 Generated with Claude Code