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

Fixes 3232: add gh action to prevent out of order migrations #505

Merged
merged 1 commit into from
Jan 3, 2024

Conversation

xbhouse
Copy link
Contributor

@xbhouse xbhouse commented Dec 14, 2023

Summary

Added Github Action to check for out of order database migrations.

Testing steps

If the content in db/migrations.latest does not reflect the timestamp of the newest added set of migration files in db/migrations, the job will fail. If these timestamps match or if there are no new migrations, the job will succeed.

Can test by:

  • Adding a set of test migration files with an earlier timestamp than the latest and not updating the db/migrations.latest. This should cause the job to fail.
  • Removing the test migration files. The db/migrations.latest content should reflect the newest added set of migration files. This should cause the job to succeed.
  • Adding a set of test migration files with a timestamp that matches the timestamp in db/migrations.latest. This should cause the job to succeed.

Checklist

  • Tested with snapshotting feature disabled and pulp server URL not configured if appropriate

@jlsherrill
Copy link
Member

@xbhouse xbhouse force-pushed the gh-action-migrations branch 4 times, most recently from c84a7fd to 7ed97b6 Compare December 18, 2023 20:26
@xbhouse xbhouse force-pushed the gh-action-migrations branch from 61bba84 to 01b5b81 Compare December 18, 2023 20:28
@xbhouse xbhouse marked this pull request as ready for review December 19, 2023 14:26
Copy link
Member

@jlsherrill jlsherrill left a comment

Choose a reason for hiding this comment

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

ACK, nice approach!

@xbhouse xbhouse merged commit 447fd1a into content-services:main Jan 3, 2024
6 checks passed
@xbhouse xbhouse deleted the gh-action-migrations branch February 13, 2024 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants