Repository navigation
feat(export): allow harness exports outside a project - #2542
Conversation
There was a problem hiding this comment.
AgentCore Harness Review
Verdict: Looks good
I did not find any blocking issues. A few observations worth noting (non-blocking):
-
Partial-state cleanup after project creation (edge case). In
src/core/project/manager.tsx(around L928–L1114), onceyield* this.create({ name: projectName })succeeds, a subsequent failure inside the export body only runscleanupAgentDir()+envFile.rollback(). The newly-created project directory itself is left on disk. In practice, the steps aftercreate()(template render → spec parse → write) are unlikely to fail — invalid inputs and service failures are all caught beforehand, and the tests cover those pre-creation paths well — so this is a rare case. If you want to tighten it, you could either (a) track whether the project was created in this call andrm -rfthe destination on failure, or (b) run project creation last after you have a validated plan in hand. Up to you. -
AgentCoreRegionSchemais a strict enum. If a future/unsupported region appears in the source ARN,AwsDeploymentTargetsSchema.parse(...)at L914 will throw after theGetHarnessfetch has already happened. That's beforethis.create(...), so there's no partial state, but the user sees a validation failure after a successful service call. Probably fine sinceGetHarnesswould also fail in a region AgentCore doesn't support, but worth noting.
The test suite looks solid — real temp dirs, mocking kept at the harness SDK boundary, and good coverage of the "did we create a project when we shouldn't have" cases.
|
Claude Security Review: no high-confidence findings. (run) |
|
Claude Security Review: no high-confidence findings. (run) |
e34157c to
31ecb98
Compare
|
Claude Security Review: no high-confidence findings. (run) |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## refactor #2542 +/- ##
=========================================
Coverage 97.44% 97.45%
=========================================
Files 645 645
Lines 47705 47779 +74
=========================================
+ Hits 46488 46563 +75
+ Misses 1217 1216 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Claude Security Review: no high-confidence findings. (run) |
|
Claude Security Review: no high-confidence findings. (run) |
760fee5 to
a97abc7
Compare
|
Claude Security Review: no high-confidence findings. (run) |
Description
Allow
agentcore export harness --arnoutside an AgentCore project by scaffolding a new project through the existing creation flow.Export, remove underscores from the Harness name and fit the existing 23-character limit.--project-nameuses the supplied name unchanged.Scope: seven files. No agent-template, IAM capture, Memory/Gateway preservation, backend or CDK capability changes. This PR continues using the public
@aws/agentcore-cdkdependency and does not require the unpublished preservation capability.Infrastructure-preservation work is separate: CLI #2532 and CDK #415.
Related Issue
N/A. No new issue was requested.
Documentation PR
Generated command reference updated here. Changes to
docs/harness-project-configuration.mdwere intentionally removed.Type of Change
Testing
Fresh scoped verification at
a97abc79340199d19007db1396a0a692bac8424c:The last full-suite attempt on an earlier head had 3,967 passes, 101 failures and 3 errors involving environment-limited port/subprocess behavior; selected failures also reproduced upstream. That result is not a full-suite pass or fresh validation of this head. No new AWS deployment/invocation validation was performed for this rebase. Resource-preservation validation belongs to the separate PR.
VHS Walkthrough
Real read-only ARN export using
AWS_PROFILE=deploy, recorded from a fresh directory with the sealed build of this head. Shows the shared progress display, generatedExportAgentCoreCliRefacproject, one Runtime entry, and the source account/region in the default deployment target. The 28-second MP4 and GIF were decoded and visually reviewed. This demonstrates export and local scaffolding, not deployment or agent invocation.Download the MP4.
Media is hosted on a separate demo branch; it does not add files to this PR's code diff.
bun test(focused checks above; full-suite limitation disclosed)bun run test:e2e, or explained why they are not applicable (live read-only ARN export walkthrough above; no deployment/invocation)bun run typecheckbun run lint:checkbun run format:checkbun run buildsrc/assets/, I updated affected snapshots withbun test <test-file> --update-snapshotsand committed them (assets unchanged)Checklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the
terms of your choice.