Repository navigation
refactor!: Pass repository creation by value - #4616
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. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4616 +/- ##
==========================================
- Coverage 98.61% 98.61% -0.01%
==========================================
Files 199 199
Lines 18693 18664 -29
==========================================
- Hits 18435 18406 -29
Misses 258 258 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
gmlewis
left a comment
There was a problem hiding this comment.
Thank you, @kimjooyoon!
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.
JamBalaya56562
left a comment
There was a problem hiding this comment.
Thanks for this! A few things I found while checking it locally:
README.md(the "Creating and Updating Resources" section) still has the old example passing&github.Repository{...}toRepositories.Create; onlygithub/doc.gowas updated. With this PR that snippet no longer compiles:cannot use repo (variable of type *github.Repository) as github.CreateRepositoryRequest value.- Could you add a single-sentence
BREAKING CHANGE: ...line to the description? It gets copied into the git history and release notes. script/check-schema-fields.shreportsAllowUpdateBranchandAllowForkingas 2 new findings (not in the request body schema). Since they are kept on purpose, it may be worth recording them intools/schemafields/exceptions.txt. FWIW, I confirmed against the live API thatallow_update_branchsent on create is honored for bothPOST /user/reposandPOST /orgs/{org}/repos, so keeping it looks right.
|
Thanks @JamBalaya56562 — addressed all three points in
Validation: the README snippet compiles; |
JamBalaya56562
left a comment
There was a problem hiding this comment.
Thanks for the quick update — all three points look resolved. I re-checked locally: the README snippet now compiles against this branch, script/check-schema-fields.sh reports no new findings, and the new comment in exceptions.txt survives -write-exceptions. LGTM.
Nit (non-blocking): README.md and github/doc.go used to have identical text in "Creating and Updating Resources". The README wording was updated in 496d4a0, but doc.go still describes only repository creation ("When creating a repository, …") rather than resource/request structs in general, so syncing it with the README would fix both the mismatch and the narrower scope.
|
Thanks @JamBalaya56562 for the second review and the local checks! Synced the “Creating and Updating Resources” wording in
|
|
Thank you, @kimjooyoon and @JamBalaya56562! |
RepositoriesService.Createnow acceptsCreateRepositoryRequestby value, with a required stringNameand the existing optional fields. This separates creation input from theRepositoryresponse type. Callers now passCreateRepositoryRequest{Name: "repo"}.BREAKING CHANGE:
RepositoriesService.Createnow requires aCreateRepositoryRequestvalue instead of a*Repositoryargument.Updates user/org request tests, README and code examples, integration setup, and generated helpers. Towards #3644; scope coordinated here.
Validation:
script/generate.sh,script/fmt.sh,script/test.sh(all 12 modules, with race detection), andscript/lint.shpassed on Go 1.27.2. Integration tests compile with-tags=integration -run=^$; no live integration tests were run. The existingAllowUpdateBranchandAllowForkingfields are preserved and recorded as intentional schema-check exceptions; the pinned schemas produce no new findings.AI assistance: Codex helped with implementation, tests, review, and this description.