-
Notifications
You must be signed in to change notification settings - Fork 5
chore(ci): emit claude:review:passed/failed label from automated PR review [PYSDK-105] #593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -214,6 +214,49 @@ jobs: | |
|
|
||
| Use `gh pr comment` with your Bash tool to leave your comprehensive review as a comment on the PR. | ||
|
|
||
| ## Machine-Readable Verdict (MANDATORY) | ||
|
|
||
| After posting your review comment, you MUST emit a single-label verdict on the PR. This label is consumed by branch-protection rules to gate auto-merge — it is the only deterministic signal of your review outcome. | ||
|
|
||
| **Verdict criteria** (all must hold for PASS): | ||
|
|
||
| - No blocking findings under "CRITICAL CHECKS" — i.e. no missing test markers, no coverage drop below 85%, no `make lint` failures, no conventional-commit violations. | ||
| - No blocking architecture or security violations under "Repository-Specific Review Areas". | ||
| - Suggestions / nice-to-haves do NOT block the verdict. | ||
|
|
||
| If any blocking finding remains: verdict is **FAIL**. | ||
| Otherwise: verdict is **PASS**. | ||
|
|
||
| **Apply the label** (the two labels are mutually exclusive — always remove the opposite one): | ||
|
|
||
| ```bash | ||
| # PASS: | ||
| gh pr edit ${{ github.event.pull_request.number }} \ | ||
| --add-label "claude:review:passed" \ | ||
| --remove-label "claude:review:failed" | ||
|
|
||
| # FAIL: | ||
| gh pr edit ${{ github.event.pull_request.number }} \ | ||
| --add-label "claude:review:failed" \ | ||
| --remove-label "claude:review:passed" | ||
| ``` | ||
|
Comment on lines
+217
to
+242
|
||
|
|
||
| Note: `--remove-label` is a no-op if the label is not present, so it is safe to always include it. | ||
|
|
||
| Also include the verdict as the final line of your sticky review comment, formatted exactly as: | ||
|
|
||
| ``` | ||
| **Verdict**: ✅ claude:review:passed | ||
| ``` | ||
|
|
||
| or | ||
|
|
||
| ``` | ||
| **Verdict**: ❌ claude:review:failed | ||
| ``` | ||
|
|
||
| This makes the verdict visible to humans without scrolling through all findings. | ||
|
|
||
| --- | ||
|
|
||
| **Remember**: This is medical device software. Insist on highest standards. Be thorough, actionable, and kind. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gh pr edit --add-labelfails if the label does not already exist in the repo. Sincelabels-sync.ymlonly syncs labels on push tomain, this PR’s own review run (and any runs before labels are created in repo settings) can error when trying to applyclaude:review:passed/failed. To make the automation robust, add guidance/logic to ensure the labels exist first (e.g., create them if missing, or handle the “label not found” failure gracefully and still post the review).