Skip to content

Conversation

@SamMorrowDrums
Copy link
Collaborator

Summary

This PR converts the security_advisories tools from NewServerToolLegacy wrapper to the new NewTool pattern with ToolDependencies.

Changes

Converted 4 functions:

  • ListGlobalSecurityAdvisories
  • GetGlobalSecurityAdvisory
  • ListRepositorySecurityAdvisories
  • ListOrgRepositorySecurityAdvisories

Updated:

  • security_advisories.go - Tool implementations
  • tools.go - Toolset registration
  • security_advisories_test.go - Tests

Part of Stack

This is part of a series of PRs to eliminate all NewServerToolLegacy usages:

Testing

All tests pass locally.

Convert 4 functions from NewServerToolLegacy wrapper to NewTool:
- ListGlobalSecurityAdvisories
- GetGlobalSecurityAdvisory
- ListRepositorySecurityAdvisories
- ListOrgRepositorySecurityAdvisories

Update tools.go toolset registration and tests.

Co-authored-by: Adam Holt <omgitsads@users.noreply.github.com>
@SamMorrowDrums SamMorrowDrums requested a review from a team as a code owner December 13, 2025 17:56
Copilot AI review requested due to automatic review settings December 13, 2025 17:56
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 refactors the security_advisories tools from the legacy NewServerToolLegacy wrapper to the modern NewTool pattern with ToolDependencies, consistent with the broader codebase modernization effort across PRs #1597-#1600.

Key changes:

  • Converted 4 security advisory functions to use the NewTool pattern with ToolDependencies
  • Updated function signatures to return toolsets.ServerTool instead of separate tool and handler
  • Modified tests to use the new toolDef.Handler(deps) pattern with 2-parameter handler signature

Reviewed changes

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

File Description
pkg/github/tools.go Removed NewServerToolLegacy wrappers and getClient parameter from 4 security advisory tool registrations
pkg/github/security_advisories.go Refactored all 4 functions to use NewTool pattern with ToolDependencies closure, added toolsets import
pkg/github/security_advisories_test.go Updated tests to use toolDef pattern, deps.GetClient, and new 2-parameter handler signature

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