Skip to content

refactor!: Rename RepositoryCreateForkOptions and RepositoryAddCollaboratorOptions to ...Request and pass them by value - #4607

Merged
gmlewis merged 2 commits into
google:masterfrom
JamBalaya56562:refactor/3644-repos-fork-collaborator-request-types
Oct 9, 2026
Merged

gmlewis merged 2 commits into
google:masterfrom
JamBalaya56562:refactor/3644-repos-fork-collaborator-request-types

Conversation

@JamBalaya56562

Copy link
Copy Markdown
Contributor

Updates #3644

This converts two RepositoriesService body types, removing 4 entries from the paramcheck exception lists in .golangci.yml (2 from body-allowed-pointer-types and 2 from body-allowed-wrong-names), plus the 4 structfield allowed-tag-types entries marked # TODO: Repositories that belong to them.

Old New Method
RepositoryCreateForkOptions CreateForkRequest CreateFork
RepositoryAddCollaboratorOptions AddCollaboratorRequest AddCollaborator

The first commit makes the fields pointers (Organization, Name and DefaultBranchOnly on the fork request; Permission on the collaborator request), which clears the four # TODO: Repositories entries in structfield's allowed-tag-types. All four properties are optional in the OpenAPI request schemas (neither schema has a required list, and both request bodies are themselves optional).

The method names already match the docs operations ("Create a fork", "Add a repository collaborator"), so no verb rename is needed.

BREAKING CHANGE: RepositoryCreateForkOptions and RepositoryAddCollaboratorOptions are renamed to CreateForkRequest and AddCollaboratorRequest; RepositoriesService.CreateFork and RepositoriesService.AddCollaborator now take them by value instead of by pointer; CreateForkRequest.Organization, CreateForkRequest.Name, CreateForkRequest.DefaultBranchOnly and AddCollaboratorRequest.Permission are now pointers.

@gmlewis gmlewis added NeedsReview PR is awaiting a review before merging. Breaking API Change PR will require a bump to the major version num in next release. Look here to see the change(s). labels Oct 7, 2026
@codecov

codecov Bot commented Oct 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.61%. Comparing base (b1a37cf) to head (36f2650).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4607   +/-   ##
=======================================
  Coverage   98.61%   98.61%           
=======================================
  Files         199      199           
  Lines       18675    18675           
=======================================
  Hits        18417    18417           
  Misses        258      258           

☔ 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.

@gmlewis gmlewis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you, @JamBalaya56562!
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.

cc: @stevehipwell - @Not-Dhananjay-Mishra

@Not-Dhananjay-Mishra Not-Dhananjay-Mishra left a comment

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.

LGTM

@gmlewis gmlewis removed the NeedsReview PR is awaiting a review before merging. label Oct 9, 2026
@gmlewis

gmlewis commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

Thank you, @Not-Dhananjay-Mishra!
Merging.

@gmlewis
gmlewis merged commit 40091e2 into google:master Oct 9, 2026
15 checks passed
@JamBalaya56562
JamBalaya56562 deleted the refactor/3644-repos-fork-collaborator-request-types branch October 9, 2026 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Breaking API Change PR will require a bump to the major version num in next release. Look here to see the change(s).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants