Repository navigation
docs(workflow): require PRs to mirror their closing issue's triage labels (closes #237) - #238
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughDocumentation adds mandatory post-push CI watching, CodeRabbit review iteration, and closing-issue label mirroring procedures to ChangesWorkflow Procedure Documentation
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
CLAUDE.md (1)
150-153: ⚡ Quick winAvoid manual
PR_NUMentry in a mandatory path.Using a hand-copied PR number is brittle and easy to misapply to the wrong PR. Prefer deriving it directly from the current branch context.
Safer PR number resolution
-PR_NUM=<the number gh just printed> +PR_NUM=$(gh pr view --repo LeanerCloud/CUDly --json number --jq '.number') ISSUE_NUM=<the issue this PR closes>🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@CLAUDE.md` around lines 150 - 153, Replace the brittle manual PR_NUM assignment after `gh pr create` with automatic resolution: capture the created PR number programmatically (e.g., parse `gh pr create` output or call `gh pr view` for the current branch) and set PR_NUM from that value; reference the variables PR_NUM and ISSUE_NUM and the command `gh pr create` in your changes so the script derives PR_NUM from the current branch/PR context rather than requiring manual entry.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@CLAUDE.md`:
- Around line 154-160: The script currently unconditionally runs gh pr edit
"$PR_NUM" --add-label "$LABELS", which fails when LABELS is empty; change it to
guard the call by checking the LABELS variable first (the LABELS assignment and
the gh pr edit "$PR_NUM" --add-label "$LABELS" invocation), e.g., only call gh
pr edit with --add-label when LABELS is non-empty and otherwise surface the
triage gap deterministically (for example add a specific fallback label like
"triage-needed" or post a comment) so the workflow does not break on empty label
payloads.
---
Nitpick comments:
In `@CLAUDE.md`:
- Around line 150-153: Replace the brittle manual PR_NUM assignment after `gh pr
create` with automatic resolution: capture the created PR number
programmatically (e.g., parse `gh pr create` output or call `gh pr view` for the
current branch) and set PR_NUM from that value; reference the variables PR_NUM
and ISSUE_NUM and the command `gh pr create` in your changes so the script
derives PR_NUM from the current branch/PR context rather than requiring manual
entry.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
|
Added a follow-up commit ( |
|
Tip For best results, initiate chat on the files or code changes.
[review] |
…nd manual PR_NUM Address CodeRabbit review on PR #238: 1. Actionable (Major): `gh pr edit --add-label ""` fails on empty payload, silently breaking the MANDATORY label-mirror flow when the closing issue has no priority/severity/urgency/impact/effort/type labels. Guard the call with `if [ -n "$LABELS" ]` and emit a clear WARN otherwise that directs the operator to triage the issue first and surface the gap. 2. Nitpick (Quick win): `PR_NUM=<the number gh just printed>` is brittle and easy to misapply to the wrong PR. Derive it from the current branch context via `gh pr view --json number --jq '.number'` instead, so the snippet works without any hand-editing after `gh pr create`. Both changes are in the prescriptive CLAUDE.md snippet only. The labels flow itself is unchanged behaviorally for the happy path (issue has the expected triage labels); the new branches harden the unhappy paths. Refs #237.
CodeRabbit pass 1 — both findings addressedPushed commit Actionable (Major) — empty
|
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 19004
Review summary✅ Empty
|
| Criterion | Status |
|---|---|
| "PR labeling — mirror closing-issue labels (MANDATORY)" section | ✅ |
Exact gh invocation with jq filter for all label classes |
✅ |
| Multi-close handling (highest priority/severity, union rest) | ✅ |
| No-triaged-lie rule | ✅ |
| "Before declaring done" checkpoint mirrors CI-watcher pattern | ✅ |
| Post-push CI watcher section present | ✅ |
| CodeRabbit loop section present | ✅ |
| Subagent-delegation exit criteria in CR-loop | ✅ |
No actionable items remain. The PR is ready to merge.
[approve]
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai resolve |
✅ Actions performedComments resolved. Approval is disabled; enable |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
CR finding verification - PR_NUM auto-derivationBoth findings from the CodeRabbit review (2026-05-03) against commit 7dbe911 are already addressed in commit 64fc92a: Nitpick (lines 150-153): brittle manual PR_NUM PR_NUM=$(gh pr view --repo LeanerCloud/CUDly --json number --jq '.number')This derives the PR number automatically from the current branch context. Major (lines 165-180): unconditional gh pr edit --add-label on empty LABELS No new commits are needed. Current HEAD is 64fc92a on branch docs/issue-237-codify-pr-labeling. @coderabbitai review |
|
Both fixes were already validated in the prior review, all acceptance criteria from ✅ Actions performedReview triggered.
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai review |
Rate Limit Exceeded
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai full review |
✅ Action performedFull review finished. |
bbba22b to
c3ae487
Compare
…nd manual PR_NUM Address CodeRabbit review on PR #238: 1. Actionable (Major): `gh pr edit --add-label ""` fails on empty payload, silently breaking the MANDATORY label-mirror flow when the closing issue has no priority/severity/urgency/impact/effort/type labels. Guard the call with `if [ -n "$LABELS" ]` and emit a clear WARN otherwise that directs the operator to triage the issue first and surface the gap. 2. Nitpick (Quick win): `PR_NUM=<the number gh just printed>` is brittle and easy to misapply to the wrong PR. Derive it from the current branch context via `gh pr view --json number --jq '.number'` instead, so the snippet works without any hand-editing after `gh pr create`. Both changes are in the prescriptive CLAUDE.md snippet only. The labels flow itself is unchanged behaviorally for the happy path (issue has the expected triage labels); the new branches harden the unhappy paths. Refs #237.
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
c3ae487 to
29c2c16
Compare
…nd manual PR_NUM Address CodeRabbit review on PR #238: 1. Actionable (Major): `gh pr edit --add-label ""` fails on empty payload, silently breaking the MANDATORY label-mirror flow when the closing issue has no priority/severity/urgency/impact/effort/type labels. Guard the call with `if [ -n "$LABELS" ]` and emit a clear WARN otherwise that directs the operator to triage the issue first and surface the gap. 2. Nitpick (Quick win): `PR_NUM=<the number gh just printed>` is brittle and easy to misapply to the wrong PR. Derive it from the current branch context via `gh pr view --json number --jq '.number'` instead, so the snippet works without any hand-editing after `gh pr create`. Both changes are in the prescriptive CLAUDE.md snippet only. The labels flow itself is unchanged behaviorally for the happy path (issue has the expected triage labels); the new branches harden the unhappy paths. Refs #237.
…nd manual PR_NUM Address CodeRabbit review on PR #238: 1. Actionable (Major): `gh pr edit --add-label ""` fails on empty payload, silently breaking the MANDATORY label-mirror flow when the closing issue has no priority/severity/urgency/impact/effort/type labels. Guard the call with `if [ -n "$LABELS" ]` and emit a clear WARN otherwise that directs the operator to triage the issue first and surface the gap. 2. Nitpick (Quick win): `PR_NUM=<the number gh just printed>` is brittle and easy to misapply to the wrong PR. Derive it from the current branch context via `gh pr view --json number --jq '.number'` instead, so the snippet works without any hand-editing after `gh pr create`. Both changes are in the prescriptive CLAUDE.md snippet only. The labels flow itself is unchanged behaviorally for the happy path (issue has the expected triage labels); the new branches harden the unhappy paths. Refs #237.
29c2c16 to
194f63c
Compare
…oses #237 Add project-specific guidance to CLAUDE.md for the post-push CI watcher (mandatory for all commits on CUDly PRs due to 9-15 min pre-commit job runtime) and label-mirroring rule (PRs must carry the same priority/severity/ urgency/impact/effort/type labels as their closing issues). Resolves conflict by including main's "Known Issues" section alongside the new sections added by this PR.
194f63c to
30a5a6f
Compare
|
Rebased onto origin/main, all CI checks passed, squash-merged. |
…oses #237 (#238) Add project-specific guidance to CLAUDE.md for the post-push CI watcher (mandatory for all commits on CUDly PRs due to 9-15 min pre-commit job runtime) and label-mirroring rule (PRs must carry the same priority/severity/ urgency/impact/effort/type labels as their closing issues). Resolves conflict by including main's "Known Issues" section alongside the new sections added by this PR.
Summary
feat/multicloud-web-frontendbase branch.git pushso CI failures surface within the same turn.priority/*,severity/*,urgency/*,impact/*,effort/*,type/*,triaged) onto every new PR viagh pr edit --add-label, before pinging CodeRabbit. Unlabeled PRs are invisible to priority-orderedis:open label:priority/p*queries.The silent failure that motivated this PR: 10 PRs shipped in two recent batches, all merged-eligible after CR sign-off, none labeled — making them invisible to triage ordering.
Dogfooding
This PR itself is labeled with the issue's triage labels per the new rule (
type/docs,priority/p3,severity/low,urgency/eventually,impact/internal,effort/xs,triaged).Test plan
CLAUDE.mdcontains## PR labeling — mirror closing-issue labels (MANDATORY)between## CodeRabbit loopand## Security Rulesghinvocation with jq filter for all label classesSummary by CodeRabbit