Skip to content

Commit eaa57c4

Browse files
authored
Merge pull request #1466 from github/brianaj/external-pr-1458
External PR 1458:Refine GitHub endpoint filtering logic
2 parents c6cbbc5 + ccadb4b commit eaa57c4

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

RELEASENOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
- bbs2gh : Added validation for `--archive-path` and `--bbs-shared-home` options to fail fast with clear error messages if the provided paths do not exist or are not accessible. Archive path is now logged before upload operations to help with troubleshooting
2+
- ado2gh: Fixed `--rewire-pipelines` for GitHub Enterprise Cloud with data residency by correctly matching GitHubProximaPipelines service connections by team project name instead of GitHub organization name

src/Octoshift/Services/AdoApi.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,10 @@ private async Task<string> GetTeamProjectGithubAppId(string org, string githubOr
203203
var response = await _client.GetWithPagingAsync(url);
204204

205205
var endpoint = response.FirstOrDefault(x =>
206-
(((string)x["type"]).Equals("GitHub", StringComparison.OrdinalIgnoreCase) ||
207-
((string)x["type"]).Equals("GitHubProximaPipelines", StringComparison.OrdinalIgnoreCase)) &&
208-
((string)x["name"]).Equals(githubOrg, StringComparison.OrdinalIgnoreCase));
206+
(((string)x["type"]).Equals("GitHub", StringComparison.OrdinalIgnoreCase) &&
207+
((string)x["name"]).Equals(githubOrg, StringComparison.OrdinalIgnoreCase)) ||
208+
(((string)x["type"]).Equals("GitHubProximaPipelines", StringComparison.OrdinalIgnoreCase) &&
209+
((string)x["name"]).Equals(teamProject, StringComparison.OrdinalIgnoreCase)));
209210

210211
return endpoint != null ? (string)endpoint["id"] : null;
211212
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ public async Task GetGithubAppId_Should_Recognize_GitHubProximaPipelines_Service
262262
new
263263
{
264264
type = "GitHubProximaPipelines",
265-
name = GITHUB_ORG,
265+
name = ADO_TEAM_PROJECT,
266266
id = appId
267267
}
268268
};

0 commit comments

Comments
 (0)