Skip to content

Match Azure exclusions against decoded repository URLs - #573

Merged
mickgmdb merged 1 commit into
mongodb:mainfrom
RaphaelFakhri:fix/azure-exclude-percent-encoded-urls
Nov 5, 2026
Merged

mickgmdb merged 1 commit into
mongodb:mainfrom
RaphaelFakhri:fix/azure-exclude-percent-encoded-urls

Conversation

@RaphaelFakhri

Copy link
Copy Markdown
Contributor

Summary

--azure-exclude never matches an Azure DevOps repository whose project or repository name contains a space or another character that needs URL encoding. The Azure API returns remoteUrl percent-encoded, for example https://dev.azure.com/org/My%20Project/_git/My%20Repo. parse_repo_identifier_from_url keeps the encoded segments, so the repository identifier becomes org/my%20project/my%20repo. An exclusion written as documented, org/My Project/My Repo, normalizes to org/my project/my repo, so the repository is still scanned.

This change percent-decodes the URL path segments before building the identifier. Exclusions given as plain names, globs, or full remote URLs now all match. Names without encoded characters produce the same identifiers as before.

Fixes #572

Test plan

  • New unit test azure::tests::exclude_matcher_matches_percent_encoded_remote_urls covers an exact exclusion, a glob, and the full remote URL. Without the change it fails on the exact-exclusion assertion.
  • cargo test -p kingfisher-bin --lib -- azure:: (25 passed)
  • cargo clippy -p kingfisher-bin --lib --tests -- -D warnings
  • cargo fmt --check

Copilot AI balanced review requested due to automatic review settings November 4, 2026 02:06

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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@mickgmdb
mickgmdb merged commit d1f860e into mongodb:main Nov 5, 2026
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] --azure-exclude does not match repositories with spaces in the project or repository name

3 participants