Skip to content

refactor!: Add SetThreadSubscriptionRequest and SetRepositorySubscriptionRequest and pass them by value - #4707

Open
JamBalaya56562 wants to merge 1 commit into
google:masterfrom
JamBalaya56562:refactor/3644-subscription-request-types
Open

JamBalaya56562 wants to merge 1 commit into
google:masterfrom
JamBalaya56562:refactor/3644-subscription-request-types

Conversation

@JamBalaya56562

Copy link
Copy Markdown
Contributor

Updates #3644.

BREAKING CHANGE: ActivityService.SetThreadSubscription now takes a SetThreadSubscriptionRequest by value and ActivityService.SetRepositorySubscription now takes a SetRepositorySubscriptionRequest by value instead of *Subscription.

Both methods passed the Subscription response type as the request body. The two operations have different request schemas, so each method now has its own request type:

  • PUT /notifications/threads/{thread_id}/subscription only accepts ignored, so SetThreadSubscriptionRequest has only Ignored. Before, a caller could set Subscribed, Reason, CreatedAt, and the URL fields, which the operation does not accept.
  • PUT /repos/{owner}/{repo}/subscription accepts subscribed and ignored, so SetRepositorySubscriptionRequest has Subscribed and Ignored.

Neither field is required, so they stay *bool with omitempty. Subscription is still the response type of both methods and is unchanged; it already has every property of the thread-subscription and repository-subscription response schemas. The method names already match the GitHub docs operation names ("Set a thread subscription", "Set a repository subscription"). Subscription is removed from body-allowed-pointer-types.

Verified locally: go build ./..., go vet -tags integration ./test/integration/, script/test.sh -covermode atomic ./... (all modules, without -race), script/generate.sh --check, script/lint.sh including custom-gcl, and script/check-schema-fields.sh reports nothing for these types. (It still reports the 4 EnterpriseUpdateBudget warnings that master has since #4693; #4699 fixes them.) These changes were not exercised against the live GitHub API.

…riptionRequest` and pass them by value

BREAKING CHANGE: `ActivityService.SetThreadSubscription` now takes a `SetThreadSubscriptionRequest` by value and `ActivityService.SetRepositorySubscription` now takes a `SetRepositorySubscriptionRequest` by value instead of `*Subscription`.
@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 Nov 7, 2026
@codecov

codecov Bot commented Nov 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.64%. Comparing base (f379dfc) to head (fbda0d2).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4707   +/-   ##
=======================================
  Coverage   98.64%   98.64%           
=======================================
  Files         204      204           
  Lines       19080    19080           
=======================================
  Hits        18822    18822           
  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.

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.

2 participants