Skip to content

infra: decouple fargate migrations image#2613

Merged
daryllimyt merged 1 commit intomainfrom
codex/decouple-fargate-migrations-image
May 5, 2026
Merged

infra: decouple fargate migrations image#2613
daryllimyt merged 1 commit intomainfrom
codex/decouple-fargate-migrations-image

Conversation

@daryllimyt
Copy link
Copy Markdown
Contributor

@daryllimyt daryllimyt commented May 5, 2026

Summary

Decouple the Fargate migrations init container image from the application image. This adds optional tracecat_migrations_image and tracecat_migrations_image_tag variables at the root and ECS module layers, resolves them with fallbacks to the existing backend image settings, and wires the API migrations container to the resolved migration image.

The default behavior is unchanged: if the new variables are unset, migrations continue to use tracecat_image:tracecat_image_tag.

Impact

This enables the same app-only rollback pattern used in the Helm chart: keep migrations on a version that understands the current Alembic database revision while rolling the app containers back to an older image tag.

Validation

  • terraform fmt -check -recursive deployments/fargate
  • terraform -chdir=deployments/fargate validate
  • uv run ruff check deployments/fargate
  • git diff --check
  • repo pre-commit hooks during commit

Summary by cubic

Decouple the Fargate migrations init container image from the app image to allow pinning migrations while rolling back app versions. Default behavior is unchanged if new variables are not set.

  • New Features
    • Added optional tracecat_migrations_image and tracecat_migrations_image_tag at root and ECS module.
    • Fallbacks to tracecat_image and tracecat_image_tag when unset.
    • API migrations container now uses the resolved migrations image/tag.
    • Exported tracecat_migrations_image and tracecat_migrations_image_tag as outputs.
    • Updated README with usage and rollback guidance.

Written for commit 9cae3d0. Summary will update on new commits.

@daryllimyt daryllimyt changed the title [codex] decouple fargate migrations image infra: decouple fargate migrations image May 5, 2026
@daryllimyt daryllimyt marked this pull request as ready for review May 5, 2026 14:55
@topher-lo topher-lo added the infrastructure Infra updates and fixes label May 5, 2026
@zeropath-ai
Copy link
Copy Markdown

zeropath-ai Bot commented May 5, 2026

No security or compliance issues detected. Reviewed everything up to 9cae3d0.

Security Overview
Detected Code Changes
Change Type Relevant files
Configuration changes ► deployments/fargate/README.md
    Add documentation for optional migrations image override
► deployments/fargate/main.tf
    Add tracecat_migrations_image and tracecat_migrations_image_tag variables
► deployments/fargate/modules/ecs/ecs-api.tf
    Use tracecat_migrations_image and tracecat_migrations_image_tag for migrations container
► deployments/fargate/modules/ecs/locals.tf
    Define tracecat_migrations_image and tracecat_migrations_image_tag locals
► deployments/fargate/modules/ecs/outputs.tf
    Add tracecat_migrations_image and tracecat_migrations_image_tag outputs
► deployments/fargate/modules/ecs/variables.tf
    Add tracecat_migrations_image and tracecat_migrations_image_tag variables
► deployments/fargate/outputs.tf
    Add tracecat_migrations_image and tracecat_migrations_image_tag outputs
► deployments/fargate/variables.tf
    Add tracecat_migrations_image and tracecat_migrations_image_tag variables

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 8 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

@daryllimyt daryllimyt merged commit 9c9a429 into main May 5, 2026
8 checks passed
@daryllimyt daryllimyt deleted the codex/decouple-fargate-migrations-image branch May 5, 2026 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infrastructure Infra updates and fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants