Repository navigation
fix(cli-integ): pin the AgentCore hotswap test runtime to platformVersion:V1 - #2198
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
|
Automated review A maintainer will still review this — treat the notes below as a starting point. 📌 Commit This PR tries to fix the intermittent first-deploy failure of the Open findings: 🔴 0 blocking · 🟡 1 recommended · ⚪ 0 optional. Files with findings (1)
Generated automatically. React 👍 or 👎 to tell us whether this review helped, so we can improve these reviews. |
There was a problem hiding this comment.
See the review summary comment for the overview; the notes below are inline.
|
|
||
| const runtime = new bedrockagentcore.CfnRuntime(this, 'Runtime', { | ||
| agentRuntimeName: 'test_runtime', | ||
| platformVersion: 'V1', |
There was a problem hiding this comment.
🟡 Recommended — This fix assumes a CfnRuntime created without platformVersion can come up as V2. Per the PR, V2 starts the single-line Alpine container during CREATING, the container exits, and the health check fails. The AgentCore developer guide says the opposite: "If you omit platformVersion when you create a runtime, the runtime uses V1" (runtime-how-it-works). The PR cites no source for a V2 default, and it is unclear whether the docs or the service behavior it describes is current. If the docs are right, this line changes nothing and the NotStabilized failure in #2185 has another cause. The issue lists several: a slow first pull from public ECR, AgentCore-side stabilization, IAM propagation, and the AccessDenied on logs:CreateLogGroup. This PR rules out none of them.
Suggested change: Bring the PR's premise and the documented behavior into line. If the service really defaults to V2 in some regions or accounts, cite a source in the PR so reviewers can see the pin targets the real cause (the developer guide would then need correcting). If the docs are current, treat the root cause of #2185 as still open and don't present the pin as the fix. Either way, a fixture image that serves the AgentCore HTTP contract (GET /ping, POST /invocations on :8080), like the aws-cdk V2 integ fixtures, would make the test pass on both platform versions.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2198 +/- ##
=======================================
Coverage 92.55% 92.55%
=======================================
Files 81 81
Lines 13224 13224
Branches 1917 1917
=======================================
Hits 12240 12240
Misses 946 946
Partials 38 38
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Addresses #2185
The integ test
hotswap deployment supports Bedrock AgentCore Runtimefails on its first deploy with this error:The test's Dockerfile is a single line,
FROM public.ecr.aws/docker/library/alpine:latest. Alpine's default command is/bin/sh, so the container starts a shell and exits with code 0.InvokeAgentRuntimecall. The test never invokes the runtime, so the container never runs and the create succeeds.CREATINGand setsCREATE_FAILEDif the health check doesn't pass (docs). With this image, the container exits, the health check fails, and CloudFormation reportsNotStabilized.The test doesn't set
platformVersion. The docs say V1 is the default, but deploying this stack withoutplatformVersionreturnedplatformVersion: V2fromGetAgentRuntimein eu-west-1 and `platformVersion: V2' in us-east-1. The test runs in one of nine regions, so the failure looks intermittent.This PR sets
platformVersion: 'V1'on the test'sCfnRuntime. The test checks that the CLI hotswaps a runtime's description and environment variables. The CLI hotswapsAWS::BedrockAgentCore::Runtimewith Cloud ControlUpdateResource(hotswap-deployments.ts), and toolkit-lib has no code that readsplatformVersion. So the pin doesn't change what the test covers.Testing
Deployed the test's stack in eu-west-1 manually.
platformVersion:GetAgentRuntimereturnedplatformVersion: V2, and the create failed with theNotStabilizederror above.platformVersion: 'V1':GetAgentRuntimereturnedplatformVersion: V1, and the create completed in 8 seconds.cdk deploy --hotswapwith a new description and environment variable printedhotswapped!. The stack status stayedCREATE_COMPLETE, andGetAgentRuntimereturned the new description and environment variable.Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license