This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch v3-2-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/v3-2-test by this push:
new fd1962fa027 [v3-2-test] CI: Build CI image after Dockerfiles are
updated in breeze ci upgrade (#64777) (#64781)
fd1962fa027 is described below
commit fd1962fa027c8b937fc5d4b8ed0d43544bfa3d94
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Mon Apr 6 18:42:29 2026 +0200
[v3-2-test] CI: Build CI image after Dockerfiles are updated in breeze ci
upgrade (#64777) (#64781)
(cherry picked from commit b875c406e62fb7319f0a19f02435d0f54266a9d2)
Co-authored-by: Jarek Potiuk <[email protected]>
---
.../src/airflow_breeze/commands/ci_commands.py | 40 +++++++++++++++-------
1 file changed, 27 insertions(+), 13 deletions(-)
diff --git a/dev/breeze/src/airflow_breeze/commands/ci_commands.py
b/dev/breeze/src/airflow_breeze/commands/ci_commands.py
index 7edf6fc2ac5..c7cd5e2b8ae 100644
--- a/dev/breeze/src/airflow_breeze/commands/ci_commands.py
+++ b/dev/breeze/src/airflow_breeze/commands/ci_commands.py
@@ -778,17 +778,9 @@ def upgrade(
"Commands may fail if they require authentication.[/]"
)
- # Build the CI image for Python 3.10 first so that subsequent steps (e.g.
uv lock
- # updates inside the image) use an up-to-date environment.
- console_print("[info]Building CI image for Python 3.10 …[/]")
- run_command(
- ["breeze", "ci-image", "build", "--python", "3.10"],
- check=False,
- env=command_env,
- )
-
- # Define all upgrade commands to run (all run with check=False to continue
on errors)
- upgrade_commands: list[tuple[str, str]] = [
+ # Define upgrade commands to run before building the CI image (all run
with check=False
+ # to continue on errors). These may update Dockerfiles and other build
inputs.
+ pre_image_commands: list[tuple[str, str]] = [
("autoupdate", "prek autoupdate --cooldown-days 4 --freeze"),
(
"update-chart-dependencies",
@@ -798,11 +790,17 @@ def upgrade(
"upgrade-important-versions",
"prek --all-files --show-diff-on-failure --color always --verbose
--stage manual upgrade-important-versions",
),
+ ]
+
+ # Define upgrade commands to run after building the CI image (they run
inside the image
+ # and need an up-to-date environment).
+ post_image_commands: list[tuple[str, str]] = [
(
"update-uv-lock",
"prek --all-files --show-diff-on-failure --color always --verbose
update-uv-lock --stage manual",
),
]
+
step_enabled = {
"autoupdate": autoupdate,
"update-chart-dependencies": update_chart_dependencies,
@@ -810,8 +808,24 @@ def upgrade(
"update-uv-lock": update_uv_lock,
}
- # Execute enabled upgrade commands with the environment containing GitHub
token
- for step_name, command in upgrade_commands:
+ # Execute pre-image upgrade commands (may update Dockerfiles)
+ for step_name, command in pre_image_commands:
+ if step_enabled[step_name]:
+ run_command(command.split(), check=False, env=command_env)
+ else:
+ console_print(f"[info]Skipping {step_name} (disabled).[/]")
+
+ # Build the CI image for Python 3.10 after Dockerfiles have been updated
so that
+ # subsequent steps (e.g. uv lock updates inside the image) use an
up-to-date environment.
+ console_print("[info]Building CI image for Python 3.10 …[/]")
+ run_command(
+ ["breeze", "ci-image", "build", "--python", "3.10"],
+ check=False,
+ env=command_env,
+ )
+
+ # Execute post-image upgrade commands (run inside the freshly built image)
+ for step_name, command in post_image_commands:
if step_enabled[step_name]:
run_command(command.split(), check=False, env=command_env)
else: