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)

@offbyone offbyone changed the base branch from o1/golang-port/2 to main March 31, 2026 14:40
@offbyone offbyone changed the base branch from main to o1/golang-port/2 March 31, 2026 14:40
@offbyone offbyone force-pushed the o1/golang-port/2 branch 2 times, most recently from d99bbe1 to a2176e6 Compare April 16, 2026 17:01
@offbyone offbyone force-pushed the o1/golang-port/3 branch 2 times, most recently from 2301223 to bad2e82 Compare April 16, 2026 17:09
@offbyone offbyone force-pushed the o1/golang-port/2 branch 2 times, most recently from 2b6282d to 8d57f3a Compare April 16, 2026 17:11
@github-actions
Copy link
Copy Markdown

Code Coverage

Package Line Rate Branch Rate Complexity Health
gei 81% 73% 608
bbs2gh 83% 78% 667
Octoshift 83% 73% 1837
ado2gh 71% 69% 741
Summary 81% (7962 / 9881) 73% (1961 / 2681) 3853

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