Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a PR check to ensure migrations are up to date #2092

Closed
4 tasks done
thekaveman opened this issue May 14, 2024 · 3 comments · Fixed by #2122 or #2132
Closed
4 tasks done

Add a PR check to ensure migrations are up to date #2092

thekaveman opened this issue May 14, 2024 · 3 comments · Fixed by #2122 or #2132
Assignees
Labels
chore Chores and tasks for code cleanup, dev experience, admin/configuration settings, etc.

Comments

@thekaveman
Copy link
Member

thekaveman commented May 14, 2024

Sometimes we make model changes and forget to generate a new migration, e.g. with the case of #2078 and the follow-up #2086.

Let's create a PR check that runs the bin/makemigrations.sh script and errors if there are pending migrations.

When a migration is needed, the output looks like:

$ bin/makemigrations.sh
Migrations for 'core':
  benefits/core/migrations/NNNN_changes.py
    - [description of changes]

When there are no pending migrations, the output looks like:

$ bin/makemigrations.sh
No changes detected

Acceptance Criteria

  • A new workflow runs for all PRs that update files in the benefits/ directory
  • The workflow runs bin/makemigrations.sh
  • Unless the output is as above No changes detected, the workflow fails
  • The workflow is added as a required check to merge PRs
@thekaveman thekaveman added the chore Chores and tasks for code cleanup, dev experience, admin/configuration settings, etc. label May 14, 2024
@angela-tran
Copy link
Member

The workflow is added as a required check to merge PRs

Need to configure this once it is available in Settings

@angela-tran angela-tran reopened this May 30, 2024
@thekaveman
Copy link
Member Author

I added this as a required check for dev, test, and prod.

@thekaveman
Copy link
Member Author

thekaveman commented Jun 3, 2024

I forgot, if we have a required check that only runs sometimes (e.g. because of a path filter on the PR files) then that check will block some PRs.

I think to simplify we can just remove the path filter in the workflow. This check shouldn't take very long comparatively.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Chores and tasks for code cleanup, dev experience, admin/configuration settings, etc.
Projects
Status: Done
2 participants