Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Oct 14, 2025

  • Analyze the issue and understand Azure DevOps URL structure
  • Add Azure DevOps URL pattern parsing to Repository::parseRemoteUrl()
  • Update Changelog to detect Azure DevOps and apply correct URL formats
  • Add tests for Azure DevOps URL parsing and formatting
  • Fix code style issues
  • Add host normalization for SSH URLs (ssh.dev.azure.com → dev.azure.com)
  • Add test for host normalization
  • Manually verify the changes work correctly
  • Add support for legacy Visual Studio Online URLs (visualstudio.com)
  • Add support for Visual Studio Online with collection paths
  • Add support for legacy Visual Studio SSH (vs-ssh.visualstudio.com)
  • Add support for on-premises Azure DevOps Server URLs

Summary

This PR fixes the Azure DevOps compare URL generation issue. The changes automatically detect Azure DevOps repositories and apply the correct URL formats for all Azure DevOps variants including modern, legacy, and on-premises deployments.

Before (incorrect):

https://ssh.dev.azure.com/v3/team/group/project/compare/v3.0.5...v3.0.6

After (correct):

https://dev.azure.com/team/group/_git/project/branchCompare?baseVersion=GTv3.0.5&targetVersion=GTv3.0.6

Supported Azure DevOps URL Patterns

The library now supports 6 different Azure DevOps URL patterns:

  1. Modern Azure DevOps HTTPS: https://dev.azure.com/{org}/{project}/_git/{repo}
  2. Modern Azure DevOps SSH: git@ssh.dev.azure.com:v3/{org}/{project}/{repo}
  3. Legacy Visual Studio HTTPS: https://{org}.visualstudio.com/{project}/_git/{repo}
  4. Legacy Visual Studio with Collection: https://{org}.visualstudio.com/{collection}/{project}/_git/{repo}
  5. Legacy Visual Studio SSH: {org}@vs-ssh.visualstudio.com:v3/{org}/{project}/{repo}
  6. On-premises Azure DevOps Server: https://{server}/{collection}/{project}/_git/{repo}

Key Changes

  • Added Azure DevOps URL patterns to Repository::parseRemoteUrl() to correctly extract organization, project, and repository for all Azure DevOps variants
  • Auto-detect Azure DevOps remotes (modern, legacy, and on-premises) and configure appropriate URL formats in Changelog constructor
  • Normalize SSH hosts (ssh.dev.azure.comdev.azure.com, vs-ssh.visualstudio.comvisualstudio.com) for web URLs
  • Handle different URL structures for visualstudio.com ({org}.{host} format) vs dev.azure.com ({host}/{org} format)
  • Support collection paths for legacy Visual Studio and on-premises Azure DevOps Server deployments
  • Added comprehensive tests for all patterns (14 tests, 50 assertions, all passing)

Fixes #81

Original prompt

This section details on the original issue you should resolve

<issue_title>Azure compare url</issue_title>
<issue_description>Hi,

my project use azure as a remote git repository. I see the changelog is generated by using following link

https://ssh.dev.azure.com/v3/#team#/#group#/#project#/compare/v3.0.5...v3.0.6

That url result in a 404 - Page not found

Right url should be

https://dev.azure.com/#team#/#group#/_git/#project#/branchCompare?baseVersion=GTv3.0.5&targetVersion=GTv3.0.6

Thank you</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #81


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@marcocesarato
Copy link
Owner

@copilot add others patterns if exists

Copy link
Contributor Author

Copilot AI commented Oct 14, 2025

@copilot add others patterns if exists

Added support for all Azure DevOps URL patterns:

  • Legacy Visual Studio Online (visualstudio.com) HTTPS and SSH
  • Visual Studio Online with collection paths (DefaultCollection)
  • On-premises Azure DevOps Server

All patterns tested and working correctly. Commit: d11e0ea → (latest)

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/BrainMaestro/composer-git-hooks/zipball/ffed8803690ac12214082120eee3441b00aa390e
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/ZcXgoE /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/d48755372a113bddb99f749e34805d83f3acfe04
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/ZcXgoE /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/composer/pcre/zipball/4bff79ddd77851fe3cdd11616ed3f92841ba5bd2
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/ZcXgoE /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/composer/semver/zipball/3953f23262f2bff1919fc82183ad9acb13ff62c9
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/ZcXgoE /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/composer/xdebug-handler/zipball/ced299686f41dce890debac69273b47ffe98a40c
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/ZcXgoE /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/doctrine/annotations/zipball/e157ef3f3124bbf6fe7ce0ffd109e8a8ef284e7f
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/ZcXgoE /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/doctrine/lexer/zipball/84a527db05647743d50373e0ec53a152f2cde568
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/ZcXgoE /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/ZcXgoE /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/ZcXgoE /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/ZcXgoE /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/php-fig/log/zipball/ef29f6d262798707a9edd554e2b82517ef3a9376
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/ZcXgoE /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/php-mock/php-mock/zipball/6f71999665d27fbdf684c1639981e96eff540b5f
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/ZcXgoE /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/ZcXgoE /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/ZcXgoE /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/ZcXgoE /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/ZcXgoE /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/symfony/console/zipball/ea59bb0edfaf9f28d18d8791410ee0355f317669
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/ZcXgoE /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/symfony/deprecation-contracts/zipball/e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/ZcXgoE /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/0ad3b6f1e4e2da5690fefe075cd53a238646d8dd
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/ZcXgoE /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/symfony/event-dispatcher/zipball/404b307de426c1c488e5afad64403e5f145e82a5
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/ZcXgoE /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/symfony/filesystem/zipball/82b6c62b959f642d000456f08c6d219d749215b3
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/ZcXgoE /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/symfony/finder/zipball/20808dc6631aecafbe67c186af5dcb370be3a0eb
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/ZcXgoE /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/symfony/options-resolver/zipball/aa0e85b53bbb2b4951960efd61d295907eacd629
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/ZcXgoE /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/ZcXgoE /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/511a08c03c1960e08a883f4cffcacd219b758354
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/ZcXgoE /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/19bd1e4fcd5b91116f14d8533c57831ed00571b6
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/ZcXgoE /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/ZcXgoE /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/symfony/polyfill-php73/zipball/9e8ecb5f92152187c4799efd3c96b78ccab18ff9
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/ZcXgoE /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/ZcXgoE /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/symfony/polyfill-php81/zipball/707403074c8ea6e2edaf8794b0157a0bfa52157a
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/ZcXgoE /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/symfony/process/zipball/680e8a2ea6b3f87aecc07a6a65a203ae573d1902
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/ZcXgoE /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/symfony/service-contracts/zipball/a8c9cedf55f314f3a186041d19537303766df09a
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/ZcXgoE /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/symfony/stopwatch/zipball/f3adc98c1061875dd2edcd45e5b04e63d0e29f8f
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/ZcXgoE /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/symfony/string/zipball/823f143370880efcbdfa2dbca946b3358c4707e5
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/ZcXgoE /usr/bin/composer install --no-interaction (http block)

If you need me to access, download, or install something from one of these locations, you can either:

@Copilot Copilot AI changed the title [WIP] Fix Azure compare URL for changelog access Fix Azure DevOps compare URL for changelog generation with support for all URL patterns Oct 14, 2025
Copilot finished work on behalf of marcocesarato October 14, 2025 18:58
@marcocesarato marcocesarato marked this pull request as ready for review October 14, 2025 19:00
@marcocesarato marcocesarato merged commit 9c7b5d1 into main Oct 14, 2025
3 of 4 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.

Azure compare url

2 participants