[microsoft.azd.extensions] Fix azd x watch glob matching on Windows and enable CI tests#8278
Merged
JeffreyCA merged 2 commits intoMay 20, 2026
Merged
Conversation
shouldIgnoreWatchEvent was using doublestar.PathMatch, which splits patterns on the OS separator. On Windows that's '\\', so multi-segment patterns like `bin/**/*` could not match the forward-slashed relPath produced by filepath.ToSlash, defeating the hardcoded ignore fast-path. Switch to doublestar.Match (always splits on '/'), matching the convention already used for relPath and the hardcoded patterns. This is the library's documented recommendation when both inputs are forward-slashed. Fixes the two TestShouldIgnoreWatchEvent* tests that were failing on Windows.
JeffreyCA
requested review from
hemarina,
jongio,
rajeshkamal5050,
tg-msft,
vhvb1989,
wbreza and
weikanglim
as code owners
May 20, 2026 21:18
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes Windows-specific glob matching in azd x watch by aligning doublestar glob evaluation with the forward-sash (/) normalization already used for watcher event relative paths.
Changes:
- Replace
doublestar.PathMatchwithdoublestar.MatchinshouldIgnoreWatchEventto correctly match multi-segment patterns likebin/**/*on Windows. - Add an inline comment explaining why
Matchis required givenrelativeWatchPathreturns forward-slashed paths.
Remove SkipTests: true from the extension's release pipeline and add a ci-test.ps1 mirroring the script used by other extensions (e.g. azure.ai.agents). Without this, the TestShouldIgnoreWatchEvent* tests (and any future tests) never run in CI, so Windows-only regressions like the doublestar.PathMatch issue fixed in the preceding commit can slip through.
vhvb1989
approved these changes
May 20, 2026
hemarina
approved these changes
May 20, 2026
hemarina
left a comment
Contributor
There was a problem hiding this comment.
LGTM — no blocking or non-blocking issues found.
The Windows glob matching fix uses the correct doublestar API for forward-slashed relative paths, and the CI test enablement follows the existing extension pipeline pattern.
tg-msft
approved these changes
May 20, 2026
JeffreyCA
enabled auto-merge (squash)
May 20, 2026 22:23
Contributor
Author
|
/check-enforcer override |
Copilot AI
pushed a commit
that referenced
this pull request
May 21, 2026
…nd enable CI tests (#8278) * [microsoft.azd.extensions] Fix azd x watch glob matching on Windows shouldIgnoreWatchEvent was using doublestar.PathMatch, which splits patterns on the OS separator. On Windows that's '\\', so multi-segment patterns like `bin/**/*` could not match the forward-slashed relPath produced by filepath.ToSlash, defeating the hardcoded ignore fast-path. Switch to doublestar.Match (always splits on '/'), matching the convention already used for relPath and the hardcoded patterns. This is the library's documented recommendation when both inputs are forward-slashed. Fixes the two TestShouldIgnoreWatchEvent* tests that were failing on Windows. * [microsoft.azd.extensions] Enable unit tests in CI Remove SkipTests: true from the extension's release pipeline and add a ci-test.ps1 mirroring the script used by other extensions (e.g. azure.ai.agents). Without this, the TestShouldIgnoreWatchEvent* tests (and any future tests) never run in CI, so Windows-only regressions like the doublestar.PathMatch issue fixed in the preceding commit can slip through. Co-authored-by: therealjohn <1501196+therealjohn@users.noreply.github.com>
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.
Summary
Follow-up to #8273. Two related changes:
Fix glob matching on Windows. The hardcoded ignore fast-path in
shouldIgnoreWatchEventwas usingdoublestar.PathMatch, which splits patterns on the OS path separator. On Windows that separator is\, so multi-segment patterns likebin/**/*could never match the forward-slashedrelPathproduced byfilepath.ToSlash. Switched todoublestar.Match, which always splits on/and matches the convention already in use forrelPathand the hardcoded patterns. This is the library's documented recommendation when both inputs are forward-slashed.Enable unit tests in CI for
microsoft.azd.extensions. The pipeline hadSkipTests: trueand the extension was missingci-test.ps1. Without these, the existingTestShouldIgnoreWatchEvent*tests (and any future tests) never run in CI, so Windows-only regressions like (1) can slip through. Mirrors the setup used by other extensions (e.g.azure.ai.agents).User impact of the matching bug
In practice on Windows the broken matcher was largely dormant:
watchRecursiveskips ignored folders by directory name at any depth viafilepath.SkipDir, sobin/,obj/,build/,node_modules/, and.git/are never added to the watcher.shouldIgnoreWatchEvent.bin,*.spec,package-lock.json, ...) still matched correctly even with the OS-separator bug.The fix removes a latent footgun and makes the existing
TestShouldIgnoreWatchEvent*unit tests pass on Windows. Linux and macOS were unaffected.Verification