feat: repo creation flags + AWS ECR asset provider#4
Open
fedemaleh wants to merge 8 commits into
Open
Conversation
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
Adds two capabilities to
application-lifecycle-manager:Also migrates asset persistence off the deprecated
np nrn patchmechanism.What changed
Toggle flags (env vars, default ON)
CREATE_CODE_REPOSITORYandCREATE_ASSET_REPOSITORY. Only the literal valuefalse(case-insensitive) disables; unset/empty/any-other value keeps the current behavior (backward compatible).return 0guards at the top of each dispatcher (scripts/code-repo/create_code_repository,scripts/asset-repo/create_asset_repository) — placed before anynpcall, so a disabled feature performs no platform reads/writes.return(notexit) because workflow steps are sourced into a shared shell;exitwould abort the whole workflow.AWS ECR asset provider (
scripts/asset-repo/ecr/)ASSET_REPOSITORY_PROVIDER=ecr. Config is env-var driven; onlyAWS_REGIONis required.ECR_REPOSITORY_PATHandECR_USE_NAMESPACEare optional (naming mirrors the docker-server provider).awsCLI and IAMecr:CreateRepository+ecr:DescribeRepositories.repositoryUri/repositoryArn), never hand-built — survives partition/DNS changes.RepositoryAlreadyExistsExceptionit falls back toaws ecr describe-repositories; other AWS failures and empty/nullURI/ARN abort withexit 1.Persistence migration (deprecated → current)
np application patch --id "$APPLICATION_ID"withsettings.asset.docker_server.uri/settings.asset.ecr.{uri,arn}respectively, replacing the deprecatednp nrn patch(docker.repository_uri).jq -n --arg(the repo's own pattern inentrypoint), not raw string interpolation.Docs
[Unreleased]entry.Test plan
ASSET_REPOSITORY_PROVIDER=ecrandAWS_REGIONon the agent (IRSA role withecr:CreateRepository/ecr:DescribeRepositories), create an application, confirm the ECR repo is created andsettings.asset.ecr.{uri,arn}is populated.describe-repositoriesand succeeds.CREATE_CODE_REPOSITORY=false→ code repo skipped, asset repo still created.CREATE_ASSET_REPOSITORY=false→ asset repo skipped, code repo still created.settings.asset.docker_server.uri.Notes
return 0(skip) vsexit 1(abort) throughout.