-
Notifications
You must be signed in to change notification settings - Fork 327
[plan] Migrate from gh CLI shell-outs to native go-gh API clients #5828
Copy link
Copy link
Closed
5 / 55 of 5 issues completedClosed
5 / 55 of 5 issues completed
Copy link
Labels
Description
Overview
This tracking issue covers the migration from shell-out gh.Exec() calls to native REST and GraphQL API clients provided by github.com/cli/go-gh/v2. This will improve performance (5-10x faster), simplify code, and follow upstream best practices.
Source: Discussion #5826 (Go Fan report on go-gh module usage)
Current State
The project uses gh.Exec() shell-outs for all GitHub API interactions across 4 files:
pkg/workflow/repository_features_validation.go- Repository feature detectionpkg/workflow/github_cli.go- Wrapper functionspkg/cli/exec.go- Conditional gh CLI usagepkg/parser/remote_fetch.go- Remote file downloads
Expected Benefits
- Performance: 5-10x faster (eliminates process spawning overhead)
- Code Quality: Type-safe API calls with automatic JSON handling
- Maintainability: Cleaner error handling and better testability
- Reliability: Built-in retry logic and caching support
Planned Tasks
This work is broken into focused, incremental tasks that can be completed independently:
- #aw_a1b2c3d4e5f6 - Replace
gh repo viewwithrepository.Current() - #aw_b2c3d4e5f6a7 - Migrate repository features to REST client
- #aw_c3d4e5f6a7b8 - Migrate GraphQL discussions check to native client
- #aw_d4e5f6a7b8c9 - Migrate remote file downloads to REST client
- #aw_e5f6a7b8c9d4 - Enable API caching and adopt pkg/auth
Success Criteria
- All
gh.Exec()calls replaced with native API clients - Performance benchmarks show 5-10x improvement
- All tests passing (unit + integration)
- Code simplified with better error handling
- API caching enabled for better performance
AI generated by Plan Command for discussion #5826
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type
Fields
Give feedbackNo fields configured for issues without a type.