Repository navigation
feat(evidence): surface aicr build commit on corroboration dashboard - #3063
Conversation
Runs that share an aicrVersion, such as nightly main runs, were only distinguishable by run id and attested date. The build commit now flows from the CLI through the evidence predicate (aicrCommit), the ingest meta.json, and corroborate RunMeta into the dashboard JSON. The renderer shows a short SHA on each build column and a linked commit row in the run details panels. The field is optional. A value that is not a 7-40 character hex SHA, including the unstamped default "unknown", is omitted at emit time and dropped at dashboard generation, so commit-less bundles ingest and render unchanged. catalog.IsValidCommit is exported so both stages reuse the existing SHA check. Signed-off-by: Mike Cook <micook@nvidia.com>
|
🌿 Preview your docs: https://nvidia-preview-feat-aicr-commit-dashboard.docs.buildwithfern.com/aicr |
Recipe evidence checkNo leaf overlays affected by this PR. This gate is warning-only and never blocks merge. |
|
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 configurationConfiguration used: Repository: NVIDIA/aicr/.coderabbit.yaml Review profile: ASSERTIVE Plan: Enterprise Run ID: 📒 Files selected for processing (20)
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review. 📝 WalkthroughWalkthroughThe AICR build commit now passes through evidence predicates and synthesized run metadata into corroboration output. The dashboard displays valid commits as short SHAs and GitHub links. Invalid commit values are omitted without excluding their runs. The commit remains display metadata and is not a consensus key. Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Feature Suggested reviewers: Fixed issue severity: <fixed_issue_severity>Medium</fixed_issue_severity> Merge Risk: ⚪ Minimal · up to The commit display change appears mergeable after normal checks. Commit-less runs continue to render without the new field. 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Summary
Thread the aicr build commit from the CLI through the evidence predicate, ingest
meta.json, and corroborateRunMetato the dashboard. Each run now shows its short SHA, linked to the commit on GitHub.Motivation / Context
Nightly
mainruns all shareaicrVersion: main, so on the dashboard they could only be told apart by GitHub run id and attested date. The commit was captured at build time but dropped before it reached any metadata the dashboard reads.Fixes: #1596
Related: N/A
Type of Change
Component(s) Affected
cmd/aicr,pkg/cli)cmd/aicrd,pkg/server)pkg/recipe)pkg/bundler,pkg/component)pkg/collector,pkg/snapshotter)pkg/validator)pkg/errors,pkg/k8s)docs/,examples/)pkg/evidence/attestation,pkg/evidence/project,pkg/corroborate(incl. renderer),pkg/client/v1Implementation Notes
aicrCommiton the predicate,project.Meta,corroborate.RunMeta,Latest, andSeriesBuild. It isomitemptyeverywhere, so output for a commit-less run is byte-identical to before.1.0.0,meta.jsonstaysaicr-corroboration-meta/v1, and the dashboard staysaicr-corroboration/v1. The field is additive and optional, every consumer decodes leniently, and nothing gates on the predicateschemaVersion.BuildPredicatelowercases it and drops anything that is not a 7-40 character hex SHA, so the unstamped ldflags defaultunknownis never recorded.corroborate.loadRundrops a malformed commit frommeta.jsonwith a warning but keeps the run, because the input tree may not come from the trusted ingest. The renderer re-checks the hex pattern before building the link, and every value still goes throughesc.catalog.isValidCommitis exported ascatalog.IsValidCommitso both stages reuse the existing SHA check instead of duplicating it.aicrVersion.commitrow linking tohttps://github.com/NVIDIA/aicr/commit/<sha>.PublishandSignExistingrebuild from the on-disk statement, so a commit stamped at emit time survives later signing.maincell binary withcommit=<github.sha>. Until that lands, those runs carry no commit and render as they do today.Testing
make qualifypasses. All listed packages pass under-race. New or extended tests:TestBuildPredicate_AICRCommit: a full or short SHA is kept, and uppercase is lowercased.unknown, an empty value, a too-short value, and non-hex values are dropped, and the key is then absent from the JSON.TestEmit_StampsAICRCommitIntoStatement: the commit lands in the on-disk in-toto statement, not just the in-memory predicate.TestSynthesize_HappyPath/TestSynthesize_CommitlessPredicateOmitsCommit:meta.jsoncarries the commit, and a commit-less predicate omits the key.TestGenerateSurfacesAICRCommit: twomainruns from different commits are distinguishable in bothindex.jsonand the series. A malformed commit is dropped but its run is kept, and the value never reaches the output.TestRendererCommitLinkRequiresSHA: the renderer only builds the commit link for a hex SHA.Coverage:
Risk Assessment
The field is optional and omitted when empty. Older bundles and release cells ingest and render unchanged.
Rollout notes: Backward compatible in both directions. Older verifiers and consumers ignore the new field, and newer consumers treat a missing field as no commit. No migration or flag needed.
Checklist
make testwith-race)make lint)git commit -s -S) — GPG signing info