-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add 'mark thread as done' functionality #3265
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3265 +/- ##
==========================================
- Coverage 97.72% 92.94% -4.78%
==========================================
Files 153 171 +18
Lines 13390 11669 -1721
==========================================
- Hits 13085 10846 -2239
- Misses 215 729 +514
- Partials 90 94 +4 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @danhcole !
One minor tweak, please, then we should be ready for a second LGTM+Approval from any other contributor to this repo before merging.
github/activity_notifications.go
Outdated
// GitHub API docs: https://docs.github.com/rest/activity/notifications#mark-a-thread-as-done | ||
// | ||
//meta:operation DELETE /notifications/threads/{thread_id} | ||
func (s *ActivityService) MarkThreadDone(ctx context.Context, id string) (*Response, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to this: https://docs.github.com/en/rest/activity/notifications?apiVersion=2022-11-28#mark-a-thread-as-done
id
is an integer, so let's please change this:
func (s *ActivityService) MarkThreadDone(ctx context.Context, id string) (*Response, error) { | |
func (s *ActivityService) MarkThreadDone(ctx context.Context, id int64) (*Response, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me, I'll update the PR. The MarkThreadRead function (which I shamelessly copied from) has the same issue, would you like me to fix it as part of this PR, or put in a separate PR to keep things clean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, a separate PR would be great since that will be a breaking change. Thank you!
}) | ||
|
||
ctx := context.Background() | ||
_, err := client.Activity.MarkThreadDone(ctx, "1") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These strings will need to be changed to int64
for tests to pass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whops, fixed and tests pass locally now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @danhcole !
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thank you, @tomfeigin! |
Fixes #3264.