Skip to content

Conversation

@mattdholloway
Copy link
Contributor

@mattdholloway mattdholloway commented Dec 12, 2025

This PR concludes the Actions toolset consolidation rollout by bringing these changes back to the OSS repository

Closes: https://github.com/github/copilot-agent-services/issues/1053

@mattdholloway mattdholloway self-assigned this Dec 12, 2025
mattdholloway and others added 4 commits December 12, 2025 14:57
* Improvements & refactoring of get_file_contents

* Fix logical path when file or directory not found

* Fix comment

* Docs update

* Do file matching when raw API returns error
* adding review comments grouped as threads

* minor fix

* minor edit

* update docs

* fix docs

* increase limit to 100

* fixtext
@mattdholloway mattdholloway marked this pull request as ready for review December 15, 2025 15:26
@mattdholloway mattdholloway requested a review from a team as a code owner December 15, 2025 15:26
Copilot AI review requested due to automatic review settings December 15, 2025 15:26
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 Actions tools into a smaller set of method-based tools to simplify the API surface. The consolidation groups related operations together:

  • Read operations: Multiple "list" and "get" tools consolidated into actions_list and actions_get
  • Write operations: Multiple "run", "rerun", "cancel", and "delete" tools consolidated into actions_run_trigger
  • Log retrieval: get_job_logs remains separate (renamed from GetJobLogs to ActionsGetJobLogs)

Key changes:

  • Tools now use a method parameter to specify the specific action to perform
  • Deprecated aliases maintain backward compatibility by mapping old tool names to new ones
  • Tests updated to reflect the new consolidated structure
  • Documentation regenerated to show new tool signatures

Reviewed changes

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

Show a summary per file
File Description
pkg/github/tools.go Registers consolidated tools (ActionsList, ActionsGet, ActionsRunTrigger, ActionsGetJobLogs) instead of individual tools
pkg/github/deprecated_tool_aliases.go Maps all old tool names to new consolidated tool names for backward compatibility
pkg/github/actions.go Major refactoring - removes individual tool functions, adds consolidated tools with method-based routing and helper functions
pkg/github/actions_test.go Refactors tests to test consolidated tools with method parameters, removes old individual tool tests
pkg/github/toolsnaps/*.snap New/updated snapshots for consolidated tool schemas
README.md Auto-generated documentation reflecting new tool structure

actionsMethodGetWorkflowRun = "get_workflow_run"
actionsMethodGetWorkflowJob = "get_workflow_job"
actionsMethodGetWorkflowRunUsage = "get_workflow_run_usage"
actionsMethodGetWorkflowRunLogsURL = "get_workflow_run_logs_url"
Copy link

Copilot AI Dec 15, 2025

Choose a reason for hiding this comment

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

The method constant uses "get_workflow_run_logs_url" but the deprecated tool alias maps "get_workflow_run_logs" to "actions_get". For consistency with the old tool name and to avoid confusion, the method should be named "get_workflow_run_logs" not "get_workflow_run_logs_url". The "_url" suffix is unnecessary since the method returns URL information anyway, and it creates a naming mismatch with the deprecated tool.

Suggested change
actionsMethodGetWorkflowRunLogsURL = "get_workflow_run_logs_url"
actionsMethodGetWorkflowRunLogs = "get_workflow_run_logs"

Copilot uses AI. Check for mistakes.
return ghErrors.NewGitHubAPIErrorResponse(ctx, "failed to cancel workflow run", resp, err), nil, nil
}
}
defer func() { _ = resp.Body.Close() }()
Copy link

Copilot AI Dec 15, 2025

Choose a reason for hiding this comment

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

Potential nil pointer dereference. If the API call at line 887 returns an error that is NOT an AcceptedError, and resp is nil, then line 894 (defer resp.Body.Close()) will panic. The defer statement should be moved inside the error check or wrapped in a nil check. The other helper functions (rerunWorkflowRun, rerunFailedJobs, deleteWorkflowRunLogs) have the same pattern but don't have this special AcceptedError handling, so they're safe.

Suggested change
defer func() { _ = resp.Body.Close() }()
if resp != nil {
defer func() { _ = resp.Body.Close() }()
}

Copilot uses AI. Check for mistakes.
@mattdholloway mattdholloway changed the base branch from main to copilot/add-generic-filtering-mechanisms December 16, 2025 11:36
Base automatically changed from copilot/add-generic-filtering-mechanisms to SamMorrowDrums/registry-builder-pattern December 16, 2025 18:47
Base automatically changed from SamMorrowDrums/registry-builder-pattern to SamMorrowDrums/server-tool-refactor-toolsets December 16, 2025 18:53
Base automatically changed from SamMorrowDrums/server-tool-refactor-toolsets to SamMorrowDrums/server-tool-refactor-projects December 16, 2025 19:01
Base automatically changed from SamMorrowDrums/server-tool-refactor-projects to SamMorrowDrums/server-tool-refactor-security-advisories December 16, 2025 19:02
Base automatically changed from SamMorrowDrums/server-tool-refactor-security-advisories to SamMorrowDrums/server-tool-refactor-discussions December 16, 2025 19:02
Base automatically changed from SamMorrowDrums/server-tool-refactor-discussions to SamMorrowDrums/server-tool-refactor-code-scanning December 16, 2025 19:02
Base automatically changed from SamMorrowDrums/server-tool-refactor-code-scanning to SamMorrowDrums/server-tool-refactor-git December 16, 2025 19:02
Base automatically changed from SamMorrowDrums/server-tool-refactor-git to SamMorrowDrums/server-tool-refactor-actions December 16, 2025 19:03
Base automatically changed from SamMorrowDrums/server-tool-refactor-actions to SamMorrowDrums/server-tool-refactor-pullrequests December 16, 2025 19:03
Base automatically changed from SamMorrowDrums/server-tool-refactor-pullrequests to SamMorrowDrums/server-tool-refactor-issues December 16, 2025 19:36
Base automatically changed from SamMorrowDrums/server-tool-refactor-issues to SamMorrowDrums/server-tool-refactor-repositories December 16, 2025 19:38
Base automatically changed from SamMorrowDrums/server-tool-refactor-repositories to SamMorrowDrums/server-tool-refactor-notifications December 16, 2025 20:32
@SamMorrowDrums SamMorrowDrums force-pushed the SamMorrowDrums/server-tool-refactor-notifications branch from 33662a0 to daee6b8 Compare December 16, 2025 20:44
Base automatically changed from SamMorrowDrums/server-tool-refactor-notifications to SamMorrowDrums/server-tool-refactor December 16, 2025 20:53
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.

5 participants