Python: enforce dependency-bounds validator in CI#6645
Open
vaibhav-patel wants to merge 1 commit into
Open
Conversation
Add a blocking "Dependency Bounds Validation" job to the Python code quality workflow so `validate-dependency-bounds-test` runs on pull requests and in the merge queue, not just on the weekly maintenance schedule (where it is non-blocking and only opens an issue on failure). The validator smoke-tests both ends of every package's allowed dependency range (lowest-direct and highest) and runs each package's pyright pass in an isolated environment, catching floor-too-low, missing-optional-dependency, and isolated-env typing regressions that the full-workspace test and typing jobs miss. Wiring it into required CI catches these at PR time instead of at release time. The job mirrors the dependency maintenance workflow's environment (Python 3.13, full git history for the workspace graph) so PR results line up with the nightly sweep, runs without continue-on-error so it can gate merges, and uploads the JSON report as an artifact for triage. Fixes microsoft#6582.
|
@vaibhav-patel please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a new required CI job to run the Python dependency-bounds validator on pull requests / merge queue events, so dependency floor/ceiling and isolated-environment typing regressions are caught before merging to main.
Changes:
- Add a blocking Dependency Bounds Validation job to the existing Python code-quality workflow.
- Run
uv run poe validate-dependency-bounds-test --package "*"with a 60-minute timeout and upload the JSON results artifact for triage.
Comment on lines
+164
to
+177
| - name: Set up python and install the project | ||
| id: python-setup | ||
| uses: ./.github/actions/python-setup | ||
| with: | ||
| python-version: ${{ env.UV_PYTHON }} | ||
| os: ${{ runner.os }} | ||
| env: | ||
| UV_CACHE_DIR: /tmp/.uv-cache | ||
| # Smoke both ends of every package's allowed dependency range (lowest-direct and | ||
| # highest) and run each package's pyright pass in an isolated environment. This | ||
| # catches floor-too-low, missing-optional-dependency, and isolated-env typing | ||
| # regressions that the full-workspace test and typing jobs do not. | ||
| - name: Validate dependency bounds (lower + upper) | ||
| run: uv run poe validate-dependency-bounds-test --package "*" |
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.
Fixes #6582.
Motivation & Context
The dependency-bounds validator (
uv run poe validate-dependency-bounds-test) isonly run by the weekly
python-dependency-maintenance.ymlworkflow, where it iscontinue-on-error: trueand merely opens an issue on failure. It is not a requiredPR check, so dependency-floor, missing-optional-dependency, and isolated-env typing
regressions can land on
mainand ship in a release before anyone notices — ashappened at the
python-1.8.1tag, which was released while the validator was redfor
packages/coreatlowest-directresolution.Description & Review Guide
Adds a blocking Dependency Bounds Validation job to
python-code-quality.yml,which already runs on
pull_request→main,merge_group, andworkflow_dispatch.The job runs
validate-dependency-bounds-test --package "*", which smoke-tests bothends of every package's allowed dependency range (
lowest-directandhighest) andruns each package's pyright pass in an isolated environment.
continue-on-error, so it can gate PRs and the merge queue — the gap thisissue is about.
history for the internal workspace graph) so PR results line up with the nightly sweep.
timeout-minutes: 60guards against a hung resolver.The underlying floor/packaging issues this validator caught (the telemetry
find_specexceptclause, theagent-framework-toolsdev dependency on core, andthe shell-tool test
skipifguards) were already fixed in the 1.9.0 version bump, sothe validator is green on
mainand this job can be required immediately.Cost / scoping note
A full lower+upper sweep across all packages is somewhat slow. If per-PR cost becomes
a concern, follow-up options are to scope the run to changed packages on standard PRs,
or to run the full sweep nightly plus required-on-merge-queue. This PR wires up the
full required check first as the minimal correct fix; scoping can be layered on later.