Skip to content

refactor!: Rename PullRequestReviewDismissalRequest to PullRequestDismissReviewRequest, add PullRequestSubmitReviewRequest, and pass review request bodies by value#4406

Open
JamBalaya56562 wants to merge 4 commits into
google:masterfrom
JamBalaya56562:refactor/3644-dismiss-review-value-params
Open

Conversation

@JamBalaya56562

@JamBalaya56562 JamBalaya56562 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Continues the request-body-by-value work in #3644, for the review dismissal and submission endpoints on PullRequestsService.

Dismiss a review

  • message is required, so Message becomes a non-pointer string (no omitempty), and DismissReview takes the body by value. The type is removed from the body-allowed-pointer-types allowlist.
  • Per review: the type is renamed to PullRequestDismissReviewRequest to match the method name, and the previously unmodeled optional event parameter is added as Event *string.

Submit a review

Per review, SubmitReview no longer reuses *PullRequestReviewRequest — whose node_id, commit_id and comments fields aren't part of the submit-a-review schema — and instead takes a new PullRequestSubmitReviewRequest by value, modeling that schema exactly: Event is required (non-pointer string), Body is optional (*string). CreateReview keeps the shared PullRequestReviewRequest, so its allowlist entry remains.

Verified with go build ./..., go vet -tags integration ./test/integration/, gofmt, the full ./github/ test suite, and custom-gcl (no paramcheck findings).

Updates #3644

BREAKING CHANGE: PullRequestReviewDismissalRequest is renamed to PullRequestDismissReviewRequest with non-pointer Message; PullRequestsService.DismissReview takes it by value; PullRequestsService.SubmitReview now takes a new PullRequestSubmitReviewRequest (non-pointer Event) by value instead of *PullRequestReviewRequest.

cc @jvm986 — flagging for #3644 coordination; this is in the pulls service, so it shouldn't overlap with the Issues work.

message is required by the dismiss-a-review endpoint, so `Message` becomes a
non-pointer string without omitempty, and `PullRequestsService.DismissReview`
now takes the request body by value. The type is removed from the
.golangci.yml allowlist.

BREAKING CHANGE: PullRequestReviewDismissalRequest.Message is now a non-pointer string, and PullRequestsService.DismissReview now takes the request body by value.
@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 Jul 24, 2026
@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.52%. Comparing base (5484f0d) to head (8383de1).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4406   +/-   ##
=======================================
  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.
📢 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 - @alexandear - @Not-Dhananjay-Mishra

@alexandear alexandear 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.

Let's also fix the body in PullRequestsService.SubmitReview.

Comment thread github/pulls_reviews.go Outdated
Comment thread github/pulls_reviews.go
…DismissReviewRequest`

Aligns the request type name with the PullRequestsService.DismissReview
method name, as suggested in review.
The dismiss-a-review endpoint accepts an optional event parameter
(can be "DISMISS") that was missing from the Go struct.
…uestSubmitReviewRequest`

SubmitReview reused *PullRequestReviewRequest, whose node_id, commit_id and
comments fields are not part of the submit-a-review request schema. The new
PullRequestSubmitReviewRequest models that schema exactly: event is required
and becomes a non-pointer string, body stays optional.

CreateReview keeps the shared PullRequestReviewRequest, so its allowlist
entry remains.
@JamBalaya56562 JamBalaya56562 changed the title refactor!: Pass PullRequestReviewDismissalRequest by value refactor!: Rename PullRequestReviewDismissalRequest to PullRequestDismissReviewRequest, add PullRequestSubmitReviewRequest, and pass review request bodies by value Jul 24, 2026
@JamBalaya56562

Copy link
Copy Markdown
Contributor Author

Let's also fix the body in PullRequestsService.SubmitReview.

Done in 8383de1. Rather than passing the shared PullRequestReviewRequest by value, SubmitReview now takes a new PullRequestSubmitReviewRequest — the submit-a-review schema only has body (optional) and event (required), so the shared type's node_id/commit_id/comments don't belong there. Event is a non-pointer string accordingly. CreateReview keeps the shared type, so its allowlist entry remains.

PR title and description updated to cover all three changes.

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). NeedsReview PR is awaiting a review before merging.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants