Skip to content

Update image in every scheduled task definition - #2371

Merged
theseanything merged 1 commit into
mainfrom
fix-scheduled-task-image-update
Nov 3, 2026
Merged

theseanything merged 1 commit into
mainfrom
fix-scheduled-task-image-update

Conversation

@theseanything

@theseanything theseanything commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

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-definitions step only updates containers named APP_NAME, and:

  • the pipeline doesn't set APP_NAME
  • scheduled task containers have their own names anyway, such as forms-admin-form-snapshots

So 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.

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
theseanything marked this pull request as ready for review October 30, 2026 14:08
@theseanything
theseanything requested review from whi-tw and a balanced review from Copilot October 30, 2026 14:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

@theseanything
theseanything added this pull request to the merge queue Nov 3, 2026
Merged via the queue into main with commit 1615a9a Nov 3, 2026
27 checks passed
@theseanything
theseanything deleted the fix-scheduled-task-image-update branch November 3, 2026 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants