Skip to content

ci: share final gate checks across Core and REST - #4742

Open
chet wants to merge 1 commit into
NVIDIA:mainfrom
chet:gh-issue-4741
Open

ci: share final gate checks across Core and REST#4742
chet wants to merge 1 commit into
NVIDIA:mainfrom
chet:gh-issue-4741

Conversation

@chet

@chet chet commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

This is a follow-up to #4655, where we made Core verify that every top-level CI job is covered by core-ci-pass, but left REST on its own jq result check. Nothing catches a new REST job added without also updating rest-ci-pass, so the two required checks can drift even though they enforce the same rule.

So, this turns check_core_ci_gate.py into check_ci_gate.py, keeps the lane-specific gate names and exemptions in explicit policies, and runs the same inventory and result checks for both workflows.

  • Expected green-run effect: No speedup is expected; rest-ci-pass adds one small hosted checkout before it evaluates the job results.
  • What it really buys us: New REST jobs cannot quietly sit outside rest-ci-pass, and malformed result data now fails closed instead of passing through REST's separate jq check.

Core keeps its existing 52-job contract, while REST starts with all nine top-level jobs accounted for. success and skipped remain the only passing results; #4586 still owns deciding whether an individual skip was actually valid.

Related issues

This supports #4741

Type of Change

  • Add - New feature or capability
  • Change - Changes in existing functionality
  • Fix - Bug fixes
  • Remove - Removed features or deprecated functionality
  • Internal - Internal changes (refactoring, tests, docs, etc.)

Breaking Changes

  • This PR contains breaking changes

Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed
  • No testing required (docs, internal refactor, etc.)

Validated both live workflow inventories, Actionlint, cargo make format-nightly, cargo make clippy, and the cached full Carbide-lints gate.

Additional Notes

This deliberately preserves the current blanket acceptance of skipped. #4586 still owns classifier-aware skip validation, Actions API pagination, job-name mapping, cross-workflow correlation, and timing reports.

@chet
chet requested a review from a team as a code owner August 8, 2026 01:28
@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Summary by CodeRabbit

  • New Features
    • Added support for validating multiple CI gate policies, including Core and REST workflows.
    • Added policy selection for inventory validation with clearer policy-specific diagnostics.
  • Bug Fixes
    • Improved handling of missing, malformed, or unreadable workflow results so they correctly fail validation.
    • Strengthened final-gate checks across Core and REST CI workflows.
  • Tests
    • Added coverage for policy selection, invalid policies, workflow access errors, and result validation.

Walkthrough

The CI gate checker now supports Core CI and REST CI policies. Both workflows use the shared checker for inventory and result validation. Tests cover policy selection, REST inventory rules, command errors, and result handling.

Changes

CI gate policy validation

Layer / File(s) Summary
Policy contracts and workflow parsing
.github/ci/check_ci_gate.py
GatePolicy defines gate jobs and exemptions for Core CI and REST CI. Workflow parsing and diagnostics use the selected gate job.
Policy-based inventory and command dispatch
.github/ci/check_ci_gate.py
Inventory validation applies the selected policy. The CLI requires --policy for inventory commands and accepts optional argument lists.
Policy and CLI test coverage
.github/ci/test_check_ci_gate.py
Tests cover REST inventories, policy mismatches, policy selection, unreadable workflows, and shared result validation.
Core and REST workflow integration
.github/workflows/ci.yaml, .github/workflows/rest-ci.yml
Core CI uses the shared checker with --policy core. REST CI validates its inventory and delegates result evaluation to the shared checker.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant REST CI workflow
  participant check_ci_gate.py
  participant GitHub Actions job results
  REST CI workflow->>check_ci_gate.py: inventory --policy rest
  check_ci_gate.py-->>REST CI workflow: inventory validation result
  REST CI workflow->>GitHub Actions job results: collect NEEDS_JSON
  REST CI workflow->>check_ci_gate.py: results with serialized job results
  check_ci_gate.py-->>REST CI workflow: result validation status
Loading

Possibly related issues

  • NVIDIA/infra-controller#4741 — The PR implements the shared policy-aware checker for Core CI and REST CI, replacing REST-specific validation.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes sharing final-gate checks across Core and REST workflows.
Description check ✅ Passed The description directly explains the shared checks, policy handling, workflow changes, testing, and intended effect.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@chet

chet commented Aug 8, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full_review, thanks!

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

@chet I will perform a complete review of the pull request.

🐇

✅ Action performed

Full review finished.

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown

🔐 TruffleHog Secret Scan

No secrets or credentials found!

Your code has been scanned for 700+ types of secrets and credentials. All clear! 🎉

🔗 View scan details

🕐 Last updated: 2026-08-08 01:49:19 UTC | Commit: 71c3119

As it stood, Core checked its final-gate inventory in source, while REST still had a separate `jq` block and no guard when a top-level job was added without updating `rest-ci-pass`. That meant the two required checks could drift even though they enforce the same current rule.

So, this turns `check_core_ci_gate.py` into `check_ci_gate.py`, keeps the lane-specific gate names and exemptions in explicit policies, and runs the same inventory and result checks for both workflows.

Primary callouts are:

- **Expected green-run effect:** No speedup is expected; `rest-ci-pass` adds one small hosted checkout before it evaluates the job results.
- **What it really buys us:** New REST jobs cannot quietly sit outside `rest-ci-pass`, and malformed result data now fails closed instead of passing through REST's separate `jq` check.
- Core keeps its existing 52-job contract, while REST starts with all nine top-level jobs accounted for.
- `success` and `skipped` remain the only passing results; NVIDIA#4586 still owns deciding whether an individual skip was actually valid.

Tests updated!

This supports NVIDIA#4741

Signed-off-by: Chet Nichols III <chetn@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant