Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: add GitHub notifications tools for managing user notifications#225

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
williammartin merged 2 commits intomainfromnotifications-tooling
May 23, 2025

Conversation

sridharavinash
Copy link
Contributor

@sridharavinashsridharavinash commentedApr 11, 2025
edited by rfearing
Loading

GitHub Notifications Tooling

This PR adds support for managing GitHub notifications

Features Added

New Tools

  • get_notifications: Retrieve a list of notifications for the authenticated GitHub user with filtering options for read/unread status, participation, and time ranges
  • mark_notification_read: Mark a specific notification thread as read
  • mark_notification_done: Mark a specific notification thread as done
  • mark_all_notifications_read: Mark all notifications as read with an optional timestamp
  • get_notification_thread: Fetch details of a specific notification thread

Technical Implementation

  • Implements proper error handling and status code validation
  • Provides RFC3339/ISO8601 timestamp parsing for time-related parameters
  • Integrates with the existing GitHub API client infrastructure
  • Respects read-only mode settings for mutating operations

rfearing and Tonkpils reacted with heart emoji
@sridharavinashsridharavinash marked this pull request as ready for reviewApril 14, 2025 18:16
@CopilotCopilotAI review requested due to automatic review settingsApril 14, 2025 18:16
Copy link
Contributor

@CopilotCopilotAI 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 introduces new GitHub notifications management tooling to allow users to retrieve notifications, mark them as read (individually or in bulk), and fetch detailed thread information.

  • Added notifications tools to the server initialization in pkg/github/server.go.
  • Implemented functions in pkg/github/notifications.go for handling notification retrieval and state updates with appropriate error handling and time parsing.

Reviewed Changes

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

FileDescription
pkg/github/server.goAdded notifications tools and helper functions for optional params.
pkg/github/notifications.goImplements API integrations for GitHub notifications management.
Comments suppressed due to low confidence (2)

pkg/github/server.go:262

  • The condition unconditionally returns the default value when v is false, which means an explicit false value from the user is ignored. Consider checking for the presence of the parameter instead of evaluating its boolean value directly.
if !v { return d, nil }

pkg/github/notifications.go:130

  • [nitpick] The parameter name 'getclient' is inconsistent with other functions that use 'getClient'. Consider renaming it to 'getClient' for consistency.
func MarkNotificationRead(getclient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc) {

@sridharavinashsridharavinash requested a review froma team as acode ownerApril 18, 2025 21:13
@SamMorrowDrumsSamMorrowDrumsforce-pushed thenotifications-tooling branch 3 times, most recently from9878a8a toea51752CompareMay 20, 2025 11:08
Copy link
Contributor

@CopilotCopilotAI 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 introduces a new “notifications” toolset for managing GitHub notifications, including unit and end-to-end tests, plus documentation for opting into state-mutating tests.

  • Registers thenotifications toolset inpkg/github/tools.go
  • Adds unit tests for each notification tool (pkg/github/notifications_test.go)
  • Implements e2e tests and a README section to skip global-state mutations (e2e/e2e_test.go,e2e/README.md)

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

FileDescription
pkg/github/tools.goRegister new “notifications” toolset
pkg/github/notifications_test.goAdd unit tests for list, get, dismiss, mark-all, and subscription tools
e2e/e2e_test.goAdd e2e tests for notification tools and skip logic
e2e/README.mdDocument environment flag to skip mutation tests
Comments suppressed due to low confidence (5)

pkg/github/notifications_test.go:57

  • Consider adding a unit test for the "watch" action inManageNotificationSubscription, since currently only "ignore" and "delete" are covered.
func Test_ManageNotificationSubscription(t *testing.T) {

pkg/github/notifications_test.go:114

  • The "watch" action isn’t tested inTest_ManageRepositoryNotificationSubscription; consider adding it to ensure full coverage of subscription states.
func Test_ManageRepositoryNotificationSubscription(t *testing.T) {

pkg/github/notifications_test.go:180

  • Add a success-case test for the "done" state inTest_DismissNotification to cover both supported states.
// Success case: mark as read

pkg/github/notifications_test.go:224

  • Include a unit test for passing thesince timestamp intoMarkAllNotificationsRead to validate the optional filter parameter.
request := createMCPRequest(map[string]interface{}{})

e2e/e2e_test.go:1552

  • Requiring exactly one notification is brittle—list_notifications can return multiple items. Consider usingrequire.NotEmpty or asserting a minimum length.
require.Len(t, resp.Content, 1, "expected content to have one item")

@SamMorrowDrumsSamMorrowDrumsforce-pushed thenotifications-tooling branch 2 times, most recently fromc09adbd to7082815CompareMay 23, 2025 10:32
Copy link
Collaborator

@williammartinwilliammartin left a comment

Choose a reason for hiding this comment

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

Thanks!

@williammartinwilliammartin merged commite9f748f intomainMay 23, 2025
16 checks passed
@williammartinwilliammartin deleted the notifications-tooling branchMay 23, 2025 12:00
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

Copilot code reviewCopilotCopilot left review comments

@williammartinwilliammartinwilliammartin approved these changes

@juruenjuruenAwaiting requested review from juruen

@SamMorrowDrumsSamMorrowDrumsAwaiting requested review from SamMorrowDrums

@tobytobyAwaiting requested review from toby

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@sridharavinash@williammartin@SamMorrowDrums

[8]ページ先頭

©2009-2025 Movatter.jp