feat(validate): warn on aicr version skew across inputs#1386
Conversation
Snapshots and recipes already embed the aicr version that produced them, but validate never compared them against each other or the running binary. Mixed-version artifacts can surface as confusing validation failures with no obvious cause. Add an advisory check at the start of the validate run: when the recipe, snapshot, and binary report two or more distinct release versions, emit a single slog.Warn naming all three. Dev and -next builds are ignored to avoid noise. The embedded versions are unsigned/advisory, so this does not fail the command. A stronger, schema-versioned compatibility gate is tracked as follow-up work.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Enterprise Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughA new Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Coverage Report ✅
Coverage BadgeMerging this branch will increase overall coverage
Coverage by fileChanged files (no unit tests)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. |
Summary
aicr validatenow emits a single advisory warning when the running binary, the recipe-producing binary, and the snapshot-producing binary report two or more distinct release versions.Motivation / Context
Snapshots and recipes already embed the
aicrversion that produced them (Metadata["version"]/Metadata.Version), butvalidatenever compared them against each other or the running binary. Mixing artifacts from different versions can surface as confusing validation failures with no obvious root cause. This adds a low-cost breadcrumb pointing at version skew.The embedded versions are unsigned, advisory metadata, so this deliberately does not fail the command and ignores
dev/-nextbuilds to avoid noise. A stronger, schema-versioned compatibility gate (consolidatingapiVersion, enforcing it on load) is tracked separately.Fixes: N/A
Related: #1385
Type of Change
Component(s) Affected
cmd/aicr,pkg/cli)docs/,examples/)Implementation Notes
pkg/cli/version_skew.go:isReleaseVersion(ignores empty/dev/-next),versionSkewDetected(≥2 distinct release versions), andwarnVersionSkew(singleslog.Warnnaming all three).validateaction after the snapshot loads (both the file and agent-capture paths populatesnap), before phase warnings.sloghandler.Testing
Risk Assessment
Rollout notes: N/A — no flags, no behavior change beyond an additional warning log.
Checklist
make testwith-race)make lint)git commit -S)