Repository navigation
Update image in every scheduled task definition - #2371
Merged
Merged
Conversation
The image was only replaced in containers named APP_NAME, but the pipeline action doesn't set APP_NAME, and scheduled task containers have their own names. So each deploy registered new revisions with the old image, and scheduled tasks only got a new image the next time the forms-admin Terraform was applied. Scheduled task definitions only have the app container, because ecs-scheduled-task leaves out the OpenTelemetry sidecar, so the image is set on that one container. The build fails if there is more than one, rather than putting the app image on the wrong container. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
theseanything
marked this pull request as ready for review
October 30, 2026 14:08
theseanything
requested review from
whi-tw
and
a balanced review from Copilot
October 30, 2026 14:08
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are identified for the name-independent scheduled-task image update.
No open issues 🎉
What changed in this PR
Fixes scheduled forms-admin task updates so deployments replace the container image regardless of its name, removing reliance on APP_NAME.
Changes:
- Updates the sole container in each scheduled task definition to use the deployed image.
- Fails explicitly if a definition does not contain exactly one container.
- Adjusts logging to reflect the name-independent update.
| File | Description |
|---|---|
infra/deployments/forms/pipelines/buildspecs/update-scheduled-task-definition/update-scheduled-task-definition.yml |
Replaces name-based image matching with a single-container update and container-count validation. |
Review effort: Balanced
whi-tw
approved these changes
Nov 2, 2026
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.
What problem does this pull request solve?
Scheduled forms-admin tasks don't get the new image when forms-admin is deployed. The deploy pipeline registers a new revision of each one, but with the old image.
This is because the
update-scheduled-task-definitionsstep only updates containers namedAPP_NAME, and:APP_NAMEforms-admin-form-snapshotsSo the Mailchimp sync, organisations sync and form snapshots tasks run whatever image was current at the last forms-admin Terraform apply.
Scheduled task definitions only have one container, so the step now updates that container whatever it's called. If a definition has more than one container, the step fails rather than guess.