Skip to content

ci(uat): split readiness gate into its own phase and step - #2989

Merged
mchmarny merged 4 commits into
NVIDIA:mainfrom
njhensley:ci/uat-readiness-gate-2630
Sep 30, 2026
Merged

mchmarny merged 4 commits into
NVIDIA:mainfrom
njhensley:ci/uat-readiness-gate-2630

Conversation

@njhensley

@njhensley njhensley commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

Summary

Split the UAT readiness gate out of the install phase into its own readiness phase and workflow step, so a gate that never converges no longer shows up as an install failure. Each gate attempt now captures the failing validators' own output (for example expected-resources' Failed resources: block) in cluster-debug/readiness-gate.log.

Motivation / Context

From 2026-09-04 to 2026-09-08, every AKS/EKS/GKE nightly failed at UAT - install (helmfile apply). The real cause was the expected-resources deployment validator failing the readiness gate. Because the step name pointed at infra, the failures were written off as noise for four nights. The validator's diagnosis also never made it into the debug bundle, since the validator pods are reaped between gate attempts and the gate ran with --output /dev/null.

Fixes: #2630
Related: #2593, #2594, #2597

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)
  • Build/CI/tooling

Component(s) Affected

  • CLI (cmd/aicr, pkg/cli)
  • API server (cmd/aicrd, pkg/server)
  • Recipe engine / data (pkg/recipe)
  • Bundlers (pkg/bundler, pkg/component/*)
  • Collectors / snapshotter (pkg/collector, pkg/snapshotter)
  • Validator (pkg/validator)
  • Core libraries (pkg/errors, pkg/k8s)
  • Docs/examples (docs/, examples/)
  • Other: UAT harness (tests/uat/), UAT workflows (.github/workflows/uat-{aws,gcp,azure,kind}.yaml), aicr-uat-report skill

Implementation Notes

New readiness phase (tests/uat/lib/phases.sh)

  • phase_install now only applies (helmfile apply or argocd sync) and dumps post-install state. The new phase_readiness runs install_readiness_gate.
  • run readiness <config> dispatches to it, and run all runs it between install and conformance. The usage text lists the new phase.

New workflow step on aws/gcp/azure/kind

  • UAT - readiness gate (validate --phase deployment) (id: readiness) runs after install, gated on steps.install.outcome == 'success'.
  • The downstream conditions now key off steps.readiness.outcome instead of steps.install.outcome: the conformance step (UAT - validate (all phases) + emit signed evidence) and the AWS/Azure pre-validate credential refresh. The run-summary table gets a Readiness gate row. Debug collection and teardown still run on any failure.
  • Timeouts: the old combined install budget is split into install 25m (45m for AWS argocd) plus readiness 65m, so per-job totals don't change. The 65m covers READINESS_TIMEOUT_SECONDS (60m) plus room for the fail-closed diagnostic.
  • AWS and Azure refresh credentials right before the gate. The in-loop cloud_refresh_credentials hook is unchanged, and the runner comments now point at phase_readiness.
  • The readiness step gets no GITHUB_TOKEN. Only the argocd apply needs it.
  • kind's install step drops + readiness gate from its name. daytime-up still runs the gate before holding the cluster, so a held cluster has always passed the gate.

Per-attempt CTRF report instead of --output /dev/null

  • Each gate attempt writes its CTRF report to a per-gate mktemp -d scratch dir. The previous attempt's report is deleted first so stale data can't be misattributed. The scratch dir is removed on every exit path.
  • For a failed attempt, readiness-gate.log gets a --- failed validator output (attempt N) --- block. It lists each non-passed test's name, status, message, and stdout. For expected-resources, that includes the Failed resources: list that used to be lost when the pods were reaped. A census-regress attempt records the census reason the same way.
  • The extraction runs in if/|| contexts, so it only adds diagnostics. A missing or malformed report produces a fallback note and can never turn a failed attempt into a pass or abort the gate under errexit.
  • On gate failure, the phase emits one titled annotation, ::error title=UAT readiness gate failed::<validators>: <reason>, naming the validators that failed the last attempt. The message goes through gha_escape_data, so newlines can't truncate or forge an annotation. If the last attempt passed but the streak was still short at the deadline, the annotation says none on the last attempt instead of blaming an earlier failure.

Reporting and docs

  • docs/contributor/uat.md documents which step fails for what, the annotation, and the per-attempt failed-validator block.
  • aicr-uat-report changes:
    • A failed readiness step is classified as product signal, and the failing validators from its annotation are appended.
    • An install failure is classified as apply-only (maybe infra) when the job has a readiness step, and as ambiguous for older runs where install still ran the gate.
    • The bundle triage digest shows the last failed-validator block from readiness-gate.log.

Testing

go test -race ./tests/uat/...          # ok  github.com/NVIDIA/aicr/tests/uat
bash tests/uat/lib/phases_test.sh      # All 33 phases_test cases passed
python3 -m py_compile .agents/skills/aicr-uat-report/uat_report.py   # ok
  • New TestUATReadinessGateIsItsOwnStep (table-driven over AWS/Azure/GCP/kind) checks four things in each workflow: the readiness step exists with the expected name and id; it runs after install; the install step no longer claims the gate; and it gets no GITHUB_TOKEN. It also checks that everything that needs a gated stack keys off steps.readiness.
  • phases_test.sh gains readiness cases for:
    • phase dispatch (readiness, all ordering, unknown-phase usage) and install no longer running the gate
    • pure CTRF extraction against a fixture, including missing, empty, and malformed reports
    • the gate end to end: a failed gate exits 1, logs each failed attempt's validator output, and annotates the validator by name; missing or malformed reports still fail and fall back to unknown validator; a short streak with a passing last attempt names no validator; a passing gate logs no failure block; scratch files are cleaned up
  • No Go source outside the tests/uat workflow test changed, so the coverage gate doesn't apply. The workflow changes still need a real UAT run to be exercised end to end; they have not been run yet.

Risk Assessment

  • Low — Isolated change, well-tested, easy to revert
  • Medium — Touches multiple components or has broader impact
  • High — Breaking change, affects critical paths, or complex rollout

This touches all four UAT lanes' step graphs and timeouts. The gate logic itself (pass criteria, streak, census fold-in, credential refresh) is unchanged; only where it runs and what it records changed. It is CI-only, with no product code or user-facing surface, and easy to revert.

Rollout notes: N/A for users. Step failures in UAT runs from before this change still show up under UAT - install ..., and aicr-uat-report labels those as ambiguous.

Checklist

  • Tests pass locally (make test with -race) — only go test -race ./tests/uat/... + phases_test.sh run so far
  • Linter passes (make lint)
  • I did not skip/disable tests to make CI green
  • I added/updated tests for new functionality
  • I updated docs if user-facing behavior changed
  • Changes follow existing patterns in the codebase
  • Commits are cryptographically signed (git commit -S) — GPG signing info

🤖 Generated with Claude Code

…r output

The install phase ran both the apply and the deployment readiness gate, so
a gate that never converged read as an install failure (NVIDIA#2630). Add a
`readiness` phase (also run by `all`) that owns install_readiness_gate;
install is now apply plus the post-install state dump.

Each gate attempt now writes its CTRF report instead of --output
/dev/null. For a failed attempt, readiness-gate.log gains a
"--- failed validator output (attempt N) ---" block with every
non-passed test's name, message, and stdout, including
expected-resources' "Failed resources:" list, which was previously lost
when the validator pods were reaped. On gate failure the phase emits
"::error title=UAT readiness gate failed::<validators>: <reason>".

Signed-off-by: Nathan Hensley <nhensley@nvidia.com>
Each cloud lane now runs `./tests/uat/<cloud>/run readiness` as
"UAT - readiness gate (validate --phase deployment)" (id: readiness)
after the install step, so a gate failure is legible from the run list
alone (NVIDIA#2630). kind's install step drops "+ readiness gate" from its
name.

The old combined install budget is split into install (25m; 45m for AWS
argocd) and readiness (65m), so per-job totals are unchanged. AWS and
Azure refresh credentials before the gate. The conformance step and the
pre-validate credential refresh now key off steps.readiness. Debug
collection and teardown still run on any failure. daytime-up still runs
the gate before holding the cluster. The readiness step gets no
GITHUB_TOKEN.

Signed-off-by: Nathan Hensley <nhensley@nvidia.com>
Document the install/readiness split in docs/contributor/uat.md: which
step fails for what, the "UAT readiness gate failed" annotation, and the
per-attempt failed-validator block in readiness-gate.log.

aicr-uat-report now tags a failed readiness step as product signal and
appends the failing validators from its annotation. It tags an install
failure as apply-only (maybe infra) when the job has a readiness step,
and as ambiguous for older runs where install still ran the gate. When
downloading a bundle, the triage digest echoes the last failed-validator
block from readiness-gate.log.

Signed-off-by: Nathan Hensley <nhensley@nvidia.com>
@njhensley njhensley added the theme/ci-dx CI pipelines, developer experience, and build tooling label Sep 29, 2026
@njhensley njhensley self-assigned this Sep 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: NVIDIA/aicr/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 116a94b2-3a7e-4434-9ff1-6aea7dc09218

📥 Commits

Reviewing files that changed from the base of the PR and between d695e76 and 368e0ce.

📒 Files selected for processing (1)
  • .agents/skills/aicr-uat-report/uat_report.py

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.


📝 Walkthrough

Walkthrough

UAT installation and deployment readiness now run as separate phases. AWS, Azure, GCP, and kind workflows run readiness after installation and gate later validation or conformance on readiness success. The readiness gate records failed-validator details in logs and workflow annotations. The UAT report tool classifies failures and adds readiness evidence to debug digests.

Priority: ➖ Normal

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

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: mchmarny

Merge Risk: ⚪ Minimal · up to 368e0

Readiness failures are separated from installation failures, later checks are gated appropriately, and failure diagnostics remain available. No material merge risk is established.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: separating the UAT readiness gate into its own phase and workflow step.
Description check ✅ Passed The description directly explains the readiness-phase split, workflow changes, diagnostics, reporting updates, testing, and rollout impact.
Linked Issues check ✅ Passed Issue [#2630] requires separate identification of install failures and readiness-gate failures, plus validator Failed resources: output in the debug bundle. The PR adds a separate readiness step in …
Out of Scope Changes check ✅ Passed The changes remain within issue [#2630]. Workflow changes implement the install/readiness split. Shell changes capture readiness diagnostics. Tests verify the new behavior. Documentation and the `aicr…
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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

@njhensley
njhensley marked this pull request as ready for review September 29, 2026 23:54
@njhensley
njhensley requested review from a team as code owners September 29, 2026 23:54

@mchmarny mchmarny left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve: no findings against d695e76.

@mchmarny
mchmarny enabled auto-merge (squash) September 30, 2026 14:54
@mchmarny
mchmarny merged commit 6d5973b into NVIDIA:main Sep 30, 2026
45 checks passed
ArangoGutierrez added a commit that referenced this pull request Sep 30, 2026
…-kwok-lane

Brings in main up to 25a725b, including #2989, which splits the
readiness gate out of phase_install into its own phase_readiness and
workflow step. Three hand-written files conflicted and were resolved
by hand so both sides survive:

- uat-azure.yaml, uat-gcp.yaml: the job budget comment keeps #2989's
  "install 25 + readiness 65" and this branch's "the selected CUJ".
- tests/uat/lib/phases.sh: phase_install is #2989's apply-only body;
  phase_readiness carries this branch's VALIDATE_PHASES condition, so
  a lane that leaves out the deployment phase still skips the gate and
  says so; the readiness budget comment points at phase_readiness; the
  #2096 note keeps "readiness-phase gate" and "before validate
  launches"; and the `all` arm keeps the intent-and-platform CUJ
  dispatch with #2989's phase_readiness call added.

Goldens did not conflict.

Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
ArangoGutierrez added a commit that referenced this pull request Sep 30, 2026
#2989 moved the readiness gate out of phase_install into its own
phase_readiness, and the merge carried this branch's VALIDATE_PHASES
condition over with it. Two of this branch's tests still assumed the
old shape:

- validate-phases_test.sh drove phase_install and expected it to run
  or skip the gate, so four checks failed once install stopped calling
  it. They now drive phase_readiness, which is where the knob decides.
- cuj-dispatch_test.sh stubs every phase before driving `uat_main all`,
  but not the new phase_readiness, so the real gate loop ran against
  AICR_BIN=/bin/true and the test hung until killed. It now stubs
  phase_readiness too.

Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
ArangoGutierrez added a commit that referenced this pull request Sep 30, 2026
After #2989, phase_install only applies the bundle; the readiness gate
runs in phase_readiness. The sim lane's install step was still named
"helmfile apply + readiness gate", which the merge made false. It now
matches the name #2989 gave the other lanes' install steps.

The phases.sh header also gains the one fact the merge added to the
readiness phase: it is skipped, with a log line, when VALIDATE_PHASES
leaves out the deployment phase.

Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
ArangoGutierrez added a commit that referenced this pull request Sep 30, 2026
#2989 moved the post-install readiness gate out of the install phase into
its own readiness phase, and gave each cloud lane a step that calls it. The
sim lane did not exist on main then, so after the merge nothing on it calls
the readiness phase. The gate stays off here either way, because run-sim sets
VALIDATE_PHASES=conformance, but phase_readiness's "readiness gate SKIPPED"
line no longer printed, so the skip became silent.

The lane now calls run-sim readiness after install, with a 5-minute budget
since the step can only announce the skip, and the topology check waits on
it as the cloud lanes' later steps wait on theirs. Run locally with no
cluster and a failing AICR_BIN, the step exits 0 and prints the skip line.

Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
@njhensley
njhensley deleted the ci/uat-readiness-gate-2630 branch October 1, 2026 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ci area/docs area/tests size/XL theme/ci-dx CI pipelines, developer experience, and build tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A failed UAT readiness gate is indistinguishable from an install failure

2 participants