Add gl2gh GitLab adapter#1555
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a new gl2gh GitHub CLI extension for GitLab-to-GitHub migrations, adding a GitLab API/client implementation in shared Octoshift services and wiring the new extension into build, publish, docs, and CI/integration test flows.
Changes:
- Added
gl2ghextension project with commands for generating scripts, inventory reporting, and migrating repos (plus standard supporting commands). - Implemented GitLab API + HTTP client (
GitlabApi,GitlabClient) and added GitHub API support for GitLab migration sources/migrations. - Updated CI/e2e workflows, publishing scripts, and documentation/release notes to include
gl2gh.
Show a summary per file
| File | Description |
|---|---|
| src/OctoshiftCLI.Tests/OctoshiftCLI.Tests.csproj | References gl2gh project for unit test compilation. |
| src/OctoshiftCLI.Tests/Octoshift/Services/GitlabApiTests.cs | Adds unit coverage for GitLab version parsing/logging. |
| src/OctoshiftCLI.Tests/Octoshift/Services/GithubApiTests.cs | Adds coverage for GitLab migration GraphQL payload behavior. |
| src/OctoshiftCLI.Tests/gl2gh/Services/ProjectsCsvGeneratorServiceTests.cs | Tests projects.csv generation behavior for GitLab inventory report. |
| src/OctoshiftCLI.Tests/gl2gh/Services/GitlabInspectorServiceTests.cs | Tests GitLab inspection/caching behaviors. |
| src/OctoshiftCLI.Tests/gl2gh/Factories/GitlabApiFactoryTests.cs | Verifies factory creates API with correct HTTP client configuration. |
| src/OctoshiftCLI.Tests/gl2gh/Commands/WaitForMigration/WaitForMigrationCommandTests.cs | Ensures command options are wired correctly. |
| src/OctoshiftCLI.Tests/gl2gh/Commands/RevokeMigratorRole/RevokeMigratorRoleCommandTests.cs | Ensures command options are wired correctly. |
| src/OctoshiftCLI.Tests/gl2gh/Commands/ReclaimMannequin/ReclaimMannequinCommandTests.cs | Ensures command options are wired correctly. |
| src/OctoshiftCLI.Tests/gl2gh/Commands/MigrateRepo/MigrateRepoCommandTests.cs | Verifies option surface for migrate-repo. |
| src/OctoshiftCLI.Tests/gl2gh/Commands/MigrateRepo/MigrateRepoCommandHandlerTests.cs | Exercises migration handler flows (generate/upload/import/cleanup). |
| src/OctoshiftCLI.Tests/gl2gh/Commands/MigrateRepo/MigrateRepoCommandArgsTests.cs | Validates CLI argument combinations for migrate-repo. |
| src/OctoshiftCLI.Tests/gl2gh/Commands/InventoryReport/InventoryReportCommandTests.cs | Ensures inventory report command wiring/options. |
| src/OctoshiftCLI.Tests/gl2gh/Commands/InventoryReport/InventoryReportCommandHandlerTests.cs | Tests inventory report handler writes expected outputs. |
| src/OctoshiftCLI.Tests/gl2gh/Commands/GrantMigratorRole/GrantMigratorRoleCommandTests.cs | Ensures command options are wired correctly. |
| src/OctoshiftCLI.Tests/gl2gh/Commands/GenerateScript/GenerateScriptCommandTests.cs | Ensures generate-script command wiring/options. |
| src/OctoshiftCLI.Tests/gl2gh/Commands/GenerateScript/GenerateScriptCommandHandlerTests.cs | Validates script generation content/flags. |
| src/OctoshiftCLI.Tests/gl2gh/Commands/GenerateScript/GenerateScriptCommandArgsTests.cs | Validates argument validation rules for generate-script. |
| src/OctoshiftCLI.Tests/gl2gh/Commands/GenerateMannequinCsv/GenerateMannequinCsvCommandTests.cs | Ensures command options are wired correctly. |
| src/OctoshiftCLI.Tests/gl2gh/Commands/DownloadLogs/DownloadLogsCommandTests.cs | Verifies backward-compat alias behavior for API URL option. |
| src/OctoshiftCLI.Tests/gl2gh/Commands/CreateTeam/CreateTeamCommandTests.cs | Ensures command options are wired correctly. |
| src/OctoshiftCLI.Tests/gl2gh/Commands/AbortMigration/AbortMigrationCommandTests.cs | Ensures command options are wired correctly. |
| src/OctoshiftCLI.sln | Adds gl2gh project to the solution. |
| src/OctoshiftCLI.IntegrationTests/GitlabToGithub.cs | Adds GitLab-to-GitHub end-to-end integration test. |
| src/Octoshift/Services/GitlabClient.cs | Introduces HTTP client wrapper for GitLab API calls (pagination, retries, downloads). |
| src/Octoshift/Services/GitlabApi.cs | Adds GitLab API operations needed for export + inventory inspection. |
| src/Octoshift/Services/GithubClient.cs | Adds GraphQL feature flag needed for GitLab migration support. |
| src/Octoshift/Services/GithubApi.cs | Adds GitLab migration source + start-migration APIs. |
| src/Octoshift/Services/EnvironmentVariableProvider.cs | Adds GITLAB_PAT secret retrieval support. |
| src/Octoshift/Models/GitlabProject.cs | Adds shared GitLab project model used by inspection/reporting. |
| src/gl2gh/Services/ProjectsCsvGeneratorService.cs | Implements projects.csv generation for GitLab inventory report. |
| src/gl2gh/Services/GroupsCsvGeneratorService.cs | Implements groups.csv generation for GitLab inventory report. |
| src/gl2gh/Services/GitlabInspectorService.cs | Adds cached inspection layer over GitLab API (groups/projects/MR counts). |
| src/gl2gh/Program.cs | Adds extension entrypoint + DI setup + status/version checks. |
| src/gl2gh/gl2gh.csproj | New gl2gh CLI project definition. |
| src/gl2gh/Factories/GitlabInspectorServiceFactory.cs | Factory for inspector service creation/caching. |
| src/gl2gh/Factories/GitlabApiFactory.cs | Factory for creating authenticated GitLab API instances (SSL/no-SSL). |
| src/gl2gh/ExportState.cs | Defines export state helpers for GitLab export polling. |
| src/gl2gh/Commands/WaitForMigration/WaitForMigrationCommand.cs | Adds wait-for-migration command wrapper. |
| src/gl2gh/Commands/RevokeMigratorRole/RevokeMigratorRoleCommand.cs | Adds revoke-migrator-role command wrapper. |
| src/gl2gh/Commands/ReclaimMannequin/ReclaimMannequinCommand.cs | Adds reclaim-mannequin command wrapper. |
| src/gl2gh/Commands/MigrateRepo/MigrateRepoCommandHandler.cs | Implements GitLab export/download/upload/import orchestration. |
| src/gl2gh/Commands/MigrateRepo/MigrateRepoCommandArgs.cs | Defines args and validation rules for migrate-repo. |
| src/gl2gh/Commands/MigrateRepo/MigrateRepoCommand.cs | Defines the migrate-repo command/options and handler wiring. |
| src/gl2gh/Commands/InventoryReport/InventoryReportCommandHandler.cs | Implements inventory report generation flow for GitLab. |
| src/gl2gh/Commands/InventoryReport/InventoryReportCommandArgs.cs | Defines inventory report args. |
| src/gl2gh/Commands/InventoryReport/InventoryReportCommand.cs | Defines inventory-report command/options and handler wiring. |
| src/gl2gh/Commands/GrantMigratorRole/GrantMigratorRoleCommand.cs | Adds grant-migrator-role command wrapper. |
| src/gl2gh/Commands/GenerateScript/GenerateScriptCommandHandler.cs | Generates PowerShell migration script for GitLab migrations. |
| src/gl2gh/Commands/GenerateScript/GenerateScriptCommandArgs.cs | Defines args/validation for generate-script. |
| src/gl2gh/Commands/GenerateScript/GenerateScriptCommand.cs | Defines generate-script command/options and handler wiring. |
| src/gl2gh/Commands/GenerateMannequinCsv/GenerateMannequinCsvCommand.cs | Adds generate-mannequin-csv command wrapper. |
| src/gl2gh/Commands/DownloadLogs/DownloadLogsCommand.cs | Adds download-logs command wrapper + backward-compat alias. |
| src/gl2gh/Commands/CreateTeam/CreateTeamCommand.cs | Adds create-team command wrapper. |
| src/gl2gh/Commands/AbortMigration/AbortMigrationCommand.cs | Adds abort-migration command wrapper. |
| RELEASENOTES.md | Adds release note entry for gl2gh. |
| README.md | Documents gh gl2gh installation and basic usage. |
| publish.ps1 | Publishes gl2gh binaries for supported platforms. |
| justfile | Adds local run/watch/install helpers for gl2gh. |
| global.json | Updates pinned .NET SDK version. |
| .github/workflows/integration-tests.yml | Adds gl2gh to build artifacts and integration test matrix. |
| .github/workflows/CI.yml | Adds gl2gh to build artifacts and e2e test matrix. |
| .devcontainer/devcontainer.json | Adds .NET feature configuration for devcontainer. |
Copilot's findings
- Files reviewed: 63/63 changed files
- Comments generated: 7
jfine
approved these changes
May 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes https://github.ghe.com/github/octoshift/issues/12185!
Introduces
gl2gh, a new CLI extension for migrating from GitLab (gitlab.com or self-managed) to GitHub using the GEI APIs. Mirrors the structure and conventions of the existingado2gh/bbs2ghCLIs.What's included
gl2ghCLI with commands:inventory-report,generate-script,migrate-repo, plus the standard shared commands (wait-for-migration,grant-/revoke-migrator-role,reclaim-mannequin,create-team,download-logs,abort-migration,generate-mannequin-csv).GitlabApi+GitlabClientwith paginated group/project discovery, archive export polling, and a 429-aware retry policy honoringRetry-After.groups.csvandprojects.csvfor migration planning.Integration Test Results - Gitlab) running on Linux/Windows/macOS against three e2e orgs, and a release-publishing step targetinggithub/gh-gl2gh.gl2ghis flagged as not yet generally available.Other stuff
This PR only ships the adapter. The
github/gh-gl2ghextension repo and the SAML/feature-flag setup for the e2e orgs are tracked in the linked issue.ThirdPartyNotices.txt(if applicable)