Repository navigation
feat: Add ListRepositories and ListUserRepositories to MigrationService - #4705
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
de9fb34 to
d68695f
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4705 +/- ##
==========================================
- Coverage 98.64% 98.64% -0.01%
==========================================
Files 204 204
Lines 19080 19134 +54
==========================================
+ Hits 18822 18875 +53
- Misses 258 259 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| // GitHub API docs: https://docs.github.com/rest/migrations/orgs?apiVersion=2022-11-28#list-repositories-in-an-organization-migration | ||
| // | ||
| //meta:operation GET /orgs/{org}/migrations/{migration_id}/repositories | ||
| func (s *MigrationService) ListMigrationRepositories(ctx context.Context, org string, id int64, opts *ListOptions) ([]*Repository, *Response, error) { |
There was a problem hiding this comment.
| func (s *MigrationService) ListMigrationRepositories(ctx context.Context, org string, id int64, opts *ListOptions) ([]*Repository, *Response, error) { | |
| func (s *MigrationService) ListRepositories(ctx context.Context, org string, migrationID int64, opts *ListOptions) ([]*Repository, *Response, error) { |
There was a problem hiding this comment.
done in 232bad6, also renamed id to migrationID
| t.Errorf("ListUserMigrationRepositories = %+v, want %+v", got, want) | ||
| } | ||
|
|
||
| const methodName = "ListUserMigrationRepositories" |
There was a problem hiding this comment.
Use testBadOptions to increase test coverage.
There was a problem hiding this comment.
the user one only takes the migration id (an int64), so there is no string that can make the URL bad and addOptions never errors there. testBadOptions would always get nil and fail, which is also why ListUserMigrations doesn't have one. the org version covers it through org.
| // GitHub API docs: https://docs.github.com/rest/migrations/users?apiVersion=2022-11-28#list-repositories-for-a-user-migration | ||
| // | ||
| //meta:operation GET /user/migrations/{migration_id}/repositories | ||
| func (s *MigrationService) ListUserMigrationRepositories(ctx context.Context, id int64, opts *ListOptions) ([]*Repository, *Response, error) { |
There was a problem hiding this comment.
| func (s *MigrationService) ListUserMigrationRepositories(ctx context.Context, id int64, opts *ListOptions) ([]*Repository, *Response, error) { | |
| func (s *MigrationService) ListUserRepositories(ctx context.Context, migrationID int64, opts *ListOptions) ([]*Repository, *Response, error) { |
gmlewis
left a comment
There was a problem hiding this comment.
Thank you, @10kartik and @Not-Dhananjay-Mishra!
LGTM.
Merging.
Adds two missing migration endpoints to
MigrationService:ListRepositories-GET /orgs/{org}/migrations/{migration_id}/repositoriesListUserRepositories-GET /user/migrations/{migration_id}/repositoriesBoth return
[]*Repositoryand takeListOptions. TheItermethods come fromgo generate.I used Claude Code to help write this and reviewed every line myself.
🤖 Generated with Claude Code