feat(project): scaffold add harness handler - #1998
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## refactor #1998 +/- ##
============================================
+ Coverage 96.91% 96.96% +0.04%
============================================
Files 356 357 +1
Lines 20136 20531 +395
============================================
+ Hits 19515 19908 +393
- Misses 621 623 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
2734b07 to
d9138cd
Compare
| } | ||
|
|
||
| // eslint-disable-next-line require-yield | ||
| public async *add<TResource extends ProjectResource>( |
There was a problem hiding this comment.
i'm imagining minimal special casing here. We'll want to scaffold files for runtime/harness, then the rest should be simple shared logic to write the schema changes. We will also need some special casing for harness since it links to the config in the scaffolded files.
| }); | ||
|
|
||
| /** Converts the SDK's tagged-union model config into the flat project-schema shape. */ | ||
| function toModelConfig(modelConfig: HarnessModelConfiguration): HarnessModel { |
There was a problem hiding this comment.
we handle all the api shape --> project schema conversion in the handler to keep the shared logic clean.
| ])("%s", async (_label, flags) => { | ||
| await inProject(); | ||
| // TODO: update to verify that the project updates. | ||
| await expect(run(["add", "harness", ...flags])).rejects.toThrow("not yet implemented"); |
There was a problem hiding this comment.
TODO: MAke sure you fix tests after implementation
| } | ||
|
|
||
| // eslint-disable-next-line require-yield | ||
| public async *addResource<TResource extends ProjectResource>( |
| if ("agentCoreGateway" in c && c.agentCoreGateway) { | ||
| return { | ||
| type: tool.type, | ||
| name: tool.name, | ||
| config: { | ||
| agentCoreGateway: { | ||
| gatewayArn: requireField(c.agentCoreGateway.gatewayArn, "agentCoreGateway.gatewayArn"), | ||
| }, | ||
| }, | ||
| }; |
There was a problem hiding this comment.
what about when users set outbound auth or JWT here? are these being dropped or are they somewhere where I'm missing them. I am looking at toAuthorizationConfig below and I see those fields.
There was a problem hiding this comment.
good catch, looks like we want to wire up the field here
agentcore-cli/src/projectSchemas/harness.ts
Line 195 in a9d34be
| async function inBuildableProject(): Promise<string> { | ||
| const projectRoot = await inProject("MyAgent"); |
Problem
We're missing functionality to add resources to a project. This PR sets up the handler for
agentcore project add harnessas an example, and scaffolds the remaining work for add.Solution
Testing / Verification
Next Steps