Repository navigation
fix(ci): reconcile Validation gates with sparse job metadata - #3298
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
Smoke Summary⏭️ Runtime smoke is not required
|
Static Analysis Summary✅ Static analysis checks passed
CodeQL breakdown
|
[High impact] Changes CI validation gate recovery logic in build automation. The PR appears safe to merge, with a non-blocking gap in retry coverage. Findings
Reviews (1) · Last reviewed commit: "Recover sparse Validation gate steps fro..." · Reviewed by Greptile |
Security Summary✅ Security checks passed or were intentionally skipped
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Hey - I've found 3 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path=".github/actions/preserve-required-gate/assess-required-gate.sh" line_range="514" />
<code_context>
+ continue
+ fi
+ if [[ "${preserve_step_state}" == "absent" ]]; then
+ if recovered_job_json="$(recover_validation_job_from_attempt 2>>"${api_error_file}")"; then
+ job_json="${recovered_job_json}"
+ job_cache["${job_id}"]="${job_json}"
</code_context>
<issue_to_address>
**Recovery requests scale with history**
When a PR head has many historical Validation checks with absent direct step metadata while the token has limited API quota, the paginated check-run list is processed candidate by candidate, and each candidate with absent step metadata triggers three additional API requests. A PR with many such historical checks consumes the token’s API quota and the assessment fails closed before preserving the gate.
Bound recovery requests across the full candidate set or otherwise avoid making three recovery API calls for every sparse candidate.
</issue_to_address>
### Comment 2
<location path=".github/actions/preserve-required-gate/assess-required-gate.sh" line_range="514" />
<code_context>
+ continue
+ fi
+ if [[ "${preserve_step_state}" == "absent" ]]; then
+ if recovered_job_json="$(recover_validation_job_from_attempt 2>>"${api_error_file}")"; then
+ job_json="${recovered_job_json}"
+ job_cache["${job_id}"]="${job_json}"
</code_context>
<issue_to_address>
**Supplementary status remains unresolved**
When the metadata-barrier resolver consumes a source whose direct job response omits steps but whose exact-attempt response contains the skipped preservation step, `selected_source_native` in `resolve-deferred-gate.sh` refetches the job through `/actions/jobs/{id}` and requires the skipped preservation step there; it returns failure when that response is sparse, so the resolver leaves the supplementary status unresolved despite the assessor accepting the exact-attempt evidence.
Make the resolver independently verify the exact-attempt job snapshot too, or pass and validate the recovered evidence instead of relying on the sparse direct job response.
</issue_to_address>
### Comment 3
<location path=".github/actions/preserve-required-gate/assess-required-gate.sh" line_range="514" />
<code_context>
+ continue
+ fi
+ if [[ "${preserve_step_state}" == "absent" ]]; then
+ if recovered_job_json="$(recover_validation_job_from_attempt 2>>"${api_error_file}")"; then
+ job_json="${recovered_job_json}"
+ job_cache["${job_id}"]="${job_json}"
</code_context>
<issue_to_address>
**Recovery API errors are hidden**
When an attempt-evidence API request fails, `recover_validation_job_from_attempt` returns failure for both invalid evidence and failed GitHub API calls, but the caller redirects its stderr to `api_error_file` and later reports only generic ambiguous metadata. The assessment fails without operators being able to distinguish malformed evidence from transient or permission-related API failures.
Report the captured API error when recovery fails because of an API request, while keeping invalid-evidence failures distinct.
</issue_to_address>
Validation Summary✅ All validation checks passed
Coverage reports and failure logs are available in the workflow artifacts. |
GitHub returned no steps for a successful Validation gate after a retry, although its complete exact-attempt jobs response retained the skipped preservation step. Both the assessor and trusted reconciliation path need those native step facts to clear the supplementary status.
Recover absent direct metadata only for canonical Validation. The action-local verifier binds the complete one-page snapshot to the run, attempt, workflow, PR tuple, job, check, timestamps and Actions App. The resolver independently verifies that evidence again before publication. Ordinary direct evidence, other gate families, metadata-only preservation, cancellation and newer substantive-failure precedence retain their existing behavior. Historical sparse-candidate recovery is capped at three snapshots and fails closed on exhaustion; API failures and unbound evidence have distinct nonsecret diagnostics.
Validation: ShellCheck and the full required-gate context/status-producer contract pass, including attempt 2, sparse and null direct steps, final source changes, recovery exhaustion, and ordinary replay. An independent Luna xhigh review covered the complete four-file patch against develop and reported zero findings. No product queue entry or review allocation is added.
Original #3295 proof recovery remains to be verified after this maintenance fix is merged into the trusted resolver source.
FireMUD LOC impact
Compared
0efaa677b46a→7ca7b864eedd(PR merge-base → head).PR scope: 4 changed files · 595 added textual lines / 26 deleted textual lines.
Rows are hierarchical and overlapping views; do not add them together.
LOC means cloc code lines; blank and comment-only lines are excluded.