gh-gei icon indicating copy to clipboard operation
gh-gei copied to clipboard

gh ado2gh generate-script --all missing rewiring pipelines

Open georgy-gorelko opened this issue 4 months ago • 8 comments

After executing below script generation command I was anticipating to find steps of rewiring pipelines according to docs when all argument is supplied.

gh ado2gh generate-script --ado-org orgName --github-org GH_Org --output migration.ps1 --ado-team-project ADO_Project --all --verbose

I do see below steps but none specify pipelines rewiring.

  • gh ado2gh create-team
  • gh ado2gh lock-ado-repo
  • gh ado2gh migrate-repo
  • gh ado2gh wait-for-migration
  • gh ado2gh disable-ado-repo
  • gh ado2gh add-team-to-repo
  • gh ado2gh download-logs

georgy-gorelko avatar Jul 30 '25 23:07 georgy-gorelko

If there's nothing in the script it either didn't detect any pipelines that could be rewired, or it couldn't find a usable service connection. If it was the latter your script will contain the comment: # No GitHub App in this org, skipping the re-wiring of Azure Pipelines to GitHub repos

dylan-smith avatar Jul 30 '25 23:07 dylan-smith

@dylan-smith I do have multiple pipelines linked to migrated repos. I also see the comment No GitHub App in this org, skipping the re-wiring of Azure Pipelines to GitHub repos What for service connection?

georgy-gorelko avatar Jul 31 '25 17:07 georgy-gorelko

To be precise I do see --Service-Connection-ID as required when running gh-ado2gh rewire-pipeline command. But --Service-Connection-ID is not required/supplied when running generate script gh ado2gh generate-script --all which I think is the problem here

Image

georgy-gorelko avatar Aug 04 '25 18:08 georgy-gorelko

generate-script command will find an existing service connection from AzDO to a GitHub Pipelines App, and retrieve the service connection ID which it will place in the script. You are required to manually configure the service connection before running either generate-script or rewire-pipeline. Our docs are severely lacking in this area, but the fact that you are seeing that comment means that you need to perform this step.

The way I do it is manually configure a pipeline to point to a GitHub repo (using the GH app to configure the connection). This can be done in any ADO project, and GEI will "share" the service connection from that ADO project to any other project that needs it.

dylan-smith avatar Aug 05 '25 21:08 dylan-smith

I retried again with service connection being created and rewired to one of AzDO pipelines. Still seeing No GitHub App in this org, skipping the re-wiring of Azure Pipelines to GitHub repos

georgy-gorelko avatar Aug 06 '25 21:08 georgy-gorelko

Take a look at the verbose log file after you run the generate-script command. Look for API calls to URL's ending with: _apis/serviceendpoint/endpoints?api-version=6.0-preview.4

It's looking for a response where type == GitHub and name == your-github-org

It's not finding it. So I'd take a look at which ADO Project you think you have the service connection configured and compare with the results of that API call.

dylan-smith avatar Aug 10 '25 05:08 dylan-smith

Hi!

Notice the same issue here when working with a customer! Both the -all and the --rewire-pipelines options that should add the command inside the script forgot to add the line. Still the rest is OK. I found that just by adding the rewire-pipeline pipeline command manually in the script after the generation fixes the problem. This is the workaround we applied with the customer and it worked fine.

Here is the extract of the doc i provided that deal about it:

Notes on the rewire-pipelines option

During the tests that has been done, the --rewire-pipelines options was never added to the final script. As i still need to investigate this, here is a workaround to rewire the pipelines after the migration script has been run. Locate the integrate-board commands in the generated script and add a line to rewire the pipelines just after it.

Image
{ gh ado2gh rewire-pipeline --ado-org "philess-ghorg" --ado-team-project "XXX-on-ADO" --ado-pipeline "\MusicManager-ADO2GHEC" --github-org "ADOMigrate001" --github-repo "XXX-on-GitHub" --service-connection-id "XXXXX-XXX-XXX" }

Note that you should add one line per pipeline you want to rewire. The --service-connection-id is the ID of the service connection created by the GitHub Pipelines app when you linked it to a repo on the target org. You can find it in Azure DevOps under Project Settings > Service connections.

Philess avatar Sep 19 '25 07:09 Philess

@dylan-smith for visibility.

Philess avatar Oct 08 '25 15:10 Philess