Skip to content

Feat: add auto migrations and notifications#1777

Merged
MarceloRobert merged 3 commits intokernelci:mainfrom
MarceloRobert:feat/auto-migration
Mar 9, 2026
Merged

Feat: add auto migrations and notifications#1777
MarceloRobert merged 3 commits intokernelci:mainfrom
MarceloRobert:feat/auto-migration

Conversation

@MarceloRobert
Copy link
Copy Markdown
Collaborator

@MarceloRobert MarceloRobert commented Mar 3, 2026

NOTE: this PR has a test commit at the end so that the CI can run and we can test the migration detection. This will be removed before merging.

Changes

  • Adds auto-migration running when starting the backend
  • Adds notifications for when there are new migrations on staging and production deployments
    Staging compares the current commit with the previous one, while production compares the current tag with the previous release tag

Notification will be like:

New Django migrations detected in this staging deployment:
backend/kernelCI_app/migrations/0017_treelisting_new_field.py

or

No new Django migrations detected in production deployment of release/20260304.0

Closes #1764

@MarceloRobert MarceloRobert self-assigned this Mar 3, 2026
@MarceloRobert MarceloRobert marked this pull request as ready for review March 4, 2026 16:19
@MarceloRobert MarceloRobert force-pushed the feat/auto-migration branch 2 times, most recently from 7e9e8c1 to bec53d8 Compare March 4, 2026 19:38
@MarceloRobert MarceloRobert changed the title Feat: block deploy if it has migrations Feat: add auto migrations and notifications Mar 4, 2026
@MarceloRobert MarceloRobert added the CI/CD Most or all of the changes are about automated tests / Github's CI label Mar 4, 2026
args: "Deploying production Dashboard with tag `${{ github.event.inputs.tag }}`"

check-migrations:
depends-on: start-notification
Copy link
Copy Markdown
Contributor

@gustavobtflores gustavobtflores Mar 6, 2026

Choose a reason for hiding this comment

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

the key here shouldn't be needs instead of depends-on?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I confused with the docker-compose style...

args: "No new Django migrations detected in production deployment of `${{ github.event.inputs.tag }}`"

deploy-production:
depends-on: start-notification
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.

ditto

Copy link
Copy Markdown
Contributor

@gustavobtflores gustavobtflores left a comment

Choose a reason for hiding this comment

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

LGTM

Notifies on discord when staging has a new migration
Notifies on discord about new/no migration for the production deployment
@MarceloRobert MarceloRobert added this pull request to the merge queue Mar 9, 2026
Merged via the queue into kernelci:main with commit 8483c33 Mar 9, 2026
7 checks passed
@MarceloRobert MarceloRobert deleted the feat/auto-migration branch April 22, 2026 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI/CD Most or all of the changes are about automated tests / Github's CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automate migration script with manual-approval pipeline

2 participants