[v3-3-test] Fail constraints generation when a released provider is downgraded (#69870) - #71082
Merged
Merged
Conversation
…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
requested review from
amoghrajesh,
ashb,
bugraoz93,
gopidesupavan,
jason810496 and
jscheffl
as code owners
August 4, 2026 10:24
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.pyandscripts/in_container/run_generate_constraints.pynow matchmainbyte-for-byte.Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 5) following the guidelines