Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add ListGlobalSecurityAdvisories and GetGlobalSecurityAdvisory#693

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
leonard520 wants to merge1 commit intogithub:main
base:main
Choose a base branch
Loading
fromleonard520:global-advisories

Conversation

leonard520
Copy link

Closes:#684

@CopilotCopilotAI review requested due to automatic review settingsJuly 17, 2025 15:56
@leonard520leonard520 requested a review froma team as acode ownerJuly 17, 2025 15:56
Copy link
Contributor

@CopilotCopilotAI 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 support for listing and retrieving global security advisories from the GitHub Advisory Database by introducing two new tools, wiring them into the toolset group, and providing corresponding tests and snapshots.

  • Registers a newglobal_security_advisories toolset inDefaultToolsetGroup
  • ImplementsListGlobalSecurityAdvisories andGetGlobalSecurityAdvisory handlers with option parsing
  • Adds unit tests and tool definition snapshots for both tools

Reviewed Changes

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

Show a summary per file
FileDescription
pkg/github/tools.goRegisters the newglobal_security_advisories toolset
pkg/github/global_security_advisories.goImplements handlers for listing and getting global security advisories
pkg/github/global_security_advisories_test.goAdds unit tests covering the new advisory tools
pkg/github/toolsnaps/list_global_security_advisories.snapSnapshot for the list tool definition
pkg/github/toolsnaps/get_global_security_advisory.snapSnapshot for the get tool definition
Comments suppressed due to low confidence (1)

pkg/github/global_security_advisories_test.go:39

  • There are no test cases covering error handling when the ListGlobalSecurityAdvisories API returns a non-200 status or the client errors. Add tests to simulate failures and verify the handler returns an error result.
tests := []struct {

return nil, fmt.Errorf("failed to get GitHub client: %w", err)
}

advisory, resp, err := client.SecurityAdvisories.GetGlobalSecurityAdvisories(ctx, ghsaID)
Copy link
Preview

CopilotAIJul 17, 2025

Choose a reason for hiding this comment

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

The call to client.SecurityAdvisories.GetGlobalSecurityAdvisories uses an incorrect method name; the correct method is GetGlobalSecurityAdvisory (singular). Update this to call the intended API.

Suggested change
advisory,resp,err:=client.SecurityAdvisories.GetGlobalSecurityAdvisories(ctx,ghsaID)
advisory,resp,err:=client.SecurityAdvisories.GetGlobalSecurityAdvisory(ctx,ghsaID)

Copilot uses AI. Check for mistakes.

// Note: EPSS parameters may not be supported in current Go SDK version
// Check if these fields exist before using them
// For now, we accept the parameters but don't use them in the API call
if _, err := OptionalParam[string](request, "epss_percentage"); err != nil {
Copy link
Preview

CopilotAIJul 17, 2025

Choose a reason for hiding this comment

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

The epss_percentage and epss_percentile parameters are parsed but never applied to the API call, which can confuse users. Consider implementing support for these options or removing them from the tool signature until they're supported.

Copilot uses AI. Check for mistakes.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

Copilot code reviewCopilotCopilot left review comments

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Feature req - repository security advisories
1 participant
@leonard520

[8]ページ先頭

©2009-2025 Movatter.jp