Skip to content

[v3-3-test] Fail constraints generation when a released provider is downgraded (#69870) - #71082

Merged
potiuk merged 1 commit into
apache:v3-3-testfrom
potiuk:backport-1224056-v3-3-test
Aug 4, 2026
Merged

[v3-3-test] Fail constraints generation when a released provider is downgraded (#69870)#71082
potiuk merged 1 commit into
apache:v3-3-testfrom
potiuk:backport-1224056-v3-3-test

Conversation

@potiuk

@potiuk potiuk commented Aug 4, 2026

Copy link
Copy Markdown
Member

Backport of 1224056, which was missed when #71081 was cherry-picked. That backport brought over the test file in full — including the cases for the provider-downgrade check — while the check itself only ever existed on main, so #71081 had to ship with those tests trimmed out. This restores the check and the tests together.

scripts/tests/in_container/test_run_generate_constraints.py and scripts/in_container/run_generate_constraints.py now match main byte-for-byte.


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 5)

Generated-by: Claude Code (Opus 5) following the guidelines

…pache#69870)

* Fail constraints generation when a released provider is downgraded

Released provider versions only ever move forward on PyPI, so a lower
provider version in freshly generated PyPI constraints than in the
already-published constraints is never intentional. It means the highest
resolution dragged an old provider back in because a broken dependency
version constrained it. Left unnoticed, such a downgrade would be
committed to the constraints branch and shipped to users.

The regular `constraints` generation now compares each released provider
against the latest published constraints and stops with an error when any
would be downgraded, so the problem surfaces in CI instead of being
published. When it happens on the canary/push builds it also posts an
alert to the CI Slack channel, since there is no PR author watching those
runs, so maintainers learn about it immediately.

* Load provider dependencies lazily in generate-constraints script

The script read the gitignored, generated generated/provider_dependencies.json
at import time. That file is not generated in the "Scripts tests" CI job, so
importing the module (which the new tests do at collection) failed with
FileNotFoundError and broke test collection. Only get_all_active_provider_distributions
needs the data, so load it there instead of at module import, keeping the module
importable without the generated artifact.

(cherry picked from commit 1224056)
@potiuk
potiuk merged commit 188b92c into apache:v3-3-test Aug 4, 2026
5 checks passed
@potiuk
potiuk deleted the backport-1224056-v3-3-test branch August 4, 2026 10:24
@vatsrahul1001 vatsrahul1001 added this to the Airflow 3.3.1 milestone Aug 4, 2026
vatsrahul1001 pushed a commit that referenced this pull request Aug 5, 2026
…69870) (#71082)

* Fail constraints generation when a released provider is downgraded

Released provider versions only ever move forward on PyPI, so a lower
provider version in freshly generated PyPI constraints than in the
already-published constraints is never intentional. It means the highest
resolution dragged an old provider back in because a broken dependency
version constrained it. Left unnoticed, such a downgrade would be
committed to the constraints branch and shipped to users.

The regular `constraints` generation now compares each released provider
against the latest published constraints and stops with an error when any
would be downgraded, so the problem surfaces in CI instead of being
published. When it happens on the canary/push builds it also posts an
alert to the CI Slack channel, since there is no PR author watching those
runs, so maintainers learn about it immediately.

* Load provider dependencies lazily in generate-constraints script

The script read the gitignored, generated generated/provider_dependencies.json
at import time. That file is not generated in the "Scripts tests" CI job, so
importing the module (which the new tests do at collection) failed with
FileNotFoundError and broke test collection. Only get_all_active_provider_distributions
needs the data, so load it there instead of at module import, keeping the module
importable without the generated artifact.

(cherry picked from commit 1224056)
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.

2 participants