Skip to content

Phase 3: GitHub API client + all shared commands (Go port)#1533

Draft
offbyone wants to merge 1 commit intoo1/golang-port/2from
o1/golang-port/3
Draft

Phase 3: GitHub API client + all shared commands (Go port)#1533
offbyone wants to merge 1 commit intoo1/golang-port/2from
o1/golang-port/3

Conversation

@offbyone
Copy link
Copy Markdown
Contributor

@offbyone offbyone commented Mar 31, 2026

Implements the core GitHub API client and all shared gei subcommands.

  • Custom GraphQL client with pagination and secondary rate limit detection/retry

  • 32+ migration API methods via google/go-github REST client

  • UserError type, flag validators, migration status constants in internal/cmdutil/

  • Shared commands: wait-for-migration, abort-migration, download-logs, grant/revoke-migrator-role, create-team, generate-mannequin-csv, reclaim-mannequin

  • Supporting packages: pkg/download/, pkg/mannequin/, pkg/version/, pkg/status/

  • 170+ tests across all packages, all passing with -race

  • golangci-lint v2 configured, 0 issues

  • Did you write/update appropriate tests

  • Release notes updated (if appropriate) — not user-facing yet (parallel Go port)

  • Appropriate logging output

  • Issue linked — tracking via PR stack

  • Docs updated (or issue created)

  • New package licenses are added to ThirdPartyNotices.txt (if applicable)


PR Stack (Go port)

This PR implements the core GitHub API client and all shared gei
subcommands in Go, building on the project skeleton (PR 1) and
HTTP/auth foundation (PR 2).

## GitHub API client (pkg/github/)

- Custom GraphQL client with pagination, secondary rate limit
  detection and retry, and navigateJSON() dot-path traversal
- 32+ migration API methods via google/go-github REST client:
  organization, repository, team, mannequin, migration lifecycle
- Comprehensive models (models.go) for all API response types

## Shared command infrastructure (internal/cmdutil/)

- UserError type for user-friendly error messages
- Flag validators: ValidatePaired, ValidateAtLeastOne, ValidateExactlyOne
- Migration status constants and classifier (pkg/migration/)

## Commands (cmd/gei/)

- wait-for-migration: poll migration status with configurable interval
- abort-migration: cancel in-progress migrations
- download-logs: fetch and save migration log archives
- grant-migrator-role / revoke-migrator-role: manage migration permissions
- create-team: create GitHub teams with idempotent slug handling
- generate-mannequin-csv: export mannequin data to CSV
- reclaim-mannequin: reclaim mannequins from CSV or individual args

## Supporting packages

- pkg/download/: migration log download service with temp file cleanup
- pkg/mannequin/: mannequin reclamation service with CSV parsing
- pkg/version/: version checker against GitHub releases
- pkg/status/: GitHub status page availability check

## Testing

- 170+ tests across all packages, all passing with -race
- External test package convention (package foo_test)
- httptest-based test servers for API client tests

## Tooling

- golangci-lint v2 configured, 0 issues
- Go 1.25.4 added to mise.toml alongside dotnet 8.0.410
- Go binary names added to .gitignore
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.

1 participant