Skip to content

Commit 23bcbe6

Browse files
authored
Regenerate provider requirement tables in breeze ci upgrade (#73802)
Raising dependency floors changes provider pyproject.toml files, but the requirement tables rendered from them into README.rst and docs/index.rst are only refreshed by prek hooks, and the upgrade commit is made without prek git hooks installed. Every upgrade PR that raised a provider floor therefore failed static checks until the tables were regenerated by hand. Generated-by: Claude Opus 5
1 parent 28e7c89 commit 23bcbe6

3 files changed

Lines changed: 26 additions & 3 deletions

File tree

‎dev/breeze/doc/08_ci_tasks.rst‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ root ``pyproject.toml``: a floor is raised to the newest release that is at leas
4747
old, members of a group share one floor, and packages that are capped anywhere or listed under
4848
``exclude`` are never touched. Bumps that make ``uv lock`` fail - with the highest or the lowest-direct
4949
resolution - are rolled back and listed in the PR description together with everything that was
50-
raised or skipped. Use ``--no-upgrade-dependency-floors`` to skip the step. The design is recorded in
50+
raised or skipped. The provider ``README.rst`` and ``docs/index.rst`` requirement tables are then
51+
regenerated from the changed ``pyproject.toml`` files. Use ``--no-upgrade-dependency-floors`` to skip
52+
both steps. The design is recorded in
5153
`ADR 0018 <adr/0018-raise-dependency-floors-automatically.md>`_.
5254

5355
These are all available flags of ``upgrade`` command:

‎dev/breeze/src/airflow_breeze/commands/ci_commands.py‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,14 @@ def remove_backport_labels(*, branch_name: str, command_env: dict[str, str]) ->
610610
"upgrade-dependency-floors",
611611
"prek --all-files --show-diff-on-failure --color always --verbose --stage manual upgrade-dependency-floors",
612612
),
613+
(
614+
# Raised floors change provider pyproject.toml files, but the requirement tables rendered
615+
# from them into README.rst and docs/index.rst are only refreshed by these hooks, and the
616+
# upgrade commit is not made with prek hooks installed, so CI's --all-files run goes red.
617+
"regenerate-provider-requirement-tables",
618+
"prek --all-files --show-diff-on-failure --color always --verbose "
619+
"update-providers-build-files sync-provider-readme",
620+
),
613621
(
614622
"update-uv-lock",
615623
"uv lock --upgrade",
@@ -648,6 +656,7 @@ def get_step_enabled(
648656
"update-chart-dependencies": update_chart_dependencies,
649657
"upgrade-important-versions": upgrade_important_versions,
650658
"upgrade-dependency-floors": upgrade_dependency_floors,
659+
"regenerate-provider-requirement-tables": upgrade_dependency_floors,
651660
"update-uv-lock": update_uv_lock,
652661
"regenerate-datamodels": update_uv_lock,
653662
}

‎dev/breeze/tests/test_ci_upgrade.py‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,15 @@ def test_floor_step_runs_the_manual_hook():
4343
assert command.endswith("--stage manual upgrade-dependency-floors")
4444

4545

46+
def test_provider_requirement_tables_are_regenerated_after_the_floor_step():
47+
assert STEP_NAMES.index("upgrade-dependency-floors") < STEP_NAMES.index(
48+
"regenerate-provider-requirement-tables"
49+
)
50+
command = dict(UPGRADE_COMMANDS)["regenerate-provider-requirement-tables"]
51+
assert command.startswith("prek --all-files ")
52+
assert command.endswith(" update-providers-build-files sync-provider-readme")
53+
54+
4655
@pytest.mark.parametrize(
4756
("report", "expected_suffix"),
4857
[
@@ -89,9 +98,12 @@ def test_step_enabled_covers_every_step():
8998
assert set(get_step_enabled(**ALL_STEPS_ON)) == set(STEP_NAMES)
9099

91100

92-
def test_no_upgrade_dependency_floors_disables_only_that_step():
101+
def test_no_upgrade_dependency_floors_disables_only_the_floor_steps():
93102
enabled = get_step_enabled(**{**ALL_STEPS_ON, "upgrade_dependency_floors": False})
94-
assert [name for name, on in enabled.items() if not on] == ["upgrade-dependency-floors"]
103+
assert [name for name, on in enabled.items() if not on] == [
104+
"upgrade-dependency-floors",
105+
"regenerate-provider-requirement-tables",
106+
]
95107

96108

97109
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)