Section 5
DevOps and development lifecycle
How a change gets from a developer's laptop into the running AWS environment: how the repository and its artifacts are organised, every check a change passes on the way, how a release is promoted and how a bad one is undone, and what the pipeline taught the team when it failed.
- 5a Source and artifacts
- 5b Pipeline and procedures
- Laptop to production
- CI
- CD
- Rollback
- Scanning
- 5c Findings and issues
- Questions
5aSource code and artifact strategy
One repository holds both services, both clients, the infrastructure and the pipeline. Independence between Media and Processing is enforced inside it: separate test lanes, separate images that refuse to contain the other service's code, and separate releases identified by image digest.
One repository, several release units
Everything lives in the public GitHub repository Collaboration95/dc2, default branch Main. A change to the message contract and both of its consumers fits in one pull request, which the contract policy requires; with separate repositories the same change would need coordinated pull requests and pinned versions across them.
| Path | Contents | Ships as |
|---|---|---|
media/ | Media service and its migrations | Media image (4 Lambda functions) |
processing/, media_engine/ | Processing service, the finite worker, FFmpeg command builders | Processing image (6 functions) and worker image (Fargate task and short-lane Lambda) |
contracts/, delivery/, runtime_support/ | Shared kernel: message contract, outbox/inbox and SQS adapters, Lambda runtime glue | Copied into both images, so a change here releases both services |
frontend/, publisher/ | Browser app; Publisher CLI | Files in the frontend S3 bucket; an installable Python package |
deploy/, scripts/aws/ | Image recipes, the CloudFormation generator and checked-in template, deploy and release tools | The stack and the operator tooling |
.github/workflows/, scripts/ci/ | CI, CD, DAST and Pages workflows; lane selection and CD scripts | The pipeline |
tests/, docs/ | About 4,000 Python tests and 177 frontend tests; architecture, runbooks, sanitized receipts | Not deployed |
app/, legacy/ | The inherited Project 1 application and retired code paths, still tested | Not deployed; excluded from images |
How the boundary is enforced inside one repository.
- Lanes. CI maps changed paths to per-service lanes, so a Processing-only change runs Processing's tests and builds Processing's images (CI).
- Image checks. Every image build runs a runtime check inside the image, as the image user and as a Lambda user: the build fails if the other service's package or any legacy module can be imported, or if a handler does not start.
- Release detection. CD releases an owner only if that owner's image build inputs changed since the commit currently running.
- Ownership.
CODEOWNERSmaps each directory to its service, mirroring the lanes.
One lockfile and one CloudFormation stack serve both services, so a dependency bump or an infrastructure change touches both. The shared kernel is copied, not versioned as a package.
Branches and pull requests
fix/*, v2/*, docs/*, ci/*Main through one release-style pull request that runs everything.Main is the trunk. Short-lived branches merge by pull request into an integration branch (dev/v1 for the V1 build on 16–17 October, dev/closeout from 17 October), which merges into Main through one release-style pull request. Merge commits are used throughout, so each pull request stays visible in Main's history; since 15 October every first-parent commit on Main is a pull-request merge. Each pull-request description records its technical decisions. The only tag is project2-v1 (the V1 release, 18 October); later releases are identified by source commit and image digest.
The repository belongs to one personal GitHub account, which is its only collaborator; the team and its AI coding agents all worked through it. Branch protection and rulesets are not configured: "Dev gate" and "Full verification" are stable check names that a ruleset could require, but nothing in the repository settings requires them, and no review approval is required. Pull-request discipline was team practice. Up to PR #284, 26 of the 27 pull requests into Main merged with every check green; the exception merged with the third-party GitGuardian check failing.
Artifacts and how a release is identified
A release is not identified by a version number but by a chain of immutable identities, each checked against the previous one.
| Identity | Created by | What is checked |
|---|---|---|
| Source commit (40-character SHA) | The merge into Main | CD deploys only the exact commit that a green full CI run tested |
| Local image config ID | The image build on the CD runner | Trivy scans this exact image before anything is pushed |
ECR tag g<run>x<attempt>-<image> | The push to an ECR repository with immutable tags | A tag can never be repointed to different bytes |
Registry manifest digest (sha256:…) | ECR | The release plan verifies the manifest points at the scanned config, and waits until ECR's own scan is complete |
| Lambda version per function | The release publishing a version | The version's description names the image digest; configuration must match the previous version except for code |
live alias, worker task definition revision | The release moving the alias | This is what serves traffic; the previous version is kept as the rollback target |
After a successful release the stack itself is updated to name the new image digests, so the template keeps describing what runs. There are three image repositories (media, processing, worker); the short-lane Lambda runs the worker image, so it has no repository of its own. The frontend ships as content-hashed files to a private S3 bucket, followed by a CloudFront invalidation. CI and CD artifacts (scan reports, coverage, selection records, sanitized delivery results) are kept 7 to 60 days; sanitized delivery receipts are also committed to the repository.
5bPipeline and procedures
No person deploys. A change reaches production only if a full CI run passed on the exact merged commit; continuous delivery then updates the infrastructure, releases each changed service separately behind its own smoke test with automatic restore, and finishes with an upload-to-playback test through the public API.
From laptop to production, every check in order
- Laptop. Before committing Python changes a developer runs
make lint(Ruff lint, including itsSsecurity rules over the deployed code),make format-checkandmake test(the offline fast suite: no network, no services). Frontend changes run the Vitest suite with coverage andnpm audit --audit-level=high. Workflow edits runactionlint, because an invalid workflow fails before CI can create any job. For wider changes the whole V1 system runs locally on PostgreSQL, Moto (an AWS emulator) and FFmpeg with the same images (make v1-up,make verify-v1), andmake lint-cfnlints the template. Nothing enforces these locally; CI repeats them. - Pull request into
dev/closeout. CI runs in dev mode: a policy script compares the pull request against its base and selects only the lanes whose inputs changed. The secret scan and the policy tests always run. The aggregate check Dev gate passes only if every selected job succeeded and every unselected job was skipped for a recorded reason. - Release pull request from
dev/closeoutintoMain. CI runs every lane on the pull request's merge commit, including image scans, DAST and combined coverage. The aggregate check is Full verification. Merging this pull request is the human approval. - Merge into
Main. The push runs full CI again, on the exact merged commit. This is the run CD trusts: a green pull-request run tested a merge preview, not necessarily the commit that landed. - CD admission. When that CI run completes, CD starts automatically. Its first job refuses the commit unless it is the same SHA, the run was a push to
Mainin this repository, the run selected the full tier, and Full verification succeeded. Only then does the second job, bound to theawsenvironment, get AWS credentials through OIDC. - Infrastructure update. A CloudFormation change set from the checked-in template, refused if it would replace a stateful resource; frontend files; then a smoke test of the public API.
- Per-owner release. For each service whose image inputs changed: scan, push, verify, publish, move aliases, smoke test, restore on failure, then adopt the new digests into the stack.
- Upload-to-playback test, through the public API, as a user would. When it passes, the release is serving.
Main: 13 of the last 15 push runs (one took 11.8 min, one included a re-run)Durations are read from the GitHub Actions run history pipeline-timings. The longest CD run, 34.5 min, delivered the short lane and the database split together 39644028238.
Continuous integration: what each job proves
CI is one workflow (ci.yml) triggered by every pull request, every push to Main, a manual dispatch for an exact candidate commit, and a weekly Sunday run that catches new advisories and tool drift. Its first job classifies the event:
- a pull request into
dev/closeoutgets dev mode, with lanes selected from the changed paths; - a pull request into
Main, a push toMain, a dispatch or the weekly run get full mode, every lane; - anything the classifier cannot interpret (a workflow, dependency or policy change, an unknown file type, an unreadable diff) also gets full mode. An error is never read as an empty diff.
The selection is saved as an artifact, because CD later checks it.
| Job | What a pass proves | Required by | Time |
|---|---|---|---|
| Select verification policy | The mode and lanes for this exact commit; recorded as an artifact | Both gates (a classification error fails them) | 6 s |
| CI policy tests, planning validation | The selection logic itself behaves as specified | Both | 5 s each |
| Lint and Python unit tests | Ruff lint and security rules, formatting, the fast test suite with coverage (180 s budget) | Both, when selected | 135 s |
| Frontend tests | npm audit finds no high or critical issue; Vitest passes with ≥ 90 % coverage | Both, when selected | 29 s |
| Media owned persistence | Media's migrations and repository code work on real PostgreSQL; its roles cannot reach the other database | Both, when selected | 64 s |
| Processing worker, recovery, database ownership | Leases, retries, worker-kill recovery and cleanup on real PostgreSQL, storage and FFmpeg | Both, when selected | 155 s |
| Media service / Processing service | The service's own tests pass, its image builds, and the runtime check inside the image finds no foreign or legacy code | Both, when selected | 84 s / 159 s |
| Publisher HTTPS | The Publisher keeps a Secure cookie across runs and rejects an untrusted certificate | Both, when selected | 29 s |
| Local HTTPS and browser trust | Full acceptance in a real Firefox: register, upload, play decoded MP4 and HLS frames, owner isolation, retry, Publisher batch | Both, when selected | 382 s (longest) |
V1 local verification (v1.yml) | Offline control-plane tests and cfn-lint on the template; every V1 flow on PostgreSQL, Moto and FFmpeg with a Chromium leg; the three exact images built and scanned by Trivy, failing on any fixable HIGH or CRITICAL finding | Both, when selected | 378 s / 239 s / 220 s |
| Legacy real integration | The inherited Project 1 app still works on PostgreSQL, MinIO and FFmpeg | Both, when selected | 78 s |
| Secret scan (gitleaks) | No credential anywhere in the history, not just in the diff | Both, always run | 20 s |
| Combined backend coverage | Five coverage fragments from the same commit merge to ≥ 80 % per package | Full verification | 25 s |
| Scan container image (app, media, processing) | Trivy finds no fixable HIGH or CRITICAL in the inherited-topology images | Full verification; advisory in dev | 44–98 s |
| Exact-candidate DAST | Authenticated OWASP ZAP ran against the local Media and Processing APIs and produced a report; findings are report-only | Full verification (execution); advisory in dev | 188 s |
| SonarCloud SAST | Nothing yet: it is skipped because no token is configured | Neither (advisory) | — |
| Dev gate / Full verification | Every selected job succeeded and every skip was intended | — | 7–8 s |
Times are from the full run on Main at f07b5e6 on 22 October: 25 jobs passed and 3 were skipped by design (Sonar twice, and the image-path check that full mode overrides) pipeline-timings. Jobs run in parallel, so the wall-clock time (about 7 min) is set by the browser and V1 jobs, not by the sum. CodeQL is not in this workflow: GitHub runs it as its own check on pull requests and pushes (scanning).
Why the gates check skips, not just failures. A GitHub job that is skipped counts as neither failed nor passed. If a lane silently disappeared (a typo in a condition, a renamed output), a naive gate would still go green. The gate jobs compare the actual result of every job with the recorded selection: a selected job must have succeeded, an unselected one must have been skipped, and anything else (cancelled, missing, an unexpected skip) fails.
"Required" here means required by the gate jobs and by CD's admission check. No repository rule stops someone merging a pull request whose gate failed; only CD's refusal to deploy an unverified commit is enforced by the pipeline itself. The local V1 stack and CI use Moto, not AWS, so CI does not prove anything about IAM, networking or AWS quotas; the CD smoke tests are the first checks that run on AWS.
Continuous delivery: from a green commit to a running release
CD is a second workflow (cd.yml, steps in scripts/ci/cd.sh) that starts when CI completes on Main. A concurrency group allows only one delivery at a time; later merges queue behind it.
| Step | What it does | Stops the delivery when | Time |
|---|---|---|---|
| Gate: refuse a commit without green CI | Reads the triggering CI run and its selection artifact through the GitHub API; records an admission receipt | Different SHA; not a push to Main; not this repository; not full tier; Full verification not successful; the CI run was re-run while being checked | 7–9 s |
| Assume the AWS role | GitHub issues an OIDC token; AWS trusts it only for this repository's aws environment, which only Main and dev/closeout may use. The session lands in a named profile, for one account and one region. | The token's subject or account does not match | ≈ 40 s with setup |
| Restore run state | Downloads the environment's journal, stack outputs and smoke-account credentials from a private, versioned S3 bucket (the repository is public, so this cannot be an artifact) | No journal for the environment | |
| Deploy: preflight | Read-only: account and region, stack status, the release journal, cost report | The stack is in a failed or in-progress state | ≈ 4 min with no release |
| Deploy: infrastructure | Creates a CloudFormation change set from the checked-out template and lists every change before executing it. Uploads the frontend and invalidates CloudFront. | The change set would replace Aurora, a bucket, a queue, an ECR repository, the VPC, a subnet, the ECS cluster or the CloudFront distribution | |
| Deploy: stack smoke | Through the public API: both health routes, an anonymous request denied, login with the smoke account (cookie must be HttpOnly, Secure, SameSite=Strict), Media job list, Processing job batch, an upload reservation | Any check fails. Only the first call to each database (login; Processing batch) is retried, only on 502/503/504 or a connection failure, after 5, 10 and 15 s, within 180 s | |
| Release each changed owner | Detailed below; Media and Processing are released one after the other, each on its own | A scan, the release plan, the migration or the owner smoke fails (then restore) | ≈ 9 min per owner |
| Upload-to-playback smoke | Generates a 3 s clip with FFmpeg and runs the full user flow through the public URLs: reserve, upload to S3, finalize, wait for done, then fetch the MP4, the HLS playlist and a segment | The job does not reach done or anything fails to play | 1.7–3.4 min |
| Save state, upload results | Pushes the journal back to S3 (also after a failure, so a re-run resumes); uploads redacted results as an artifact kept 60 days | — | seconds |
Inside one owner's release. This is how Processing can be released without touching Media.
- Build and scan the candidate. Build the owner's images on the runner. Trivy must find zero fixable HIGH or CRITICAL findings in each before anything is pushed.
- Rescan what runs now. An image the release keeps unchanged is rescanned strictly. An image the release replaces is rescanned in "retained" mode: a newly published fixable finding there is recorded loudly but does not block the release that removes it (5c).
- Push and plan. Push the exact scanned config under a fresh immutable tag. The release plan checks that the registry manifest points at the scanned config, that ECR's own scan is complete with no finding outside the accepted list, and that the schema is unchanged or attested additive.
- Write intent first. The release tool takes the journal lock and records a pending release before changing anything, so a crash at any later point can be resumed or restored.
- Migrate and promote. Run the owner's migration task if there is one. Publish a new Lambda version for each of the owner's functions, check that only the code changed, and move each
livealias. - Owner smoke. Run the public smoke test against the new versions, and check that the other service's functions did not change meanwhile.
- Restore or adopt. On any failure, restore (below). On success, write the new digests back into the stack, which also moves the worker task definition and the short-lane Lambda to the new worker image.
An owner whose migrations changed is not released automatically: CD stops and asks for a manual release with an explicit attestation that both the old and the new image work with the new schema.
done, both services releasedThe release-time target (Processing alone, smoke-tested, in at most 10 minutes) was missed by 0.1–0.3 min in the first CD rounds and met by the release step alone later; with the separate upload smoke counted it is not met dp1–dp4. Media was unchanged at every snapshot. The 101.2 s is from the redelivery on 21 October 39545554380.
There is no staging environment. The local V1 stack and CI's exact-image checks exercise the same images before promotion, and every release is smoke-tested in production with automatic restore; that is the substitute. The deploy role has AdministratorAccess limited to one region, protected only by the aws environment's branch policy, with no required reviewer. Alarms exist (one per function, one per dead-letter queue) but notify nobody, and logs are kept 7 days.
Releases are online: the old and new code run side by side for a moment while aliases move. That is safe only because automatic releases never change the schema and manual ones are attested additive. Quiescing the owner first would avoid the overlap, but the platform would then refuse uploads during every release.
How a bad change is stopped or undone
What happens depends on where the change fails.
| Fails at | What happens automatically | State afterwards |
|---|---|---|
Any CI job on Main | CD's gate refuses the commit | Production unchanged |
| Change set review | Deploy refuses to execute a change set that would replace a stateful resource | Production unchanged |
| CloudFormation update | CloudFormation rolls the stack back to its previous state; the next deploy starts from there | Previous infrastructure |
| Stack smoke | The run fails before any release | Infrastructure change applied, code unchanged; fix forward |
| Candidate scan or release plan | Nothing is promoted | Previous images keep serving |
| Migration, version publish, alias move or owner smoke | Restore: move each live alias back to its previous version and the worker back to its previous task definition, re-run the smoke on the restored versions, check the other service is unchanged, record restored | Previous code serving; the new schema (additive) stays |
| Restore itself | The pending intent stays in the journal; if nothing had moved it is abandoned, otherwise an operator resumes it | Needs a person |
| Upload-to-playback smoke, after promotion | The run fails; the release is not undone automatically | New code serving; revert the merge on Main, which goes through the whole pipeline again |
The automatic restore was tested on dc2-live with a deliberately broken Processing candidate: the runner built it with a database certificate bundle that is not Amazon RDS's, so it migrated cleanly but failed the smoke test with a 503 on the Processing call, and the previous aliases were restored 39271754470. In the earlier operator runs a failing Processing candidate was stopped at its smoke after 205.7 s and restored in 54.8 s; Media's in 189.5 s and 47.0 s.
The schema is never rolled back. A restore puts back old code against the new schema, so every migration must be additive: new tables and nullable columns, never a rename or drop in the same release. That is why a release with changed migrations needs a human's attestation. The kill switch (session close) is the emergency stop: it closes the API gate, disables the queue consumers, schedules, launcher and short-lane mapping, and deployments respect it by deferring releases.
Rollback restores images and aliases only. Old-image-on-new-schema compatibility is an operator attestation backed by contract tests, not an automated test in CI. The retained rollback image of 21 October carried a known fixable advisory; restoring it was not exercised.
Security scanning
Each scanner looks at a different thing, and each has its own pass/fail rule. All of them publish their findings in SARIF format to GitHub code scanning, so the repository's Security tab is the one place to triage them; publishing never fails a job.
| Tool | Looks at | Runs | Blocks? |
|---|---|---|---|
| CodeQL | Data-flow analysis of Python, JavaScript/TypeScript and the workflow files | GitHub-managed default setup, on pull requests, pushes and weekly | No; findings are triaged |
Ruff S rules (Bandit's checks) | Known insecure patterns in the deployed Python code, the Publisher and the bootstrap script | Laptop (make lint) and the lint job | Yes |
| gitleaks | Credentials anywhere in the git history (output redacted) | Every CI run, never deselected | Yes |
npm audit | Known vulnerabilities in the frontend's locked test dependencies | Frontend job | Yes, on high or critical |
| Trivy | OS and Python packages in the container images | CI: the three exact V1 images and the inherited images. CD: every candidate before push, and the images running in production before they are replaced | Yes, on any HIGH or CRITICAL finding that has a fix |
| ECR scan on push | The image as stored in the registry | Every push; the release plan waits for it | Yes, on findings not in the accepted list |
| OWASP ZAP (DAST) | The running Media and Processing APIs, logged in as two owners | Full CI against a disposable local stack; weekly | Must run and report; findings do not block |
| SonarCloud | Code quality and SAST | Configured but skipped: no token | No (advisory) |
| Dependabot alerts, secret-scanning push protection | Advisories on dependencies; secrets in a push | GitHub, continuously | Push protection blocks the push; alerts do not |
Triage on 21–22 October. Twelve High CodeQL alerts were reviewed. All twelve were in tests, the offline proof harness or developer scripts, none in deployed code; each was dismissed with a recorded reason. The remaining open alerts are ZAP low and informational findings (8 low, 8 informational), mostly missing hardening headers on the local gateway's documentation pages. One CVE is accepted unfixed: CVE-2025-52290 in ffmpeg, which has no fix in Debian 13; the worker is a finite task with no inbound network, and the acceptance is recorded with its reasoning.
"Zero fixable HIGH/CRITICAL" does not mean zero vulnerabilities: the images still carry unfixed findings (44, 44 and 208 rows at the last scan). ZAP scans seven selected routes on a local stack, not the AWS edge. Dependabot raises alerts but does not open update pull requests.
5cTechnical findings and issues
Most of what the team learned came from the pipeline refusing a change. Each finding below was a real failed run, traced to a cause, fixed without weakening the gate, and pinned by a test.
A security gate that blocked its own fix (21 October)
CD refused to release a Media change with "Trivy has 1 fixable HIGH/CRITICAL" 39532075705. The live environment kept running the previous release, untouched.
- Cause. The candidate was clean. The failing scan was the rescan of the image running in production, which carried
certifi2026.7.22. An advisory against that version (GHSA-6q48-6c7w-9gw2) had been published the evening before, after the image shipped, and the candidate's newercertififixed it. The gate refused to replace a vulnerable image because it was vulnerable, so the fix could never ship. - Fix. The candidate must still scan clean, and images the release keeps are still scanned strictly. Only images the release replaces are rescanned in a retained mode, where a fixable finding is recorded in the release receipt, the run summary and a warning annotation instead of blocking. Scanner errors and wrong-image reports still fail in both modes.
- Lesson. A rule that is right for the image being promoted can be wrong for the image being removed.
A paused database failed the smoke test (21–22 October)
With the scan fixed, the next delivery failed with login:503 39542434067.
- Cause. The update changed no migration, so nothing had touched the database before the smoke test. Aurora had paused at 0 ACU; the login, the first database call, met a cluster still resuming. MediaApi gave up after about 10.7 s, and capacity read 1.0 ACU moments later.
- Fix. The deploy smoke now retries only the login, only on 502/503/504 or a connection failure, after 5, 10 and 15 s, within 180 s, and records every attempt. The release smoke, which runs after its migration has woken the database, is not retried. The redelivery passed 39545554380.
- The same fault came back. After the database split, three deliveries on 22 October failed with
processing-jobs:50322 Oct. One of them shows login attempts[503, 200]: the retry woke Media's cluster, but Processing's cluster pauses separately and the Processing call was not retried. The retry now covers the first call to each database, and the next delivery passed f07b5e6. - Lesson. A design change (two clusters) changes the operational assumptions of tests written for the old design.
The account's limits are not the documentation's limits (21 October)
Creating the short-lane Lambda rolled the whole stack update back: the design asked for 3584 MB (about 2 vCPU, to match Fargate), and this account refuses more than 3008 MB 39596145564. The next delivery then refused to start, because the deploy tool treated the stack's UPDATE_ROLLBACK_COMPLETE status as broken, although CloudFormation accepts an update from it. The lane now uses 3008 MB, and the deploy tool treats a completed rollback as updatable while still blocking failed and in-progress states.
Smaller findings
| What happened | Cause | What changed |
|---|---|---|
| A Media release was held by the migration-compatibility guard (20 October) 39412315002 | A repository-wide formatting change had altered the bytes of an already-released migration file | The original bytes were restored, and released migrations are excluded from formatting; the guard stayed |
| The release plan rejected the worker image (21 October) 39637798081 | ECR's scan reported CVE-2025-52290 in FFmpeg, which has no fix and was not in the accepted list | An accepted-unfixed entry with its reasoning; the finding stays visible |
| The fast test suite timed out once and passed on re-run (21 October) | Hosted runners normally take 95–115 s against a 120 s budget; a stall crossed it | Budget raised to 180 s inside a 5-minute job; nothing retries automatically |
| A nine-clip burst sent 18 work messages for 9 jobs (19 October) lv11 | At-least-once delivery and repair re-sends | Nothing: the inbox and lease fences made the duplicates harmless, and all 9 jobs finished once. Duplicates were tolerated, not eliminated. |
| Per-run stacks cost a 25-minute deploy and a 25–40-minute teardown for every check (to 18 October) | Each proof run built and deleted a whole environment | One persistent environment, updated in place by CD (4a) |
Open issues
- End-to-end latency misses the 20 s aim on both lanes; 35–80 s per job is not yet attributed (4d).
- Public edge: the API Gateway URL is reachable without CloudFront, and there is no WAF (4 · Network).
- Image-only rollback: schema compatibility is attested, not tested automatically.
- Operations hardening: no branch protection, no reviewer on the
awsenvironment, a broad deploy role, no staging, no alarm notifications. The first steps would be a ruleset requiring Full verification and one review onMainanddev/closeout, a least-privilege deploy policy, and an SNS notification target for the alarms. - Unmeasured evidence: lost-queue-entry recovery time on AWS, the duplicate-output check after a worker kill, a backup restore drill, and the actual monthly bill.
Current status and owners of these issues are in 2a.
Questions a professor may ask
You call these independent microservices, yet they live in one repository. Why?
Independence means each service owns its data, its release and its failure, not that it has its own repository. A monorepo lets a contract change and both consumers land in one reviewed pull request, which the contract policy (consumers accept versions N and N-1) depends on. Independence is enforced by mechanisms that a repository split would not add: per-service CI lanes, images that fail to build if they contain the other service's code, IAM roles per function, and CD releasing only the owner whose image inputs changed. The cost is what the two services still share: one lockfile, one CloudFormation stack and a copied shared kernel. With separate teams, splitting the repositories and publishing contracts/ as a versioned package would be the next step.
Why run full CI again after the merge, when the pull request already passed?
A pull-request run tests GitHub's preview merge of the branch into the base at that moment. If Main moves before the merge, or the merge is done differently, the commit that lands is not the commit that was tested. CD therefore admits only a push run on the exact merged SHA, with the full tier selected and Full verification green. It costs about 7 more minutes per merge, plus some runner time. The alternative, a merge queue that tests the exact merge commit before it lands, would avoid the duplicate run but needs branch protection, which this repository does not have.
How do you know the image in production is the one that was scanned?
CD builds the image on the runner and scans that local image's config ID before pushing anything. It then pushes that same config under a new immutable tag, and the release plan reads the registry manifest back and checks that it points at the scanned config, and that ECR's own scan on push has completed. The Lambda version published from it names the digest in its description, and after the release the stack is updated to name the same digest. A post-release read-back confirmed the three image digests, the ten live aliases and the worker task definition matched. The weak point: CI and CD each build the image, so the CI-scanned image and the deployed image are different builds of the same commit; the deployed one is scanned separately in CD.
Why would you ever accept a rollback target with a known vulnerability?
Only in one situation: the image is already running, the release replaces it with a clean candidate, and the advisory was published after it shipped. Blocking that release would keep the vulnerable image in production, which is worse. Restoring it in an emergency adds no exposure beyond what was already running. The rule is narrow: the candidate must still be clean, images the release keeps are still scanned strictly, scanner errors still fail, and the finding is written into the release receipt and the run summary. The alternatives were a hand-edited exemption per advisory, which turns into a habit, or rebuilding the old image, which produces bytes that never ran and so is not a real rollback target. A weekly rescan of retained images would surface such advisories before a release meets them.
Your smoke test retries. Does that not hide real failures?
The retry is limited to one known transient: the first call to each database after Aurora has paused. It applies only to the login and the Processing batch call, only to 502, 503, 504 or a connection failure, at most three more times (after 5, 10 and 15 s) within 180 s, and every attempt's status is kept in the receipt. Any other status fails at once, and a 503 that outlasts the retries still fails. The release smoke, which runs right after its migration has woken the database, is not retried at all, so the automatic-restore path is not softened. The alternative was a warm-up call before the smoke, which hides the same wake without recording it.
How would you roll back a schema change?
The pipeline does not. A restore moves code back; the schema stays at the new version. That is safe only if every migration is additive (add tables and nullable columns; never rename, drop or tighten in the same release), so the old code still works on the new schema. Automatic releases are refused when migrations change; a person must release with an explicit attestation. A destructive change would follow expand and contract: release 1 adds the new structure and writes both, release 2 moves readers, release 3 removes the old structure once no running or rollback image needs it. The missing piece is an automated test that runs the previous image against the new schema in CI; today that compatibility rests on the attestation and on the contract tests.
There is no branch protection, no reviewer and no staging. How is that acceptable?
For a three-person course project working through one account, the team relied on practice (every change to Main through a pull request with green checks) and on what the pipeline does enforce: CD will not deploy a commit without a green full run, the deploy role is reachable only from the aws environment, and every release is smoke-tested in production with automatic restore. The local V1 stack, on the same images, stands in for staging. It is not acceptable for a real team, and the fix is cheap: a ruleset requiring Full verification and one approving review on Main and dev/closeout, a required reviewer on the aws environment, a least-privilege deploy policy instead of AdministratorAccess, and a staging stack from the same template if the budget allows a second environment.
Why OIDC rather than access keys stored in GitHub?
A stored access key is a long-lived credential that anyone with access to the repository's secrets, or a leaked log, can use from anywhere until someone rotates it. With OIDC, each run asks GitHub for a signed token naming the repository and environment; AWS exchanges it for credentials that last at most four hours, and the role's trust policy accepts only this repository's aws environment. There is nothing to rotate or leak. The weakness is the role itself: it has administrator rights in one region, so a malicious change merged to Main could do anything there. A deploy policy listing only the CloudFormation, Lambda, ECR, ECS and S3 actions the pipeline uses would narrow that.