Skip to content
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

Oncall Tools #50

Merged
merged 28 commits into from
Apr 1, 2025
Merged

Oncall Tools #50

merged 28 commits into from
Apr 1, 2025

Conversation

ioanarm
Copy link
Contributor

@ioanarm ioanarm commented Mar 20, 2025

The PR adds support for Grafana OnCall features to the MCP server, including:

  • ListOnCallSchedules: Lists schedules from Grafana OnCall, with team ID filtering
  • GetOnCallShift: Gets detailed information for a specific OnCall shift by ID
  • GetCurrentOnCallUsers: Shows who's currently on-call for a specific schedule
  • ListOnCallTeams: Lists all teams from Grafana OnCall with their details
  • ListOnCallUsers: Lists all users from Grafana OnCall with their details or Get a specific user by the UserID or Username

Also this PR adds a "cloud test" against a specific testing instance (for now mcptests.grafana-dev.net)

Adding support for:

  • alert groups
  • shift swap requests
    depend on adding support for them to the client.
    For alert groups there is already an open PR which we are pushing forward at the moment.

Before merging we need to alter the github actions required to unblock merging
At the moment we require Test while we are gonna need three rules specific for unit, integration and cloud.

@sd2k sd2k added enhancement New feature or request tools Changes to MCP tools labels Mar 20, 2025
@sd2k sd2k linked an issue Mar 20, 2025 that may be closed by this pull request
2 tasks
@ioanarm ioanarm force-pushed the oncall-api branch 6 times, most recently from fd1c1ce to f49efbc Compare March 24, 2025 20:48
@ioanarm ioanarm changed the title Oncall api - WiP Oncall Tools Mar 24, 2025
@ioanarm ioanarm marked this pull request as ready for review March 24, 2025 21:39
@ioanarm ioanarm requested a review from a team as a code owner March 24, 2025 21:39
Copy link
Collaborator

@sd2k sd2k left a comment

Choose a reason for hiding this comment

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

Nice, this looks like it will be super useful! I added a few comments inline.

Makefile Outdated
@@ -24,6 +24,10 @@ test: ## Run the Go unit tests.
test-all: ## Run the Go unit and integration tests.
go test -v -tags integration ./...

.PHONY: test-cloud
test-cloud: ## Run only the cloud tests.
go test -v -tags cloud ./tools -run TestCloudOnCall
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
go test -v -tags cloud ./tools -run TestCloudOnCall
go test -v -tags cloud ./...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍 I need the path though ./tools as we have the mcpgrafana_test which checks the env vars.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've separated completely unit tests, docker based integration ones and cloud so we now run three separate commands in git actions.
docker and cloud ones require env vars which are different in each case so having them both under the same command just complicated things for no reason.
three test categories with tags maybe make a bit more sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if it works 🙄

@ioanarm
Copy link
Contributor Author

ioanarm commented Mar 26, 2025

@sd2k Thanks for reviewing this :)
I think I covered your comments, let me know if there is anything else I can add/improve!

@ioanarm ioanarm force-pushed the oncall-api branch 3 times, most recently from 9092883 to 9a7cfbd Compare March 26, 2025 20:21
Copy link
Collaborator

@sd2k sd2k left a comment

Choose a reason for hiding this comment

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

LGTM! one very minor suggestion. I'll update the Ruleset to refer to the new CI jobs too.

@sd2k
Copy link
Collaborator

sd2k commented Apr 1, 2025

Ah the README will need updating to refer to the new make targets too.

ioanarm and others added 2 commits April 1, 2025 18:54
@ioanarm ioanarm merged commit d4109ee into main Apr 1, 2025
5 checks passed
@ioanarm ioanarm deleted the oncall-api branch April 1, 2025 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request tools Changes to MCP tools
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add tools for Grafana IRM
2 participants