From c4ad9a303bae1a63e3b4bfff5c8a026f9384eebf Mon Sep 17 00:00:00 2001 From: Ephraim Anierobi Date: Fri, 20 Sep 2024 19:18:56 +0100 Subject: [PATCH 1/3] Fix pre-commit for auto update of fab migration versions This fixes the pre-commit for updating the version in FAB migration and also, updated the actual version as 1.4 since that's going to be the next version At the same time, added Daniel's fix for airflow alembic.ini file --- .pre-commit-config.yaml | 4 +++- airflow/providers/fab/alembic.ini | 2 +- airflow/providers/fab/auth_manager/models/db.py | 2 +- .../migrations/versions/0001_1_3_0_placeholder_migration.py | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 204ae2471863..b649fa0b7e6c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -505,7 +505,9 @@ repos: (?x) ^scripts/ci/pre_commit/version_heads_map\.py$| ^airflow/migrations/versions/.*$|^airflow/migrations/versions| - ^airflow/utils/db.py$ + ^airflow/providers/fab/migrations/versions/.*$|^airflow/providers/fab/migrations/versions| + ^airflow/utils/db.py$| + ^airflow/providers/fab/auth_manager/models/db.py$ additional_dependencies: ['packaging','google-re2'] - id: update-version name: Update version to the latest version in the documentation diff --git a/airflow/providers/fab/alembic.ini b/airflow/providers/fab/alembic.ini index 55c7338f9bd9..75d42ee16d3b 100644 --- a/airflow/providers/fab/alembic.ini +++ b/airflow/providers/fab/alembic.ini @@ -20,7 +20,7 @@ [alembic] # path to migration scripts # Use forward slashes (/) also on windows to provide an os agnostic path -script_location = migrations +script_location = %(here)s/migrations # template used to generate migration file names; The default value is %%(rev)s_%%(slug)s # Uncomment the line below if you want the files to be prepended with date and time diff --git a/airflow/providers/fab/auth_manager/models/db.py b/airflow/providers/fab/auth_manager/models/db.py index f72e1fcc65b8..efca4a104182 100644 --- a/airflow/providers/fab/auth_manager/models/db.py +++ b/airflow/providers/fab/auth_manager/models/db.py @@ -28,7 +28,7 @@ PACKAGE_DIR = os.path.dirname(airflow.__file__) _REVISION_HEADS_MAP: dict[str, str] = { - "1.3.0": "6709f7a774b9", + "1.4.0": "6709f7a774b9", } diff --git a/airflow/providers/fab/migrations/versions/0001_1_3_0_placeholder_migration.py b/airflow/providers/fab/migrations/versions/0001_1_3_0_placeholder_migration.py index 685216779dcf..722c39198a18 100644 --- a/airflow/providers/fab/migrations/versions/0001_1_3_0_placeholder_migration.py +++ b/airflow/providers/fab/migrations/versions/0001_1_3_0_placeholder_migration.py @@ -36,7 +36,7 @@ down_revision = None branch_labels = None depends_on = None -fab_version = "1.3.0" +fab_version = "1.4.0" def upgrade() -> None: ... From c9c21aa2bdf7368747649415cc39e7d2e2885ef5 Mon Sep 17 00:00:00 2001 From: Ephraim Anierobi Date: Fri, 20 Sep 2024 20:47:58 +0100 Subject: [PATCH 2/3] fixup! Fix pre-commit for auto update of fab migration versions --- docs/apache-airflow-providers-fab/migrations-ref.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/apache-airflow-providers-fab/migrations-ref.rst b/docs/apache-airflow-providers-fab/migrations-ref.rst index dbddd6e7d413..bf27837e8479 100644 --- a/docs/apache-airflow-providers-fab/migrations-ref.rst +++ b/docs/apache-airflow-providers-fab/migrations-ref.rst @@ -34,7 +34,7 @@ Here's the list of all the Database Migrations that are executed via when you ru +-------------------------+--------------+---------------+------------------------+ | Revision ID | Revises ID | Fab Version | Description | +=========================+==============+===============+========================+ -| ``6709f7a774b9`` (head) | ``None`` | ``1.3.0`` | placeholder migration. | +| ``6709f7a774b9`` (head) | ``None`` | ``1.4.0`` | placeholder migration. | +-------------------------+--------------+---------------+------------------------+ .. End of auto-generated table From 31c8aa2adcec0ce433a20abc84ecfa43b1261dcd Mon Sep 17 00:00:00 2001 From: Ephraim Anierobi Date: Fri, 20 Sep 2024 22:08:58 +0100 Subject: [PATCH 3/3] fixup! fixup! Fix pre-commit for auto update of fab migration versions --- ...aceholder_migration.py => 0001_1_4_0_placeholder_migration.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename airflow/providers/fab/migrations/versions/{0001_1_3_0_placeholder_migration.py => 0001_1_4_0_placeholder_migration.py} (100%) diff --git a/airflow/providers/fab/migrations/versions/0001_1_3_0_placeholder_migration.py b/airflow/providers/fab/migrations/versions/0001_1_4_0_placeholder_migration.py similarity index 100% rename from airflow/providers/fab/migrations/versions/0001_1_3_0_placeholder_migration.py rename to airflow/providers/fab/migrations/versions/0001_1_4_0_placeholder_migration.py