feat(project): add deploy command contract - #2056
Open
notgitika wants to merge 7 commits into
Open
Conversation
notgitika
had a problem deploying
to
e2e-testing
August 20, 2026 03:12 — with
GitHub Actions
Failure
This was referenced Aug 20, 2026
notgitika
marked this pull request as ready for review
August 20, 2026 04:10
notgitika
marked this pull request as draft
August 20, 2026 04:19
notgitika
had a problem deploying
to
e2e-testing
August 20, 2026 04:19 — with
GitHub Actions
Failure
notgitika
marked this pull request as ready for review
August 20, 2026 04:24
Hweinstock
reviewed
Aug 20, 2026
Hweinstock
left a comment
Contributor
There was a problem hiding this comment.
small questions, but approach lgtm. I can take another look once the dependent changes are merged.
notgitika
force-pushed
the
feat/project-deploy-contract
branch
from
August 20, 2026 17:06
81c98a5 to
e485e02
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## refactor #2056 +/- ##
============================================
+ Coverage 97.15% 97.16% +0.01%
============================================
Files 387 388 +1
Lines 23142 23248 +106
============================================
+ Hits 22483 22589 +106
Misses 659 659 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
notgitika
force-pushed
the
feat/project-deploy-contract
branch
from
August 21, 2026 16:16
53bd2b5 to
78a8644
Compare
nborges-aws
reviewed
Aug 21, 2026
Contributor
|
I think there are some merge conflicts: |
notgitika
force-pushed
the
feat/project-deploy-contract
branch
from
August 21, 2026 17:40
78a8644 to
f3c53bf
Compare
tejaskash
reviewed
Aug 21, 2026
notgitika
force-pushed
the
feat/project-deploy-contract
branch
from
August 21, 2026 18:21
b9422f7 to
e5af2c4
Compare
nborges-aws
previously approved these changes
Aug 21, 2026
nborges-aws
left a comment
Contributor
There was a problem hiding this comment.
LGTM thanks for fixes!
Hweinstock
reviewed
Aug 21, 2026
Hweinstock
left a comment
Contributor
There was a problem hiding this comment.
few comments on testing and some nits, but I like the direction!
| throw new DeserializationError(filePath, { cause: parseResult.error }); | ||
| throw new DeserializationError(filePath, { | ||
| cause: parseResult.error, | ||
| details: z.prettifyError(parseResult.error), |
Contributor
There was a problem hiding this comment.
haha I refreshed and you implemented exactly what I was thinking, crazy!
The test assembled its own ValueContext with ProjectKey, JsonKey and a stub JsonRenderer, which re-implemented what createRootHandler installs — so it could pass while the real wiring was wrong. It now goes through createRootHandler with the fake manager injected via TestCoreClient, the same pattern project.test.ts and add/harness/index.test.ts use, exercising the real --json group flag, the real JSON renderer and the real withProject wrap. Verified by unwrapping deploy from withProject: both tests now fail, where the hand-built context passed. No fixture setup needed since the fake's resolve() returns a project. Also drops the CloudFormation wording from DeployResult.outputs. The shape is already backend-neutral; only the doc comment implied CDK.
Resolve the named aws-targets.json entry in FsProjectManager and pass the resolved account and region to the backend, mirroring build(). deploy() previously threw NotImplementedError before dispatching, which left CdkBackend.deploy unreachable and duplicated the same message in two places; the backend is now the single place that reports deployment as unimplemented. Narrow the TestCoreClient seam from a whole-manager override to a single backend override. Handler tests keep the real FsProjectManager, so target resolution and withProject run for real and only the deploy boundary is faked.
Match the name pattern the schema on main already enforces. The CDK normalizes underscores to hyphens, so accepting them here would let a target be written one way and deployed under another.
The root handler prints only `error.message`, so the zod detail that `FsReadWriteJson.read` put in `cause` never reached the user: a typo'd region or a duplicated target name in a hand-edited file produced only `Failed to deserialize file at "<path>"`, naming the file but not the field. DeserializationError now requires a `details` string and appends it to the message, and json.ts passes the prettified zod error (or the parse error) through. Fixing it in the IO layer rather than catching in `ProjectManager.deploy` covers every hand-edited file at once. Making `details` required rather than optional keeps the opaque message from being reintroduced. Tested at the handler level, since the schema tests pass in isolation without proving the detail reaches stderr.
- Inline runDeploy and renderResult. Neither is reused; the manual .next() loop only exists because the outputs are the generator's return value, which `for await` discards, so that reason is now a comment where the loop lives. `build` already drains its generator inline. - Rename the test factory `harness` to `testDeployCommand`. "Harness" is a real AgentCore resource in this codebase, and the name matches the existing `testMemoryCommand` convention. - Collapse inProjectWithRawTargets/inProjectWithTargets into one helper that takes the file contents. Callers pass JSON.stringify(...), so the malformed-JSON case is just another call rather than a second function. - Drop the TestCoreClientOptions comment; the Partial already says it. - Drop the comment above the aws-targets.json tests describing the opaque message, which no longer exists now that DeserializationError requires `details`. The describe name carries the intent.
notgitika
force-pushed
the
feat/project-deploy-contract
branch
from
August 21, 2026 19:34
e5af2c4 to
e8aabe3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
project deployhandler and--targetcontractStack
This is PR 2 of 4 decomposing #2001. The command remains nonfunctional until the final PR. Review and merge bottom-up.
typecheck, lint, format, test all pass