fix: suppression 门工件移出被审树(pr.diff 标记行重复计数根除,.github #87) - #49
Conversation
|
Warning Review limit reached
Next review available in: 2 minutes Limit details: You’ve used all 10 included reviews currently available. Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?Wait for the limit to reset, then comment An organization admin can change what happens after included review limits in Billing. How do review limits work?CodeRabbit enforces per-developer PR review limits within each organization. For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day 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 |
PR Summary by QodoFix suppression gate double-count by writing PR artifacts to RUNNER_TEMP
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
There was a problem hiding this comment.
Pull request overview
This PR updates the suppression-gate workflow to write PR diff/title/body artifacts into RUNNER_TEMP instead of the workspace, preventing tree-scan double counting of suppression marker lines (per the v1.5.9 retest context described in the PR).
Changes:
- Redirect PR diff/title/body fetch outputs to
$RUNNER_TEMPto keep the workspace scan tree clean. - Update
suppression-budget.shinvocation to consume those$RUNNER_TEMPpaths.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| gh api "repos/$REPO/pulls/$PR_NUM" -H "Accept: application/vnd.github.diff" > "$RUNNER_TEMP/pr.diff" | ||
| test -s "$RUNNER_TEMP/pr.diff" || { echo "::error::suppression-budget: PR diff 拉取为空(fail-closed)"; exit 1; } | ||
| printf '%s' "$PR_TITLE" > "$RUNNER_TEMP/pr-title.txt" | ||
| gh api "repos/$REPO/pulls/$PR_NUM" --jq '.body // ""' > "$RUNNER_TEMP/pr-body.txt |
Code Review by Qodo
1. Unterminated quote breaks gate
|
| gh api "repos/$REPO/pulls/$PR_NUM" -H "Accept: application/vnd.github.diff" > "$RUNNER_TEMP/pr.diff" | ||
| test -s "$RUNNER_TEMP/pr.diff" || { echo "::error::suppression-budget: PR diff 拉取为空(fail-closed)"; exit 1; } | ||
| printf '%s' "$PR_TITLE" > "$RUNNER_TEMP/pr-title.txt" | ||
| gh api "repos/$REPO/pulls/$PR_NUM" --jq '.body // ""' > "$RUNNER_TEMP/pr-body.txt |
There was a problem hiding this comment.
1. Unterminated quote breaks gate 🐞 Bug ≡ Correctness
In the “取 PR diff / 标题 / 正文” step, the redirect target for pr-body.txt is missing a closing quote, causing a bash parse error and failing the workflow before suppression-budget.sh can run.
Agent Prompt
### Issue description
The workflow step that fetches the PR body writes to `"$RUNNER_TEMP/pr-body.txt` without a closing quote, which causes bash to error (unterminated string) and stops the job.
### Issue Context
This is inside a `run: |` block executed with `set -euo pipefail`, so the step will fail immediately and the downstream `suppression-budget.sh` invocation (which expects `--pr-body` to point to a real file) will never execute.
### Fix Focus Areas
- .github/workflows/suppression-gate.yml[106-112]
### Proposed fix
Add the missing trailing `"`:
```bash
gh api "repos/$REPO/pulls/$PR_NUM" --jq '.body // ""' > "$RUNNER_TEMP/pr-body.txt"
```
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
v1.5.9 复测(Use-up-Plan PR#61):净增 5 正确判定,但总量=10——pr.diff 工件留在工作区,其中 5 个标记行被树扫描重复计入。工件改写 RUNNER_TEMP。基线无需上调(真实 main 计数 0)。C1:.github/,ADR-0036 修订域。