fix(project): point the no-targets error at project deploy - #2196
Conversation
resolveExistingTarget told the user to hand-write aws-targets.json with an example account id when a project declared no targets. A freshly created project hits this on its first `agentcore project status`, since create writes an empty targets file and only deploy fills it. Point them at 'agentcore project deploy' instead, and merge the missing-file and empty-array branches, which now report the same thing.
|
Claude Security Review: no high-confidence findings. (run) |
There was a problem hiding this comment.
AgentCore Harness Review
Verdict: Looks good
Small, well-scoped change. Replacing the "hand-edit aws-targets.json" instruction with a pointer to agentcore project deploy matches the current UX where the deploy path auto-provisions the default target (see provisionDefaultTarget around line 1033), so the old guidance was stale.
A few things I verified:
TARGETS_EXAMPLEis still referenced by the deploy path (manager.tsxlines 926/932), so it isn't dead code.- Collapsing the "file missing" and "empty targets" branches into a single
targets.length === 0check is fine here —resolveExistingTargetis a read path and doesn't need to distinguish the two cases (the deploy path still handles them separately). - Other tests that match on the substring
"No deployment targets are configured"(manager.test.ts:742,project.test.ts:1366,deploy/index.test.ts:380,invoke.screen.test.tsx:111) still pass with the new message since that substring is preserved.
No telemetry concerns (no new feature surface) and no test-mocking concerns. Nothing blocking from me.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## refactor #2196 +/- ##
============================================
- Coverage 97.15% 97.15% -0.01%
============================================
Files 542 542
Lines 37728 37723 -5
============================================
- Hits 36653 36648 -5
Misses 1075 1075 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
resolveExistingTargettold the user to hand-writeaws-targets.jsonwith an example account id when a project declared no deployment targets:A freshly created project hits this on its first
agentcore project status, becausecreatewrites an emptyaws-targets.jsonand onlydeployfills it. Deploying is what the user should do, so the message now says so:The missing-file and empty-array branches reported the same thing once the path/example was dropped, so they merge into one
targets.length === 0check. The unknown---targetbranch is unchanged — it still lists the declared target names, which is the useful fix for a typo.This is a shared helper, so
deploy,remove, andinvokeget the same clearer message when a project has no targets.