refactor!: Rename AutolinkOptions to CreateAutolinkRequest, AddAutolink to CreateAutolink, and pass the body by value#4399
Merged
gmlewis merged 1 commit intoJul 21, 2026
Conversation
…utolink` to `CreateAutolink`, and pass the body by value Rename the request type to follow the `...Request` convention for request bodies, and align the method verb with the GitHub API docs operation name "Create an autolink reference for a repository". key_prefix and url_template are required by the API, so they become non-pointer strings without omitempty; is_alphanumeric stays optional. Both `AutolinkOptions` entries are removed from the .golangci.yml allowlists. BREAKING CHANGE: AutolinkOptions is renamed to CreateAutolinkRequest with non-pointer KeyPrefix and URLTemplate; RepositoriesService.AddAutolink is renamed to CreateAutolink and now takes the request body by value.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4399 +/- ##
=======================================
Coverage 97.52% 97.52%
=======================================
Files 193 193
Lines 19668 19668
=======================================
Hits 19182 19182
Misses 268 268
Partials 218 218 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
gmlewis
approved these changes
Jul 21, 2026
gmlewis
left a comment
Collaborator
There was a problem hiding this comment.
Thank you, @JamBalaya56562!
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.
alexandear
approved these changes
Jul 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Continues the request-body-by-value work in #3644, this time for
RepositoriesService.AddAutolink.What changed
AutolinkOptionsis renamed toCreateAutolinkRequest, following the...Requestconvention for request bodies. The old name was in thebody-allowed-wrong-namesallowlist.AddAutolinkis renamed toCreateAutolinkto match the docs operation name, Create an autolink reference for a repository. The doc comment already read "creates an autolink reference".AutolinkOptionsentries are removed from the.golangci.ymlallowlists.key_prefixandurl_templateare required by the API, soKeyPrefixandURLTemplatebecome non-pointerstringwithoutomitempty.is_alphanumericis optional (it defaults totrue), soIsAlphanumericstays*bool.Notes
Autolinkis a separate struct and is unchanged — this is a request-only type, so there is no create/update split to consider.test/integration/repos_test.gobuilds under the root module with-tags integration, so it is updated too. Its comparison needed a small fix rather than a mechanical rename: it comparedactionlink.KeyPrefix(*string) against the request field, which is now astring, so it goes throughGetKeyPrefix()/GetURLTemplate()instead.Verified with
go build ./...,go vet -tags integration ./test/integration/,gofmt, the full./github/test suite (CreateAutolinkand the regenerated accessors at 100%), andcustom-gcl(noparamcheckfindings after removing the allowlist entries).Updates #3644
BREAKING CHANGE: AutolinkOptions is renamed to CreateAutolinkRequest with non-pointer KeyPrefix and URLTemplate; RepositoriesService.AddAutolink is renamed to CreateAutolink and now takes the request body by value.
cc @jvm986 — flagging for #3644 coordination; this one is in the
reposservice, so it shouldn't overlap with theIssueswork.