Skip to content

Conversation

@mattdholloway
Copy link
Contributor

Closes:

Copilot AI and others added 2 commits August 28, 2025 15:02
…ers (#1)

* Initial plan

* Initial analysis and planning for CRUD tool consolidation

Co-authored-by: mattdholloway <[email protected]>

* Implement consolidated manage_gist tool with CRUD operations

Co-authored-by: mattdholloway <[email protected]>

* Complete phases 2-3: Consolidated code scanning and secret scanning alert tools

Co-authored-by: mattdholloway <[email protected]>

* Consolidate issue, pull request, and repository operations with manage_* tools

Co-authored-by: mattdholloway <[email protected]>

* Remove old individual tools replaced by consolidated manage_* tools

Co-authored-by: mattdholloway <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: mattdholloway <[email protected]>
@mattdholloway mattdholloway requested a review from a team as a code owner August 28, 2025 14:16
Copilot AI review requested due to automatic review settings August 28, 2025 14:16
Copy link
Contributor

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 consolidates multiple GitHub API tools into unified management tools to reduce API surface area and improve usability. The changes replace individual CRUD operations with single tools that handle multiple operations through an "operation" parameter.

Key changes:

  • Consolidates read and write operations into single management tools for repositories, issues, pull requests, gists, and security scanning
  • Moves some tools between read and write categories based on their actual functionality
  • Updates documentation to reflect the new consolidated tool structure

Reviewed Changes

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

Show a summary per file
File Description
pkg/github/tools.go Replaces individual tools with consolidated management tools and reorganizes read/write categorization
pkg/github/repositories.go Adds ManageRepository tool consolidating create, fork, and get_file_contents operations
pkg/github/issues.go Adds ManageIssue tool consolidating list, get, create, update, and add_comment operations
pkg/github/pullrequests.go Adds ManagePullRequest tool consolidating list, get, create, update, and merge operations
pkg/github/gists.go Adds ManageGist tool consolidating list, create, update, and get operations
pkg/github/code_scanning.go Adds ManageCodeScanningAlerts tool consolidating list and get operations
pkg/github/secret_scanning.go Adds ManageSecretScanningAlerts tool consolidating list and get operations
Test files Adds comprehensive test coverage for all new management tools
README.md Updates documentation to reflect consolidated tool structure

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines 24 to 27
repos := toolsets.NewToolset("repos", "GitHub Repository related tools").
AddReadTools(
toolsets.NewServerTool(SearchRepositories(getClient, t)),
toolsets.NewServerTool(GetFileContents(getClient, getRawClient, t)),
toolsets.NewServerTool(ListCommits(getClient, t)),
Copy link

Copilot AI Aug 28, 2025

Choose a reason for hiding this comment

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

The GetFileContents tool was moved from read tools to the ManageRepository write tool, but file content retrieval is typically a read-only operation. Consider keeping GetFileContents as a separate read tool or ensuring ManageRepository is properly categorized.

Copilot uses AI. Check for mistakes.
Comment on lines 98 to +99
AddReadTools(
toolsets.NewServerTool(GetCodeScanningAlert(getClient, t)),
toolsets.NewServerTool(ListCodeScanningAlerts(getClient, t)),
toolsets.NewServerTool(ManageCodeScanningAlerts(getClient, t)),
Copy link

Copilot AI Aug 28, 2025

Choose a reason for hiding this comment

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

ManageCodeScanningAlerts is placed in read tools but supports both 'list' and 'get' operations. The tool name suggests it could handle write operations in the future. Consider naming it more specifically (e.g., 'ReadCodeScanningAlerts') or placing it in a more appropriate category.

Note: See the diff below for a potential fix:

@@ -96,7 +96,7 @@
 		)
 	codeSecurity := toolsets.NewToolset("code_security", "Code security related tools, such as GitHub Code Scanning").
 		AddReadTools(
-			toolsets.NewServerTool(ManageCodeScanningAlerts(getClient, t)),
+			toolsets.NewServerTool(ReadCodeScanningAlerts(getClient, t)),
 		)
 	secretProtection := toolsets.NewToolset("secret_protection", "Secret protection related tools, such as GitHub Secret Scanning").
 		AddReadTools(

Copilot uses AI. Check for mistakes.
Comment on lines 102 to +103
AddReadTools(
toolsets.NewServerTool(GetSecretScanningAlert(getClient, t)),
toolsets.NewServerTool(ListSecretScanningAlerts(getClient, t)),
toolsets.NewServerTool(ManageSecretScanningAlerts(getClient, t)),
Copy link

Copilot AI Aug 28, 2025

Choose a reason for hiding this comment

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

Similar to ManageCodeScanningAlerts, ManageSecretScanningAlerts is categorized as read-only but the naming suggests broader management capabilities. Consider more specific naming or verify the categorization is appropriate for future extensibility.

Note: See the diff below for a potential fix:

@@ -100,7 +100,7 @@
 		)
 	secretProtection := toolsets.NewToolset("secret_protection", "Secret protection related tools, such as GitHub Secret Scanning").
 		AddReadTools(
-			toolsets.NewServerTool(ManageSecretScanningAlerts(getClient, t)),
+			toolsets.NewServerTool(ListSecretScanningAlerts(getClient, t)),
 		)
 	dependabot := toolsets.NewToolset("dependabot", "Dependabot tools").
 		AddReadTools(

Copilot uses AI. Check for mistakes.
Comment on lines +307 to +312
func min(a, b int) int {
if a < b {
return a
}
return b
}
Copy link

Copilot AI Aug 28, 2025

Choose a reason for hiding this comment

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

The min function is a utility that could be moved to a shared utilities package to avoid duplication across the codebase. This promotes code reuse and maintainability.

Copilot uses AI. Check for mistakes.
@mattdholloway mattdholloway deleted the fix-tools-read-write-consolidated branch August 29, 2025 14:15
@mattdholloway mattdholloway restored the fix-tools-read-write-consolidated branch August 29, 2025 14:15
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.

1 participant