Skip to content

Conversation

@amoghrajesh
Copy link
Contributor

@amoghrajesh amoghrajesh commented Jul 7, 2025

As seen in https://github.com/apache/airflow/actions/runs/16107085605/job/45444460353, the script was supposed to update the version for UV_VERSION, but it also accidentally updated PRE_COMMIT_UV_VERSION because both names contain UV_VERSION and the regex used looked for any text that said UV_VERSION and changed the number after it. But it didn’t check if UV_VERSION was part of a longer name, like PRE_COMMIT_UV_VERSION.

ISSUE:

pre-commit hook(s) made changes.
If you are seeing this message in CI, reproduce locally with: `pre-commit run --all-files`.
To run `pre-commit` as part of git workflow, use `pre-commit install`.
All changes made by hooks:
diff --git a/Dockerfile.ci b/Dockerfile.ci
index 2282881..a8e47e4 100644
--- a/Dockerfile.ci
+++ b/Dockerfile.ci
@@ -1410,7 +1410,7 @@ ARG AIRFLOW_SETUPTOOLS_VERSION=80.9.0
 ARG AIRFLOW_UV_VERSION=0.7.19
 # TODO(potiuk): automate with upgrade check (possibly)
 ARG AIRFLOW_PRE_COMMIT_VERSION="4.2.0"
-ARG AIRFLOW_PRE_COMMIT_UV_VERSION="4.1.4"
+ARG AIRFLOW_PRE_COMMIT_UV_VERSION="0.7.19"
 
 ENV AIRFLOW_PIP_VERSION=${AIRFLOW_PIP_VERSION} \
     AIRFLOW_SETUPTOOLS_VERSION=${AIRFLOW_SETUPTOOLS_VERSION} \
diff --git a/dev/breeze/src/airflow_breeze/commands/release_management_commands.py b/dev/breeze/src/airflow_breeze/commands/release_management_commands.py
index badf143..db9bcb1 100644
--- a/dev/breeze/src/airflow_breeze/commands/release_management_commands.py
+++ b/dev/breeze/src/airflow_breeze/commands/release_management_commands.py
@@ -250,7 +250,7 @@ AIRFLOW_USE_UV = False
 GITPYTHON_VERSION = "3.1.44"
 RICH_VERSION = "14.0.0"
 PRE_COMMIT_VERSION = "4.2.0"
-PRE_COMMIT_UV_VERSION = "4.1.4"
+PRE_COMMIT_UV_VERSION = "0.7.19"
 HATCH_VERSION = "1.14.1"
 PYYAML_VERSION = "6.0.2"

This PR makes the script only look for lines that start with UV_VERSION (not lines like PRE_COMMIT_UV_VERSION).

Simple script to check this behaviour:

import re

line = 'PRE_COMMIT_UV_VERSION = "4.1.4"'

# old pattern
old_pattern = re.compile(r'(UV_VERSION = )("[0-9.]+" )?')

# new pattern
new_pattern = re.compile(r'^(\s*UV_VERSION = )("[0-9.]+")', re.MULTILINE)

replacement = r'\1"0.7.19"'

old_result = old_pattern.sub(replacement, line)
new_result = new_pattern.sub(replacement, line)

print("Original:   ", line)
print("Old result: ", old_result)
print("New result: ", new_result)

Output:

Original:    PRE_COMMIT_UV_VERSION = "4.1.4"
Old result:  PRE_COMMIT_UV_VERSION = "0.7.19"
New result:  PRE_COMMIT_UV_VERSION = "4.1.4"

^ 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.

@boring-cyborg boring-cyborg bot added area:dev-tools backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch labels Jul 7, 2025
@amoghrajesh amoghrajesh requested review from Lee-W and eladkal July 7, 2025 06:11
@Lee-W Lee-W merged commit 8e5c284 into apache:main Jul 7, 2025
48 checks passed
github-actions bot pushed a commit that referenced this pull request Jul 7, 2025
…lient to re matches (#52960)

(cherry picked from commit 8e5c284)

Co-authored-by: Amogh Desai <amoghrajesh1999@gmail.com>
@github-actions
Copy link

github-actions bot commented Jul 7, 2025

Backport successfully created: v3-0-test

Status Branch Result
v3-0-test PR Link

@potiuk
Copy link
Member

potiuk commented Jul 7, 2025

He He

potiuk pushed a commit that referenced this pull request Jul 7, 2025
…lient to re matches (#52960) (#52961)

(cherry picked from commit 8e5c284)

Co-authored-by: Amogh Desai <amoghrajesh1999@gmail.com>
kaxil pushed a commit that referenced this pull request Jul 7, 2025
…lient to re matches (#52960) (#52961)

(cherry picked from commit 8e5c284)

Co-authored-by: Amogh Desai <amoghrajesh1999@gmail.com>
kaxil pushed a commit that referenced this pull request Jul 7, 2025
…lient to re matches (#52960) (#52961)

(cherry picked from commit 8e5c284)

Co-authored-by: Amogh Desai <amoghrajesh1999@gmail.com>
kaxil pushed a commit that referenced this pull request Jul 9, 2025
…lient to re matches (#52960) (#52961)

(cherry picked from commit 8e5c284)

Co-authored-by: Amogh Desai <amoghrajesh1999@gmail.com>
HsiuChuanHsu pushed a commit to HsiuChuanHsu/airflow that referenced this pull request Jul 10, 2025
kaxil pushed a commit that referenced this pull request Jul 11, 2025
…lient to re matches (#52960) (#52961)

(cherry picked from commit 8e5c284)

Co-authored-by: Amogh Desai <amoghrajesh1999@gmail.com>
kaxil pushed a commit that referenced this pull request Jul 11, 2025
…lient to re matches (#52960) (#52961)

(cherry picked from commit 8e5c284)

Co-authored-by: Amogh Desai <amoghrajesh1999@gmail.com>
stephen-bracken pushed a commit to stephen-bracken/airflow that referenced this pull request Jul 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:dev-tools backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants