-
Notifications
You must be signed in to change notification settings - Fork 15k
Integrate alembic check
in ci
#49002
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
base: main
Are you sure you want to change the base?
Conversation
5513306
to
9a67d8b
Compare
Could you add a change to a model in a second commit on this PR (that we will shortly revert/undo) to test that this fails as expected please? |
Sure! I would do it later after this CI finished (make sure it could pass now) |
ActionCommand( | ||
name="check-models", | ||
help="Check if there are model changes without a corresponding migration", | ||
description="Check if the current models require new migrations to be generated", | ||
func=lazy_load_command("airflow.cli.commands.db_command.check_models"), | ||
args=(ARG_VERBOSE,), | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I'm not sure we want this in here though actually.
The airflow db
is designed for end users/Airflow administrators to run, but the check command is only useful for Airflow devs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for reviewing, I would remove it from airflow db
~
9a67d8b
to
f389818
Compare
f389818
to
b13a09c
Compare
b3e4358
to
31fa445
Compare
cc8b840
to
f09bb95
Compare
9f22ec4
to
b68002a
Compare
b68002a
to
e4ec1a5
Compare
e4ec1a5
to
4935d6e
Compare
4935d6e
to
2604527
Compare
2604527
to
3dee702
Compare
6def718
to
8fe2c39
Compare
66cd694
to
4c3b055
Compare
4c3b055
to
9645890
Compare
2cc7087
to
ae67e5a
Compare
alembic check
alembic check
in ci
ae67e5a
to
5e68e28
Compare
5e68e28
to
9354811
Compare
Related Issue
closes #48998
cc: @ashb
Why
Since Alembic 1.9, a built-in command
alembic check
is available to detect database model changes that don't have corresponding migration files. This feature is crucial for maintaining database integrity by ensuring developers create appropriate migration files whenever they modify database models.Currently, our CI pipeline runs various migration tests, but it doesn't verify if model changes have corresponding migrations. Integrating this check into our CI ensures that no model changes go unnoticed, preventing potential issues that could arise when applying migrations in production.
How
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rst
or{issue_number}.significant.rst
, in airflow-core/newsfragments.