Skip to content

Add list notifications tool #297

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

martinajir
Copy link

@martinajir martinajir commented Apr 16, 2025

Description

Add a tool to list notifications

DoL exercise to add list notifications tool for github MCP server with with @krzd, @leachj, @geramirez using copilot agent mode

Screenshots

Screenshot 2025-04-22 at 14 33 46
Screenshot 2025-04-22 at 14 33 58

Closes: N/A -

@martinajir martinajir changed the title WIP: List notifications tool Add list notifications tool Apr 22, 2025
@martinajir martinajir marked this pull request as ready for review April 22, 2025 13:35
@Copilot Copilot AI review requested due to automatic review settings April 22, 2025 13:35
@martinajir martinajir requested a review from a team as a code owner April 22, 2025 13:35
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 a tool to list GitHub notifications, providing new endpoints and tests for retrieving notifications with customizable paging and filtering.

  • Introduces a new notifications toolset in pkg/github/tools.go.
  • Implements the ListNotifications handler in pkg/github/notifications.go with supporting tests in pkg/github/notifications_test.go.
  • Updates pkg/github/server.go to include a new helper for optional boolean parameters and documents the change in README.md.

Reviewed Changes

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

Show a summary per file
File Description
pkg/github/tools.go Adds a notifications toolset and registers it with the tool group.
pkg/github/server.go Adds OptionalBoolParamWithDefault helper but contains logic issues.
pkg/github/notifications_test.go Provides tests for the notifications tool functionality.
pkg/github/notifications.go Implements the ListNotifications tool.
README.md Updates documentation with the new notifications tool information.

@martinajir martinajir requested review from krzd and leachj April 22, 2025 13:36
@martinajir martinajir requested a review from Copilot April 22, 2025 15:46
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 a new tool to list GitHub notifications along with its implementation, tests, and documentation updates.

  • Introduces a notifications toolset with read functions.
  • Implements the ListNotifications tool in the GitHub package.
  • Provides tests for notifications behavior and updates the README documentation.

Reviewed Changes

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

File Description
pkg/github/tools.go Adds a new toolset for notifications with read capabilities.
pkg/github/notifications.go Implements the notifications listing functionality.
pkg/github/notifications_test.go Adds tests ensuring proper behavior of the notifications tool.
README.md Updates documentation to include the new notifications tool details.
Comments suppressed due to low confidence (1)

pkg/github/notifications_test.go:117

  • [nitpick] Consider adding assertions for additional fields such as the URL to further improve test coverage of notification properties.
assert.Equal(t, *tc.expectedResponse[i].Subject.Title, *notification.Subject.Title)

@martinajir martinajir requested a review from krzd April 22, 2025 15:46
require.NoError(t, err)
assert.Equal(t, len(tc.expectedResponse), len(returnedNotifications))
for i, notification := range returnedNotifications {
assert.Equal(t, *tc.expectedResponse[i].ID, *notification.ID)
Copy link

Choose a reason for hiding this comment

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

Copilot is somewhat right here with:

[nitpick] Consider adding assertions for additional fields such as the URL to further improve test coverage of notification properties.

@martinajir martinajir removed the request for review from leachj April 23, 2025 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants