Skip to content

fix(evidence): track check results at runtime instead of scanning directory#396

Merged
mchmarny merged 2 commits intoNVIDIA:mainfrom
yuanchen8911:fix/evidence-runtime-tracking
Mar 13, 2026
Merged

fix(evidence): track check results at runtime instead of scanning directory#396
mchmarny merged 2 commits intoNVIDIA:mainfrom
yuanchen8911:fix/evidence-runtime-tracking

Conversation

@yuanchen8911
Copy link
Copy Markdown
Contributor

Summary

Replace directory-scanning summary in collect-evidence.sh with runtime result tracking. A new run_check() wrapper records each check's outcome as it executes, so the final summary only reflects checks from the current run — not stale files from previous runs.

Motivation / Context

The evidence summary scanned EVIDENCE_DIR for .md files, which meant leftover files from earlier runs could inflate pass counts or hide regressions.

Fixes: #392
Related: N/A

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/api, 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: pkg/evidence/scripts/collect-evidence.sh

Implementation Notes

  • Added CHECK_RESULTS global variable and run_check() helper after wait_for_port().
  • Every collector call in the case statement (individual and all) now goes through run_check.
  • Summary reads CHECK_RESULTS instead of globbing the evidence directory.

Testing

# Script is a bash helper — verified via shellcheck and manual review
shellcheck pkg/evidence/scripts/collect-evidence.sh

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

Rollout notes: N/A

Checklist

  • Tests pass locally (make test with -race)
  • 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

…ectory

The evidence summary previously scanned the output directory for .md
files, which could report stale results from previous runs. Now each
check's result is recorded at runtime via run_check() wrapper, and
the summary only shows checks that actually executed.

Fixes: NVIDIA#392

Signed-off-by: Yuan Chen <yuanchen97@gmail.com>
@mchmarny mchmarny enabled auto-merge (squash) March 13, 2026 11:29
@mchmarny mchmarny disabled auto-merge March 13, 2026 11:34
@mchmarny mchmarny merged commit 87cb118 into NVIDIA:main Mar 13, 2026
12 checks passed
xdu31 pushed a commit to xdu31/aicr that referenced this pull request Mar 24, 2026
…ectory (NVIDIA#396)

Signed-off-by: Yuan Chen <yuanchen97@gmail.com>
Co-authored-by: Mark Chmarny <mchmarny@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(evidence): summary should use runtime results instead of scanning evidence directory

2 participants