Skip to content

Conversation

@brianaj
Copy link
Collaborator

@brianaj brianaj commented Dec 4, 2025

  • 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)

Shipping #1458

Copilot AI review requested due to automatic review settings December 4, 2025 19:05
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a bug in the --rewire-pipelines functionality for Azure DevOps to GitHub migrations when using GitHub Enterprise Cloud with data residency. The issue was that GitHubProximaPipelines service connections were incorrectly being matched by GitHub organization name instead of team project name, unlike the standard GitHub service connections.

Key Changes:

  • Updated the service endpoint matching logic to properly differentiate between GitHub and GitHubProximaPipelines connection types
  • Modified GitHub connections to match by GitHub org name (unchanged behavior)
  • Modified GitHubProximaPipelines connections to match by team project name (corrected behavior)

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/Octoshift/Services/AdoApi.cs Refactored the endpoint matching logic to use separate AND conditions for each connection type, ensuring GitHubProximaPipelines matches by team project name
src/OctoshiftCLI.Tests/Octoshift/Services/AdoApiTests.cs Updated test data to use ADO_TEAM_PROJECT instead of GITHUB_ORG for the GitHubProximaPipelines connection type
RELEASENOTES.md Added user-friendly description of the bug fix for the upcoming release
Comments suppressed due to low confidence (1)

src/OctoshiftCLI.Tests/Octoshift/Services/AdoApiTests.cs:276

  • Consider adding a negative test case for GitHubProximaPipelines type that verifies null is returned when the team project name doesn't match. This would be analogous to the existing test GetGithubAppId_Should_Return_Null_When_No_Team_Projects_Have_Endpoint() which tests the negative case for the "GitHub" type with a wrong org name.

Example test: A GitHubProximaPipelines endpoint with name "wrongTeamProject" should return null when looking for ADO_TEAM_PROJECT.

    public async Task GetGithubAppId_Should_Recognize_GitHubProximaPipelines_Service_Connection()
    {
        var teamProjects = new List<string>() { ADO_TEAM_PROJECT };
        var appId = Guid.NewGuid().ToString();

        var json = new object[]
        {
            new
            {
                type = "GitHubProximaPipelines",
                name = ADO_TEAM_PROJECT,
                id = appId
            }
        };
        var response = JArray.Parse(json.ToJson());

        _mockAdoClient.Setup(x => x.GetWithPagingAsync($"https://dev.azure.com/{ADO_ORG.EscapeDataString()}/{ADO_TEAM_PROJECT.EscapeDataString()}/_apis/serviceendpoint/endpoints?api-version=6.0-preview.4").Result).Returns(response);

        var result = await sut.GetGithubAppId(ADO_ORG, GITHUB_ORG, teamProjects);

        result.Should().Be(appId);
    }

@brianaj brianaj changed the title Brianaj/external pr 1458 External PR 1458:Refine GitHub endpoint filtering logic Dec 4, 2025
@github-actions
Copy link

github-actions bot commented Dec 4, 2025

Unit Test Results

  1 files    1 suites   10m 25s ⏱️
960 tests 960 ✅ 0 💤 0 ❌
961 runs  961 ✅ 0 💤 0 ❌

Results for commit ccadb4b.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Dec 4, 2025

Code Coverage

Package Line Rate Branch Rate Complexity Health
ado2gh 72% 70% 712
Octoshift 83% 72% 1739
bbs2gh 83% 78% 663
gei 81% 72% 574
Summary 81% (7735 / 9601) 73% (1840 / 2521) 3688

Copy link
Collaborator

@begonaguereca begonaguereca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve updaing github enpoint logic

@brianaj brianaj merged commit eaa57c4 into main Dec 4, 2025
59 of 66 checks passed
@brianaj brianaj deleted the brianaj/external-pr-1458 branch December 4, 2025 20:24
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.

4 participants