Skip to content

Fix rewire-pipeline command to include target API URL and add unit test for sequential script rewire#1591

Merged
jfine merged 2 commits into
github:mainfrom
jessehouwing:fix/rewire-pipeline-ghecom
Jun 19, 2026
Merged

Fix rewire-pipeline command to include target API URL and add unit test for sequential script rewire#1591
jfine merged 2 commits into
github:mainfrom
jessehouwing:fix/rewire-pipeline-ghecom

Conversation

@jessehouwing

@jessehouwing jessehouwing commented Jun 19, 2026

Copy link
Copy Markdown
Contributor
  • Did you write/update appropriate tests
  • Release notes updated (if appropriate)
  • Appropriate logging output
  • Issue linked
  • Docs updated (or issue created)
  • New package licenses are added to ThirdPartyNotices.txt (if applicable)

This pull request addresses an important bug in the Azure DevOps to GitHub migration tooling, ensuring that the --target-api-url parameter is properly passed to generated rewire-pipeline commands. 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:

  • Fixed a bug where ado2gh generate-script did not pass --target-api-url to generated rewire-pipeline commands, preventing incorrect pipeline rewiring when migrating to GitHub Enterprise Cloud with data residency.

Implementation updates:

  • Updated the RewireAzurePipelineScript method in GenerateScriptCommandHandler.cs to include the targetApiUrl parameter, ensuring the generated script contains the correct API URL for rewired pipelines.
  • Modified both sequential and parallel script generation paths to pass targetApiUrl to the RewireAzurePipelineScript method, ensuring consistency for all migration modes. [1] [2]

Testing improvements:

  • Added a new test case SequentialScript_Rewire_Pipeline_With_TargetApiUrl_Includes_TargetApiUrl in GenerateScriptCommandHandlerTests.cs to verify that the generated script includes the --target-api-url parameter for rewired pipelines.

Fixes: #1590

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.

⚠️ 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 targetApiUrl into the rewire-pipeline command construction.
  • Added a new unit test covering the sequential script’s rewire-pipeline output when TargetApiUrl is 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.

@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown

Unit Test Results

    1 files      1 suites   25s ⏱️
1 112 tests 1 112 ✅ 0 💤 0 ❌
1 113 runs  1 113 ✅ 0 💤 0 ❌

Results for commit b3743f4.

♻️ This comment has been updated with latest results.

@jessehouwing

Copy link
Copy Markdown
Contributor Author

@jfine extra test pushed.

@jessehouwing jessehouwing requested a review from jfine June 19, 2026 15:16
@github-actions

Copy link
Copy Markdown

Code Coverage

Package Line Rate Branch Rate Complexity Health
gei 81% 73% 608
gl2gh 77% 70% 417
ado2gh 71% 70% 749
Octoshift 80% 70% 1974
bbs2gh 83% 78% 667
Summary 79% (8817 / 11179) 72% (2203 / 3081) 4415

@jfine jfine merged commit 029ac19 into github:main Jun 19, 2026
22 checks passed
@jfine

jfine commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

@jessehouwing this change was included in https://github.com/github/gh-gei/releases/tag/v1.30.2 thanks!

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.

ado2gh omits API url when generating script for ghe.com

3 participants