Skip to content

feat: Add ListMigrationRepositories and ListUserMigrationRepositories - #4705

Open
10kartik wants to merge 1 commit into
google:masterfrom
10kartik:add-migration-repositories
Open

10kartik wants to merge 1 commit into
google:masterfrom
10kartik:add-migration-repositories

Conversation

@10kartik

@10kartik 10kartik commented Nov 7, 2026

Copy link
Copy Markdown

Adds two missing migration endpoints to MigrationService:

  • ListMigrationRepositories - GET /orgs/{org}/migrations/{migration_id}/repositories
  • ListUserMigrationRepositories - GET /user/migrations/{migration_id}/repositories

Both return []*Repository and take ListOptions. The Iter methods come from go generate.

I used Claude Code to help write this and reviewed every line myself.

🤖 Generated with Claude Code

@google-cla

google-cla Bot commented Nov 7, 2026

Copy link
Copy Markdown

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.

@10kartik
10kartik force-pushed the add-migration-repositories branch from de9fb34 to d68695f Compare November 7, 2026 05:01
@codecov

codecov Bot commented Nov 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.14815% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 98.64%. Comparing base (dac8c26) to head (d68695f).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
github/migrations_user.go 91.66% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread github/migrations.go
// 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) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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) {

t.Errorf("ListUserMigrationRepositories = %+v, want %+v", got, want)
}

const methodName = "ListUserMigrationRepositories"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use testBadOptions to increase test coverage.

Comment thread github/migrations_user.go
// 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) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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) {

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.

2 participants