Repository navigation
refactor!: Add SetThreadSubscriptionRequest and SetRepositorySubscriptionRequest and pass them by value - #4707
Open
JamBalaya56562 wants to merge 1 commit into
Conversation
…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`.
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
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.
Updates #3644.
BREAKING CHANGE:
ActivityService.SetThreadSubscriptionnow takes aSetThreadSubscriptionRequestby value andActivityService.SetRepositorySubscriptionnow takes aSetRepositorySubscriptionRequestby value instead of*Subscription.Both methods passed the
Subscriptionresponse 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}/subscriptiononly acceptsignored, soSetThreadSubscriptionRequesthas onlyIgnored. Before, a caller could setSubscribed,Reason,CreatedAt, and the URL fields, which the operation does not accept.PUT /repos/{owner}/{repo}/subscriptionacceptssubscribedandignored, soSetRepositorySubscriptionRequesthasSubscribedandIgnored.Neither field is required, so they stay
*boolwithomitempty.Subscriptionis still the response type of both methods and is unchanged; it already has every property of thethread-subscriptionandrepository-subscriptionresponse schemas. The method names already match the GitHub docs operation names ("Set a thread subscription", "Set a repository subscription").Subscriptionis removed frombody-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.shincludingcustom-gcl, andscript/check-schema-fields.shreports nothing for these types. (It still reports the 4EnterpriseUpdateBudgetwarnings that master has since #4693; #4699 fixes them.) These changes were not exercised against the live GitHub API.