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

ci: ensure frozen migrations #1968

Merged
merged 9 commits into from
Jul 4, 2024
Merged

ci: ensure frozen migrations #1968

merged 9 commits into from
Jul 4, 2024

Conversation

gak
Copy link
Contributor

@gak gak commented Jul 4, 2024

Fixes #1962

  • Checks for changes to existing migration files against `main, ignoring new lines and single line comments.
  • Adds a just ensure-frozen-migrations.
  • Adds a CI check.

@gak gak requested a review from alecthomas as a code owner July 4, 2024 01:46
@gak gak requested review from a team and deniseli and removed request for a team July 4, 2024 01:46
@ftl-robot ftl-robot mentioned this pull request Jul 4, 2024
local changed_files

# Get list of changed SQL files compared to main branch
changed_files=$(git diff --name-only origin/main -- "$sql_dir"/*.sql)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Use merge-base here (see linting for example), origin main isn't reliable

@alecthomas
Copy link
Collaborator

Noice, thanks gak

@alecthomas alecthomas merged commit bc7868a into main Jul 4, 2024
48 checks passed
@alecthomas alecthomas deleted the gak/ensure-frozen-migrations branch July 4, 2024 03:45
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.

CI check to prevent changes to existing migrations
2 participants