Skip to content

Python: ci: validate dependency bounds for metadata changes - #7476

Closed
aliouswe (alectimison-maker) wants to merge 5 commits into
microsoft:mainfrom
alectimison-maker:agent-tasks/6582
Closed

aliouswe (alectimison-maker) wants to merge 5 commits into
microsoft:mainfrom
alectimison-maker:agent-tasks/6582

Conversation

@alectimison-maker

Copy link
Copy Markdown

Motivation & Context

Python package dependency bounds are validated by weekly maintenance, but a broken floor or ceiling can still merge before that schedule catches it. The repository now has a bounded validate-python-release task that probes only changed package metadata and its affected package closure, but no CI workflow invokes it.

This closes the enforcement gap without putting the exhaustive workspace matrix on every Python PR, matching the cost concern discussed in #6582.

Description & Review Guide

  • What are the major changes? Add a blocking Dependency Bounds job to the existing Python Code Quality workflow. It resolves the immutable PR/merge-group base, detects changes to published package pyproject.toml files, and conditionally runs validate-python-release against that base.
  • What is the impact of these changes? Package metadata changes are tested at their lower and upper dependency resolutions before merge. Ordinary Python code changes pay only for checkout plus git diff; project setup and validation are skipped.
  • What do you want reviewers to focus on? Please verify the event-specific base-ref fallback and whether package manifests are the desired trigger boundary. The exhaustive test+typing bounds matrix remains in weekly dependency maintenance.

Related Issue

Fixes #6582

Validation

  • actionlint .github/workflows/python-code-quality.yml
  • YAML parse and git diff --check
  • Change detector: current workflow-only diff skips; a historical package-manifest commit triggers
  • Release validator dry-run: 76 lower/upper probes across 38 affected packages completed successfully

Contribution Checklist

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible — not run for this workflow-only change; the workflow lint, detector branches, and validator dry-run are covered above
  • The PR follows the Contribution Guidelines
  • This PR is linked to an issue and there is no other open PR for this issue (see Related Issue above).
  • This is not a breaking change. If it is a breaking change, add the breaking change label (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a lightweight, blocking CI gate to the existing Python Code Quality workflow to enforce Python package dependency-bound validation when package metadata changes, closing the gap between weekly maintenance validation and day-to-day merges.

Changes:

  • Adds a new Dependency Bounds job to .github/workflows/python-code-quality.yml.
  • Computes a stable base SHA/ref for PRs and merge groups, detects whether package pyproject.toml metadata changed, and conditionally runs uv run poe validate-python-release.

id: package-metadata
shell: bash
run: |
if git diff --quiet "${BASE_REF}" HEAD -- 'python/packages/*/pyproject.toml'; then

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 403197b. The metadata detector now checks both python/pyproject.toml and python/packages/*/pyproject.toml, matching _changed_release_project_paths in the release validator. I also updated the branch from current upstream main; the aggregate PR diff remains limited to the code-quality workflow. The resulting workflow parses as YAML and the detector contains both pathspecs.

This branch was previously deployed

1 inactive deployment
github-app-auth — 94855685 Deployed Aug 4, 2026 by alectimison-maker via add_label #20194
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Usage: [Issues, PRs], Target: Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python: dependency-bounds validator is not enforced in CI

3 participants