Skip to content

Python: Fix native Windows changed-package routing - #9947

Merged
Eduard van Valkenburg (eavanvalkenburg) merged 1 commit into
microsoft:mainfrom
eavanvalkenburg:repair-changed-package-paths
Nov 2, 2026
Merged

Eduard van Valkenburg (eavanvalkenburg) merged 1 commit into
microsoft:mainfrom
eavanvalkenburg:repair-changed-package-paths

Conversation

@eavanvalkenburg

Copy link
Copy Markdown
Member

Motivation & Context

Repository-relative paths passed to --files use backslashes on native Windows. The script only strips the forward-slash python/ prefix, so native paths can resolve below python/python and silently skip package tasks. This change routes native Windows paths without treating backslashes as separators on POSIX.

Description & Review Guide

  • What are the major changes? Parse changed files with the native Path implementation, strip a leading python path component, add focused path-routing regressions, and run those tests in the existing Linux/Windows matrix.
  • What is the impact of these changes? Native Windows and dot-prefixed repository paths select the intended package. Forward-slash, workspace-relative, absolute, and UNC paths retain their routing, while POSIX literal-backslash names keep their identity.
  • What do you want reviewers to focus on? The native path-component semantics and the focused cross-platform regression coverage.

Related Issue

Fixes #9742

This is the maintainer-owned follow-up after the competing #9769, #9775, and #9905 implementations were closed. No competing pull request remains open.

AI Assistance

  • No material AI assistance was used.
  • This is an AI-assisted contribution. I reviewed, understood, and verified all submitted content and accept responsibility for it.

AI assistance details: GitHub Copilot assisted with investigation, implementation, tests, validation, and this PR description.

Contribution Checklist

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible
  • The PR follows the Contribution Guidelines
  • This PR links to an agreed issue with no competing open PR, or the Related Issue section documents a trivial-change or repository-automation exception.
  • 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.

🟢 Approval recommended

No active review issues are reported for the cross-platform Python changed-package routing update.

No open issues 🎉

What changed in this PR

Fixes #9742 by making Python’s changed-package task routing recognize native Windows repository-relative paths while preserving POSIX literal-backslash filenames.

Changes:

  • Uses native Path components to strip the leading python directory.
  • Adds regression coverage for repository-relative, dot-prefixed, workspace-relative, absolute, UNC, and POSIX literal-backslash paths.
  • Runs the routing tests in the existing Linux/Windows CI matrix.
File Description
python/​scripts/​tests/​test_run_tasks_in_changed_packages.py Adds cross-platform path-routing regression tests.
python/​scripts/​run_tasks_in_changed_packages.py Replaces textual prefix stripping with native path-component handling.
.github/​workflows/​python-tests.yml Adds the focused routing tests to CI.

Review effort: Balanced

@github-actions github-actions Bot 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.

MAF Automated Review — Iteration 1

Result: No findings
Scope: full PR (1 commit(s)): fc70bc09dfba
Model: gpt-5.6-sol

Overview

The change replaces string-prefix handling with native Path component parsing, preserving POSIX literal backslashes while correctly routing native Windows and dot-prefixed repository paths. Focused cross-platform tests cover repository-relative, workspace-relative, absolute, UNC, and literal-backslash cases, and the dedicated workflow step runs them on both Linux and Windows. No supported Critical, High, or Medium defect remains after reconciling path semantics, callers, test coverage, workflow setup, and security boundaries.

Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
No publishable findings remained after source verification for this scope.

Merged via the queue into microsoft:main with commit f048cd3 Nov 2, 2026
56 checks passed
@eavanvalkenburg
Eduard van Valkenburg (eavanvalkenburg) deleted the repair-changed-package-paths branch November 2, 2026 12:55

This branch was previously deployed

1 inactive deployment
github-app-auth — fc70bc09 Deployed Nov 2, 2026 by eavanvalkenburg via team_check #8296
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: [Bug]: native Windows --files paths skip changed-package tasks

3 participants