Skip to content

Standardize Alembic migration descriptions and add a style lint - #69537

Merged
Lee-W merged 2 commits into
apache:mainfrom
FrankYang0529:airflow-69496
Jul 23, 2026
Merged

Standardize Alembic migration descriptions and add a style lint#69537
Lee-W merged 2 commits into
apache:mainfrom
FrankYang0529:airflow-69496

Conversation

@FrankYang0529

Copy link
Copy Markdown
Member

Why

  • Migration descriptions are user-facing: they are rendered into the migrations-ref.rst documentation table and printed by alembic history / airflow db migrate.
  • Out of 124 core migrations, 15 descriptions start with a lowercase letter and 2 use non-imperative mood (Added ..., Adding ...), making those listings inconsistent.

How

  • Add rule MIG004 to the check-migration-patterns prek hook: the description must start with a capital letter, use the imperative mood, and end with a period.
  • Extend the hook to providers/*/migrations/versions/. fab and edge3 have their own migration trees and docs tables.
  • Normalize the 17 non-conforming descriptions and regenerate migrations-ref.rst via the update-migration-references hook.
  • Fix the contributing-docs example

Was generative AI tooling used to co-author this PR?
  • Yes - Claude Code

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

@ashb

ashb commented Jul 7, 2026

Copy link
Copy Markdown
Member

When did this convention if creating our own ruff-style rule codes that aren't part of ruff come around? I'm not a huge fan of it, and I'm aware of any discussion about it.

@FrankYang0529

Copy link
Copy Markdown
Member Author

When did this convention if creating our own ruff-style rule codes that aren't part of ruff come around? I'm not a huge fan of it, and I'm aware of any discussion about it.

Rules MIG001, MIG002, and MIG003 were introduced from #64972. I cannot find discussion in dev mail list, either. IIUC, the ruff hasn't supported custom linter yet. We may still need to rely on this to do the check.

https://docs.astral.sh/ruff/faq/#can-i-write-my-own-linter-plugins-for-ruff

@pierrejeambrun pierrejeambrun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thanks.

Fair question from Ash, but outside the scope of this PR I suppose. (good potential follow up though)

Comment thread .pre-commit-config.yaml Outdated
Signed-off-by: PoAn Yang <payang@apache.org>
Comment thread scripts/ci/prek/check_migration_patterns.py Outdated
Co-authored-by: Wei Lee <hello@wei-lee.me>
@Lee-W
Lee-W merged commit 54d9a8e into apache:main Jul 23, 2026
78 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Backport successfully created: v3-3-test

Note: As of Merging PRs targeted for Airflow 3.X
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.

In matter of doubt please ask in #release-management Slack channel.

Status Branch Result
v3-3-test PR Link

github-actions Bot pushed a commit to aws-mwaa/upstream-to-airflow that referenced this pull request Jul 23, 2026
…e lint (apache#69537)

(cherry picked from commit 54d9a8e)

Co-authored-by: PoAn Yang <payang@apache.org>
Co-authored-by: Wei Lee <hello@wei-lee.me>
Signed-off-by: PoAn Yang <payang@apache.org>
aws-airflow-bot pushed a commit to aws-mwaa/upstream-to-airflow that referenced this pull request Jul 23, 2026
…e lint (apache#69537)

(cherry picked from commit 54d9a8e)

Co-authored-by: PoAn Yang <payang@apache.org>
Co-authored-by: Wei Lee <hello@wei-lee.me>
Signed-off-by: PoAn Yang <payang@apache.org>
@FrankYang0529
FrankYang0529 deleted the airflow-69496 branch July 24, 2026 03:07
vatsrahul1001 pushed a commit that referenced this pull request Jul 30, 2026
…e lint (#69537) (#70262)

(cherry picked from commit 54d9a8e)

Signed-off-by: PoAn Yang <payang@apache.org>
Co-authored-by: PoAn Yang <payang@apache.org>
Co-authored-by: Wei Lee <hello@wei-lee.me>
vatsrahul1001 pushed a commit that referenced this pull request Aug 5, 2026
…e lint (#69537) (#70262)

(cherry picked from commit 54d9a8e)

Signed-off-by: PoAn Yang <payang@apache.org>
Co-authored-by: PoAn Yang <payang@apache.org>
Co-authored-by: Wei Lee <hello@wei-lee.me>
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.

Inconsistent capitalization and verb tense in Alembic migration descriptions

4 participants