feat: add --resolve-image-repos support to sam package#8476
feat: add --resolve-image-repos support to sam package#8476seshubaws merged 14 commits intoaws:developfrom
Conversation
Implements issue aws#3888 to auto-create ECR repositories during packaging, matching sam deploy behavior. Enables package-once, deploy-many CI/CD workflows with managed ECR repos. - Add --resolve-image-repos CLI option to sam package - Call sync_ecr_stack() to auto-create managed ECR repositories - Add validation requiring --s3-bucket when flag is used - Add conflict detection with --image-repositories - Add unit tests for validation logic Closes aws#3888
vicheey
left a comment
There was a problem hiding this comment.
Thank you for your contribution. Since this is a remote operation, do you mind add integration test as well.
…add integration test
|
Hi @abhishektang thanks for all your work on this! There seems to be a small linting error making some tests fail, could you check this? |
|
Hey, @seshubaws I have fixed the linting error, please try to run the PR workflow now. |
|
Seems like the linting error was fixed but there are test failures as well. |
|
@abhishektang This test seems to be the only one failing |
- Add race condition tests for _create_layer_directory - Fix test_samconfig.py parameter count (16 params for resolve_image_repos) - Add resolve_image_repos verification tests in test_command.py - Add sync_ecr_stack execution test in test_package_context.py - Regenerate schema/samcli.json Fixes: Lines 288-308 (race condition handling) and lines 107-112 (resolve_image_repos path)
|
Hey @seshubaws @reedham-aws, I've fixed the unit test failures and added test coverage for the |
|
Hey @vicheey, kindly can you review my pr. Thankyou! |
vicheey
left a comment
There was a problem hiding this comment.
Thank you for your contribution.
Summary
Implements
--resolve-image-repossupport forsam packagecommand to automatically create ECR repositories, matching the behavior ofsam deploy.Resolves
Closes #3888
Changes
--resolve-image-reposCLI option tosam packagesync_ecr_stack()to auto-create managed ECR repositories--s3-bucketwhen flag is used--image-repositoriesTesting
Use Case
Enables CI/CD workflows to package once and deploy to multiple environments in parallel using AWS-managed ECR repositories, avoiding manual repo creation and permission complexity.