Add CI check for uncommitted migrations#580
Conversation
AetherUnbound
left a comment
There was a problem hiding this comment.
It looks like the most recent CI run failed because it was unable to run the just command, not because of an uncommitted migration 🤔
Yes, so far it still hasn't run correctly. I only undrafted this so I could get the CI to run, please ignore for now! |
Oh got it, my bad! I didn't realize/remember CI doesn't run on drafts |
|
Seems like the TTY value in the docker-compose won't work for CI 🤔 Why does it work for running the tests? |
|
This run shows it working to pass when there are no uncommitted migrations: https://github.com/WordPress/openverse-api/runs/5680076354 The run was a mistake but at least it proves that it works 🙂 The next run will show what happens when it should break. |
| '"$(just web-health)" != "200"' \ | ||
| "Waiting for the API to be healthy..." | ||
|
|
||
| @_api-up: up wait-for-es wait-for-ing wait-for-web |
|
@AetherUnbound @obulat @stacimc this is ready for review now. You can see that the workflow correctly fails when there are uncommitted migrations: https://github.com/WordPress/openverse-api/runs/5680410997?check_suite_focus=true And passes when a new migration is added: https://github.com/WordPress/openverse-api/runs/5680076354 |
AetherUnbound
left a comment
There was a problem hiding this comment.
This is awesome 🎉 great work!
| cd api && pipenv run python manage.py {{ args }} | ||
|
|
||
| # Run Django administrative commands in the docker container | ||
| @dj docker_args="" +args="": _api-up |
There was a problem hiding this comment.
Thank you for this!!
stacimc
left a comment
There was a problem hiding this comment.
🎉 Excited to see this go in!
Fixes
Fixes #571 by @sarayourfriend
Description
Adds a new check to verify there are no uncommitted migrations in the PR.
Testing Instructions
Verify that the test commit (43c8c2c) introduces uncommitted migrations and that the CI fails for that commit.
Checklist
Update index.md).main) or a parent feature branch.Developer Certificate of Origin
Developer Certificate of Origin