Fix verify-links regex to handle repository URIs with .git suffix#13560
Fix verify-links regex to handle repository URIs with .git suffix#13560weshaggard merged 4 commits intomainfrom
Conversation
Co-authored-by: weshaggard <9010698+weshaggard@users.noreply.github.com>
| function Test-ReplaceGithubLink { | ||
| param( | ||
| [string]$originLink, | ||
| [string]$branchReplaceRegex, |
There was a problem hiding this comment.
@copilot default the shared regex here instead of duplicating it in all the tests.
There was a problem hiding this comment.
Done in commit 92bdf41. The shared regex pattern with optional .git suffix is now defined as $defaultRegex in the BeforeAll block and reused throughout the tests.
Co-authored-by: weshaggard <9010698+weshaggard@users.noreply.github.com>
|
/azp run azure-sdk-tools - sync - eng-common |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Co-authored-by: weshaggard <9010698+weshaggard@users.noreply.github.com>
|
/azp run azure-sdk-tools - sync - eng-common |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
The following pipelines have been queued for testing: |
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug in the verify-links pipeline where repository URIs ending with .git were not being handled correctly by the branch replacement regex pattern.
Changes:
- Updated the
BranchReplaceRegexpattern in verify-links.yml to handle optional.gitsuffix - Added comprehensive Pester tests to validate the fix for various scenarios
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| eng/common/pipelines/templates/steps/verify-links.yml | Updated regex pattern to make .git suffix optional using (?:\\.git)? |
| eng/common-tests/Verify-Links-ReplaceGithubLink.Tests.ps1 | Added comprehensive test suite covering scenarios with and without .git suffix |
Sync eng/common directory with azure-sdk-tools for PR Azure/azure-sdk-tools#13560 See [eng/common workflow](https://github.com/Azure/azure-sdk-tools/blob/main/eng/common/README.md#workflow) --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: weshaggard <9010698+weshaggard@users.noreply.github.com>
Sync eng/common directory with azure-sdk-tools for PR Azure/azure-sdk-tools#13560 See [eng/common workflow](https://github.com/Azure/azure-sdk-tools/blob/main/eng/common/README.md#workflow) --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: weshaggard <9010698+weshaggard@users.noreply.github.com>
Sync eng/common directory with azure-sdk-tools for PR Azure/azure-sdk-tools#13560 See [eng/common workflow](https://github.com/Azure/azure-sdk-tools/blob/main/eng/common/README.md#workflow) --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: weshaggard <9010698+weshaggard@users.noreply.github.com>
.gitsuffix in source repository URIs.gitsuffixOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.