Fix rewire-pipeline command to include target API URL and add unit test for sequential script rewire#1591
Conversation
…st for sequential script rewire
There was a problem hiding this comment.
⚠️ Not ready to approve
The parallel script path was changed to include --target-api-url for rewire-pipeline but lacks corresponding unit test coverage to prevent regressions.
Pull request overview
This PR fixes ado2gh generate-script so that generated rewire-pipeline commands include --target-api-url, ensuring pipeline rewiring targets the intended GitHub Enterprise Cloud (ghe.com/data residency) API endpoint rather than defaulting to github.com.
Changes:
- Updated sequential and parallel script generation to pass
targetApiUrlinto therewire-pipelinecommand construction. - Added a new unit test covering the sequential script’s
rewire-pipelineoutput whenTargetApiUrlis provided. - Added a release note entry describing the bug fix and its impact.
File summaries
| File | Description |
|---|---|
| src/ado2gh/Commands/GenerateScript/GenerateScriptCommandHandler.cs | Threads targetApiUrl through to generated rewire-pipeline commands in both sequential and parallel script paths. |
| src/OctoshiftCLI.Tests/ado2gh/Commands/GenerateScript/GenerateScriptCommandHandlerTests.cs | Adds a sequential-mode test asserting --target-api-url is included for rewire-pipeline output. |
| RELEASENOTES.md | Documents the user-facing bug fix in the unreleased notes. |
Copilot's findings
- Files reviewed: 3/3 changed files
- Comments generated: 1
Note
Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.
Unit Test Results 1 files 1 suites 25s ⏱️ Results for commit b3743f4. ♻️ This comment has been updated with latest results. |
|
@jfine extra test pushed. |
|
@jessehouwing this change was included in https://github.com/github/gh-gei/releases/tag/v1.30.2 thanks! |
ThirdPartyNotices.txt(if applicable)This pull request addresses an important bug in the Azure DevOps to GitHub migration tooling, ensuring that the
--target-api-urlparameter is properly passed to generatedrewire-pipelinecommands. This is especially critical for migrations to GitHub Enterprise Cloud instances with data residency requirements. The changes also include updates to the test suite to validate this behavior.Bug fix and feature correctness:
ado2gh generate-scriptdid not pass--target-api-urlto generatedrewire-pipelinecommands, preventing incorrect pipeline rewiring when migrating to GitHub Enterprise Cloud with data residency.Implementation updates:
RewireAzurePipelineScriptmethod inGenerateScriptCommandHandler.csto include thetargetApiUrlparameter, ensuring the generated script contains the correct API URL for rewired pipelines.targetApiUrlto theRewireAzurePipelineScriptmethod, ensuring consistency for all migration modes. [1] [2]Testing improvements:
SequentialScript_Rewire_Pipeline_With_TargetApiUrl_Includes_TargetApiUrlinGenerateScriptCommandHandlerTests.csto verify that the generated script includes the--target-api-urlparameter for rewired pipelines.Fixes: #1590