DEVEX-1087: sync CDN assets during release candidate promotion#116
DEVEX-1087: sync CDN assets during release candidate promotion#116pdodgen-revparts merged 1 commit intomainfrom
Conversation
Some repos (webstore, checkout, manage) build tag-versioned JS/CSS assets and upload them to s3://<bucket>/<repo>/<TAG>/ during Build. After promotion, the docker image is retagged v1.5.0-main.3 -> v1.5.0, but the helm chart passes image.tag through to the app as a 'package_version' env var, which the app uses to build CDN URLs like <cdn>/<repo>/<package_version>/*. Those URLs 404 because the assets were only uploaded under the -main.N path. Add an optional sync_cdn_assets input plus cdn_bucket / cdn_aws_access_id / cdn_aws_access_secret secrets. When enabled, the reusable does a server-side aws s3 sync from the source tag path to the pretty tag path, preserving all object metadata (Content-Encoding, Cache-Control) set at Build time. Callers that need it: webstore, checkout, manage. Wrapper updates to follow.
PR SummaryMedium Risk Overview Introduces three new optional secrets ( Reviewed by Cursor Bugbot for commit a413eb5. Bugbot is set up for automated code reviews on this repo. Configure here. |
Problem
Services that ship tag-versioned JS/CSS assets (webstore, checkout, manage) upload them during
Buildtos3://<cdn-bucket>/<repo>/<TAG>/whereTAGis the-main.Ntag. After promotion, the docker image is retaggedv1.5.0-main.3 → v1.5.0(no rebuild), but the helm chart passesimage.taginto the running app aspackage_version. The app builds CDN URLs like<cdn>/<repo>/<package_version>/*— pointing at a pretty-tag path that does not exist in S3.Observed on webstore QA today: promoted
v0.405.0, app tried to load.../webstore/v0.405.0/*.css→ 404.Fix
Add an optional
sync_cdn_assetsboolean input plus three optional secrets (cdn_bucket,cdn_aws_access_id,cdn_aws_access_secret). When enabled, the reusable runs:Server-side copy, preserves Content-Encoding and Cache-Control metadata set at Build time. Takes seconds.
Callers
Wrapper PRs will follow in each of those repos.
Trade-off considered
Retag-without-rebuild (our current design) sacrifices automatic re-upload of tag-pathed side artifacts. Alternatives were discussed:
The S3 sync keeps the complexity contained to the reusable and 3 thin wrappers, with no app/helm edits.
Part of DEVEX-1087.