From b643eb0ede62057e1c21658b9eaa56c91bbdfaeb Mon Sep 17 00:00:00 2001 From: Leo Belanger Date: Fri, 20 Jun 2025 17:24:40 -0400 Subject: [PATCH 1/4] feat: add support for new options --- github/migrations.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/github/migrations.go b/github/migrations.go index 766c4c38e1c..85e62c9d486 100644 --- a/github/migrations.go +++ b/github/migrations.go @@ -55,6 +55,14 @@ type MigrationOptions struct { // ExcludeAttachments indicates whether attachments should be excluded from // the migration (to reduce migration archive file size). ExcludeAttachments bool + + // ExcludeReleases Indicates whether releases should be excluded from + // the migration (to reduce migration archive file size). + ExcludeReleases bool + + // Exclude related items from being returned in the response in order + // to improve performance of the request. Supported values are: "repositories" + Exclude []string } // startMigration represents the body of a StartMigration request. @@ -69,6 +77,14 @@ type startMigration struct { // ExcludeAttachments indicates whether attachments should be excluded from // the migration (to reduce migration archive file size). ExcludeAttachments *bool `json:"exclude_attachments,omitempty"` + + // ExcludeReleases Indicates whether releases should be excluded from + // the migration (to reduce migration archive file size). + ExcludeReleases *bool `json:"exclude_releases,omitempty"` + + // Exclude related items from being returned in the response in order + // to improve performance of the request. Supported values are: "repositories" + Exclude []string `json:"exclude,omitempty"` } // StartMigration starts the generation of a migration archive. @@ -84,6 +100,8 @@ func (s *MigrationService) StartMigration(ctx context.Context, org string, repos if opts != nil { body.LockRepositories = Ptr(opts.LockRepositories) body.ExcludeAttachments = Ptr(opts.ExcludeAttachments) + body.ExcludeReleases = Ptr(opts.ExcludeReleases) + body.Exclude = append(body.Exclude, opts.Exclude...) } req, err := s.client.NewRequest("POST", u, body) From c5d382258cf75819e26bb7a046a4cfcd75b6f7f1 Mon Sep 17 00:00:00 2001 From: Leo Belanger Date: Thu, 26 Jun 2025 18:28:14 -0400 Subject: [PATCH 2/4] test: add new options --- github/migrations_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/github/migrations_test.go b/github/migrations_test.go index 99604f62d7c..ec187255fd7 100644 --- a/github/migrations_test.go +++ b/github/migrations_test.go @@ -30,6 +30,8 @@ func TestMigrationService_StartMigration(t *testing.T) { opt := &MigrationOptions{ LockRepositories: true, ExcludeAttachments: false, + ExcludeReleases: true, + Exclude: []string{"repositories"}, } ctx := context.Background() got, _, err := client.Migrations.StartMigration(ctx, "o", []string{"r"}, opt) From 11d5d43c8cf7b9e464c07455da27aa03ed91ff12 Mon Sep 17 00:00:00 2001 From: Leo Belanger Date: Thu, 26 Jun 2025 20:25:30 -0400 Subject: [PATCH 3/4] chore: wording --- github/migrations.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/github/migrations.go b/github/migrations.go index 85e62c9d486..8c9c204451b 100644 --- a/github/migrations.go +++ b/github/migrations.go @@ -56,11 +56,11 @@ type MigrationOptions struct { // the migration (to reduce migration archive file size). ExcludeAttachments bool - // ExcludeReleases Indicates whether releases should be excluded from + // ExcludeReleases indicates whether releases should be excluded from // the migration (to reduce migration archive file size). ExcludeReleases bool - // Exclude related items from being returned in the response in order + // Exclude is a slice of related items to exclude from the response in order // to improve performance of the request. Supported values are: "repositories" Exclude []string } @@ -78,7 +78,7 @@ type startMigration struct { // the migration (to reduce migration archive file size). ExcludeAttachments *bool `json:"exclude_attachments,omitempty"` - // ExcludeReleases Indicates whether releases should be excluded from + // ExcludeReleases indicates whether releases should be excluded from // the migration (to reduce migration archive file size). ExcludeReleases *bool `json:"exclude_releases,omitempty"` From b8d629ec240405b5614890c6873ee3b2f08e62b8 Mon Sep 17 00:00:00 2001 From: Leo Belanger Date: Thu, 26 Jun 2025 20:26:26 -0400 Subject: [PATCH 4/4] chore: more wording --- github/migrations.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github/migrations.go b/github/migrations.go index 8c9c204451b..6d0948fba2a 100644 --- a/github/migrations.go +++ b/github/migrations.go @@ -82,7 +82,7 @@ type startMigration struct { // the migration (to reduce migration archive file size). ExcludeReleases *bool `json:"exclude_releases,omitempty"` - // Exclude related items from being returned in the response in order + // Exclude is a slice of related items to exclude from the response in order // to improve performance of the request. Supported values are: "repositories" Exclude []string `json:"exclude,omitempty"` }