Repository navigation
Generalize the processing image buildspec by mission - #20
Merged
Merged
Conversation
Classify main, tag, and pull-request builds from CodeBuild metadata, publish an immutable image tag alongside latest, refuse to deploy from anything but main or a release tag, and hand off to the mission's architecture project with MISSION, CDK_ENVIRONMENT, LAMBDA_PIPELINE, and the exact tag just pushed. Buildspec only; the workflow and doc edits from #13 are left out. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Alrobbertz
approved these changes
Sep 9, 2026
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The downstream start-build variable name mismatch (MISSION_NAME vs MISSION) can break the deployment handoff contract described in the PR metadata.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR updates the CodeBuild buildspec.yml for the processing Lambda image to be mission-aware and safer to run across different triggers, while only publishing/deploying from the correct main commit or a release tag.
Changes:
- Adds a standardized build banner and stricter gating to skip PR/branch/stale-main builds before any ECR publishing.
- Derives mission from the CodeBuild project name, selects the correct base image + requirements file, and enforces Docker tag validity.
- Publishes
latestplus an immutable tag, then triggers the mission-specific architecture CodeBuild project with deployment parameters.
File summaries
| File | Description |
|---|---|
| buildspec.yml | Reworks CodeBuild logic to be mission-derived, guarded by trigger/source checks, and to publish + hand off deployments with an immutable tag. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+252
to
+256
| --environment-variables-override \ | ||
| name=CDK_ENVIRONMENT,value="${CDK_ENVIRONMENT}",type=PLAINTEXT \ | ||
| name=MISSION_NAME,value="${MISSION_NAME}",type=PLAINTEXT \ | ||
| name=LAMBDA_PIPELINE,value="${LAMBDA_PIPELINE}",type=PLAINTEXT \ | ||
| name=TAG,value="${VERSION}",type=PLAINTEXT |
| tag/*|refs/tags/*) BANNER_ENVIRONMENT=PRODUCTION ;; | ||
| branch/main|main|refs/heads/main) BANNER_ENVIRONMENT=DEVELOPMENT ;; | ||
| pr/*|refs/pull/*|branch/*|refs/heads/*) BANNER_ENVIRONMENT=VALIDATION ;; | ||
| *) BANNER_ENVIRONMENT=UNRESOLVED ;; |
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.
Buildspec only. This is the
buildspec.ymlfrom #13 on a clean branch offmain, without the workflow,AGENTS.md, and README edits that were bundled there.What the buildspec does now:
git describe/origin/mainfallback; PR and feature-branch builds announce they are validation-only and exit before touching ECRmainbuilds (HEAD no longer equalsorigin/main) skip publishing instead of racing a newer buildlatestplus an immutable tag (YYYYmmddHHMMSSon main, the git tag on releases), validated against Docker's tag rulesbuild_<mission>_sdc_aws_pipeline_architectureproject withMISSION,CDK_ENVIRONMENT,LAMBDA_PIPELINE=PROCESSING, andTAG=<immutable tag>, so Terraform deploys exactly that imageOrdering: the architecture project has to be running its
buildspec.ymlfrom swxsoc/sdc_aws_architecture#38 for the handoff to do a targeted deploy. Until then this buildspec still builds and pushes correctly; only the finalstart-buildlands on a project that ignores the extra variables.Checks: YAML parses and every embedded shell block passes
bash -n;git diff --checkclean.🤖 Generated with Claude Code