-
Notifications
You must be signed in to change notification settings - Fork 127
ado2gh: Support GitHubProximaPipelines service connections for --rewire-pipelines #1454
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…2gh rewire-pipelines Co-authored-by: brianaj <[email protected]>
There was a problem hiding this 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 adds support for GitHub Enterprise Cloud with data residency service connections in the ado2gh generate-script --rewire-pipelines command. The tool now recognizes both standard GitHub and GitHubProximaPipelines service connection types, resolving the issue where pipeline rewiring failed for GitHub Enterprise Cloud with data residency configurations.
Key changes:
- Extended service connection type matching to include
GitHubProximaPipelinesin addition toGitHub - Added test coverage for the new service connection type
- Updated release notes to document the enhancement
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 | Modified GetTeamProjectGithubAppId to accept both GitHub and GitHubProximaPipelines service connection types using OR logic |
| src/OctoshiftCLI.Tests/Octoshift/Services/AdoApiTests.cs | Added test case GetGithubAppId_Should_Recognize_GitHubProximaPipelines_Service_Connection to verify the new service connection type is recognized |
| RELEASENOTES.md | Added user-friendly description of the new feature in the Unreleased section |
Unit Test Results 1 files 1 suites 10m 24s ⏱️ Results for commit 5eed024. ♻️ This comment has been updated with latest results. |
|
Hi @brianaj, the Getting this error for 2025-11-19 09:45:55] [INFO] Generating Script...
[2025-11-19 09:45:56] [WARNING] CANNOT FIND GITHUB APP SERVICE CONNECTION IN ADO ORGANIZATION: ericsoderqvist. You must install the Pipelines app in GitHub and connect it to any Team Project in this ADO Org firstSuccesfull for [2025-11-19 09:43:05] [INFO] Successfully rewired pipeline |
|
@brianaj Found the problem! When setting up the service connection, the service connection name defaults to the name of the ADO organization. In the code it checks if the name is equal to the name of the private async Task<string> GetTeamProjectGithubAppId(string org, string githubOrg, string teamProject)
{
var url = $"{_adoBaseUrl}/{org.EscapeDataString()}/{teamProject.EscapeDataString()}/_apis/serviceendpoint/endpoints?api-version=6.0-preview.4";
var response = await _client.GetWithPagingAsync(url);
var endpoint = response.FirstOrDefault(x =>
(((string)x["type"]).Equals("GitHub", StringComparison.OrdinalIgnoreCase) ||
((string)x["type"]).Equals("GitHubProximaPipelines", StringComparison.OrdinalIgnoreCase)) &&
((string)x["name"]).Equals(githubOrg, StringComparison.OrdinalIgnoreCase));
return endpoint != null ? (string)endpoint["id"] : null;
}I manually updated the service connection name to be equal to the name of my GitHub organization and then it worked :) Maybe that check should be updated or the default naming from Azure DevOps should be changed? However, now when I try to trigger the pipeline from GitHub it doesn't work. Maybe that is because I changed the service connection name? Or maybe I miss something? |
|
@EricSoder do you mind submitting the PR for review? I'm not fully understanding the issue here and can try to ping someone more familiar with the functionality to also review. |
|
@brianaj, if this is not for you to take on, please let me know who I should @ This issue is this line: ((string)x["name"]).Equals(githubOrg, StringComparison.OrdinalIgnoreCase));It checks wether the name of the service connection is the same as the name of the GitHub Organization where the Azure DevOps pipelines app is installed. When you install the Azure DevOps pipelines app and go through the setup flow, it by default creates a service connection with the same name as the team project in ADO. There is no way I can change the naming in the setup flow. Because of this, the If I afterwards change the service connection name to be the same as my GitHub organization, it breaks the connection between ADO and GitHub. Is this check necessary? If so, can the default naming from ADO be changed? |
|
@EricSoder unfortunately those more familiar with this code are no longer with the team. You can submit a PR so you can functionally test this and then we can go from there. The check was in place before my changes, hence why I didn't remove it. |
Description
The
ado2gh generate-script --rewire-pipelinescommand fails to recognize GitHub Enterprise Cloud with data residency service connections, which use typeGitHubProximaPipelinesinstead ofGitHub. This causes pipeline rewiring to fail despite valid service connections being configured.Changes
GetTeamProjectGithubAppIdto accept bothGitHubandGitHubProximaPipelinesservice connection typesBefore:
After:
Checklist
ThirdPartyNotices.txt(if applicable)Original prompt
ado2gh generate-script --rewire-pipelinesfor GitHub Enterprise cloud with data residency app #1453💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.