fix: §12 采样先跳过 in-flight 再收集已完结 head(P1-4,ADR-0034) - #120
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 Qodo修复 required-check 已完结 head 采样并移除队列对账
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo
1. Candidate scan remains capped
|
| { [[ $N_CONCL -ge $COLLECT_N ]] || [[ $N_SEEN -ge 10 ]]; } && break | ||
| N_SEEN=$((N_SEEN+1)) |
There was a problem hiding this comment.
2. Candidate scan remains capped 🐞 Bug ≡ Correctness
The new loop can never scan up to 10 candidates because HEADS is still truncated to the first three eligible PRs before the loop. If those three are in-flight or have zero checks, the script emits SKIP without examining later completed heads, preserving the sampling defect this PR intends to fix.
Agent Prompt
## Issue description
The completed-head collector has a limit of 10, but its input contains at most three heads. Consequently, skipped in-flight or zero-check heads cannot be replaced by later completed candidates.
## Issue Context
Build `HEADS` from enough recent eligible PRs for the collector to inspect up to 10 candidates, while preserving the default-branch fallback when no eligible PR activity exists.
## Fix Focus Areas
- governance/drift-check.sh[462-469]
- governance/drift-check.sh[484-502]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| if ! jq -e 'type == "object" and has("check_runs")' <<<"$CRS" >/dev/null 2>&1; then | ||
| QUERY_FAIL=1; continue |
There was a problem hiding this comment.
3. Query failures become missing checks 🐞 Bug ☼ Reliability
The PR removes response validation from the per-context check-runs lookup, so an API error or malformed response simply leaves FOUND=0. With QUERY_FAIL unchanged, the script falsely reports a missing required check instead of identifying an unverifiable query.
Agent Prompt
## Issue description
The second check-runs request is not validated, even though the sampling request validates the same endpoint. Failed requests are therefore misclassified as missing required checks.
## Issue Context
Prefer caching each validated response during candidate collection and reusing it for context checks. If requests remain in the inner loop, validate every response and set the query-failure state before evaluating check names.
## Fix Focus Areas
- governance/drift-check.sh[488-501]
- governance/drift-check.sh[512-525]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| # ---------- 14. merge queue 对账(P2-7,ADR-0042;repo 级 ruleset)---------- | ||
| # org rulesets API 不支持 merge_queue 规则类型(实测 422)——merge queue 只能以 | ||
| # repo 级 ruleset 存在(须与 pull_request/required_status_checks 同集)。期望状态 |
There was a problem hiding this comment.
4. Merge-queue drift check removed 🐞 Bug ≡ Correctness
Deleting §14 removes the only reconciliation of the repository-level merge-queue rulesets declared in expected state. The scheduled checker can now report no drift when a queue is deleted or its merge method, limits, timeout, grouping strategy, or required gate changes.
Agent Prompt
## Issue description
The PR deletes the only drift detection for active repository-level merge-queue rulesets, despite those rulesets remaining declared and applied elsewhere.
## Issue Context
Restore §14 or provide equivalent repository-ruleset reconciliation. It must validate declared repositories and parameters, detect undeclared merge queues, and fail closed on API or parsing failures.
## Fix Focus Areas
- governance/drift-check.sh[577-585]
- governance/expected-state.json[83-97]
- governance/apply.sh[143-154]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
摘要
#85 T1 注入实测发现的采样缺陷(ADR-0034 §12 修订 2):
问题:现实现先取「最近更新前 3」再跳过 in-flight head——并发连开 PR 时(实测:另一工作流同时在 Use-up-Plan 连开 5 个测试 PR),改名注入头被挤出前 3,而 in-flight 头白白占用采样位,导致活体缺失漏检(T1 首轮实测未检出)。
修复:先跳过零-check/in-flight head,再收集最近 3 个「已完结」head 作为样本(最多扫描 10 个候选):
验证