Migrate AWS emulator to localstack/localstack image#163
Migrate AWS emulator to localstack/localstack image#163carole-lavillonniere wants to merge 1 commit intomainfrom
Conversation
📝 WalkthroughWalkthroughChanges update the AWS emulator container image reference from Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
67d8336 to
5979bb6
Compare
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
internal/container/start.go (1)
359-359:⚠️ Potential issue | 🟡 MinorError message will have empty product name.
containerConfig.ProductNameis never populated in theStartfunction (see lines 141-152 where theruntime.ContainerConfigis built without settingProductName). This will produce error messages like"license validation failed for :1.2.3: ..."with an empty product name.🐛 Proposed fix
Either populate
ProductNamein the container config, or use a different identifier here:- return fmt.Errorf("license validation failed for %s:%s: %w", containerConfig.ProductName, version, err) + return fmt.Errorf("license validation failed for %s:%s: %w", containerConfig.Image, version, err)Using
containerConfig.Imagewould produce a more informative error message like"license validation failed for localstack/localstack:latest:1.2.3: ...".🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@internal/container/start.go` at line 359, The error message in Start uses containerConfig.ProductName which is never set, causing empty product names; fix by either populating ProductName when building the runtime.ContainerConfig (the code that assembles containerConfig in Start) or change the fmt.Errorf call that returns "license validation failed for %s:%s: %w" to use a reliable identifier such as containerConfig.Image (or fall back to containerConfig.Image when ProductName is empty) so the error shows a meaningful image/product name; update the code around the license validation return to reference the chosen field.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@internal/container/start.go`:
- Line 359: The error message in Start uses containerConfig.ProductName which is
never set, causing empty product names; fix by either populating ProductName
when building the runtime.ContainerConfig (the code that assembles
containerConfig in Start) or change the fmt.Errorf call that returns "license
validation failed for %s:%s: %w" to use a reliable identifier such as
containerConfig.Image (or fall back to containerConfig.Image when ProductName is
empty) so the error shows a meaningful image/product name; update the code
around the license validation return to reference the chosen field.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: eb37d7d3-ad52-4d25-95a7-9256dcb6b0fb
📒 Files selected for processing (8)
CLAUDE.mdinternal/config/containers.gointernal/container/start.gointernal/container/telemetry_test.gointernal/ui/app_test.gointernal/ui/components/error_display_test.gointernal/ui/components/pull_progress_test.gotest/integration/start_test.go
✅ Files skipped from review due to trivial changes (5)
- internal/ui/components/pull_progress_test.go
- internal/ui/components/error_display_test.go
- CLAUDE.md
- internal/container/telemetry_test.go
- internal/ui/app_test.go
🚧 Files skipped from review as they are similar to previous changes (2)
- test/integration/start_test.go
- internal/config/containers.go
| opts.Logger.Error("license server response (HTTP %d): %s", licErr.Status, licErr.Detail) | ||
| } | ||
| emitEmulatorStartError(ctx, tel, containerConfig, telemetry.ErrCodeLicenseInvalid, err.Error()) | ||
| return fmt.Errorf("license validation failed for %s:%s: %w", containerConfig.ProductName, version, err) |
There was a problem hiding this comment.
Will containerConfig.ProductName be empty here? Can we hard-code as well?
|
I'm wondering, this change should then also block users from using versions lower than 2026.3, because that won't be the pro image anymore, no? |
|
Closing for now because of the concern mentioned by @silv-io #163 (comment) |
Motivation
LocalStack consolidated
localstack/localstack-prointolocalstack/localstack. The CLI needs to pull from the new image name.Changes
emulatorImagesmap to uselocalstackinstead oflocalstack-profor the AWS emulator — affects both the Docker image pulled and the product name sent to the license APIlocalstack/localstack:latesttest-image:latest,test-product:1.2.3) since those tests don't assert on the actual nameTests
test-image:latestplaceholdersimagesub-test inTestStartCommandSetsUpContainerCorrectlyverifies the container is started fromlocalstack/localstack:latestTestLicenseValidationSuccessupdated to expectlocalstackas the product name in the license requestCloses DRG-591