Skip to content

Add "Mark notification as done" functionality #270

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

Merged

Conversation

rfearing
Copy link
Contributor

@rfearing rfearing commented Apr 14, 2025

Add MarkNotificationAsDone to notifications tooling

Note: Target branch is notifications-tooling #225

Feature added

  • `mark_notification_done: Mark a specific notification thread as done

Technical implementation

  • I largely copied mark_notification_read
  • For the param threadId, WithNumber ran into some issues, so I kept the param as a string. I'm open to suggestions.

@rfearing rfearing changed the title feat: add GitHub notifications tools for managing user notifications Add "Mark notification as done" functionality Apr 14, 2025
@rfearing rfearing force-pushed the rfearing/add-mark-notifications-as-done branch from 2075a36 to edc1ada Compare April 15, 2025 13:13
@rfearing rfearing requested a review from sridharavinash April 15, 2025 13:24
@rfearing rfearing marked this pull request as ready for review April 15, 2025 13:31
@Copilot Copilot AI review requested due to automatic review settings April 15, 2025 13:31
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds the "Mark Notification as Done" functionality to the notifications tooling. The changes include:

  • Adding a new tool registration in pkg/github/server.go.
  • Implementing the MarkNotificationDone function in pkg/github/notifications.go to mark a specific notification thread as done.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
pkg/github/server.go Registers the new tool for marking a notification as done.
pkg/github/notifications.go Implements MarkNotificationDone with parameter parsing and API call.
Comments suppressed due to low confidence (1)

pkg/github/notifications.go:260

  • [nitpick] Consider renaming the parameter 'getclient' to 'getClient' for consistency with similar functions and to improve readability.
func MarkNotificationDone(getclient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc) {

@juruen
Copy link
Collaborator

juruen commented Apr 15, 2025

@rfearing as having too many tools might become an issue, maybe it'd be worth exploring the possibility of merging some of these tools into one.

It seems that marking notifications might be a good candidate to having just one and using the parameters to decide what to do exactly.

And the same goes for the getters.

In general, we should probably explore providing higher level APIs instead of having a 1:1 mapping with the underlying API.

We are already doing that in some tools with a positive result.

In any case, these are just my two cents.

/cc @toby @SamMorrowDrums @williammartin

Copy link

@sridharavinash sridharavinash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! 💖

@rfearing rfearing merged commit 6eaa8d3 into notifications-tooling Apr 16, 2025
15 checks passed
@rfearing rfearing deleted the rfearing/add-mark-notifications-as-done branch April 16, 2025 13:13
@SamMorrowDrums
Copy link
Collaborator

Surprised this was merged without addressing @juruen 's comment.

Probably it makes more sense for the two mark notification tools to be one with an enum for what state to change it to.

Can consider as a follow-up though.

@SamMorrowDrums
Copy link
Collaborator

Oh, sorry I didn't realise this was merged into a branch!

@rfearing
Copy link
Contributor Author

@SamMorrowDrums, @juruen I targeted @sridharavinash's branch and that PR has not yet been merged

@sridharavinash I'm happy to invest some time into looking into @juruen's comment but in your branch.

@SamMorrowDrums
Copy link
Collaborator

@rfearing thank you, really appreciate this too - I was just worried it landed into main without a final pass. There's a bit of a rebase involved to get it into main too :-D

Bu also happy to take a look at the next branch, I just missed it wasn't a merge to main!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants