Repository navigation
feat(compat): fail when project version and CDK library disagree - #2578
Conversation
|
Claude Security Review: no high-confidence findings. (run) |
There was a problem hiding this comment.
AgentCore Harness Review
Verdict: Changes requested
Nice, focused change with thorough table-driven tests covering ranges, prereleases, invalid specs, missing/malformed manifests, and no-op side effects. One small issue:
Broken JSDoc comment above MODEL_PROVIDER_RUNTIMES_CN_MESSAGE
src/core/project/manager.tsx lines 155–162: inserting assertCdkLibraryMatches left a stray blank line inside the next JSDoc block:
}
/**
* Shown when a runtime template hardwired to an unreachable model provider
...
*/
export const MODEL_PROVIDER_RUNTIMES_CN_MESSAGE = ...The /** line is now followed by a blank line before the *-prefixed description. Compare the parent commit (e7162595) where it was a normal JSDoc block. Please remove the blank line so the comment reads as intended.
Non-blocking observations
declaredCdkDependencyis now called on everyresolve()call (previously only on the v0 fallback). The extrapackage.jsonread is cheap and swallowed via.catch(() => undefined), so this is fine — just flagging the behavior change.- No telemetry is emitted for the new mismatch error, but the existing adjacent
ProjectStateErrorpaths (v0 dependency warning, legacy write-gate) also don't emit, so this is consistent with surrounding code.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## refactor #2578 +/- ##
=========================================
Coverage 96.32% 96.32%
=========================================
Files 670 670
Lines 51173 51197 +24
=========================================
+ Hits 49290 49314 +24
Misses 1883 1883 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
594f0f9 to
9e5471f
Compare
|
Claude Security Review: no high-confidence findings. (run) |
Description
Fails loudly when a project's format and its vended CDK library disagree, for example when someone changes
"version"inagentcore.jsonby hand.agentcore.jsonversion(1 is v0, otherwise v1). Library comes from@aws/agentcore-cdkinagentcore/cdk/package.json: major 0 (0.1.0-alpha.*) is v0, major 1+ (including1.0.0-rc.*/-preview.*) is v1.ProjectStateError:agentcore migrateto upgrade it."package.json, no such dependency, or a spec that isn't plain semver (file:,workspace:, git URLs, ranges) never blocks.package.jsonread from fix(project): guide outdated v0 projects to update dependencies #2566. Outdated v0 projects still get its "older than v0.24.2" guidance first.One #2566 test (
version: 2with an0.1.0-alphalibrary loads fine) is replaced, since that combination is now the mismatch error.Builds on #2575, which is now merged.
Type of Change
Testing
bun testbun run typecheckbun run lint:checkbun run format:checkChecklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the
terms of your choice.