Skip to content

fix: accept the swift ecosystem in list_global_security_advisories - #3937

Merged
SamMorrowDrums merged 1 commit into
github:mainfrom
burrows99:fix/advisory-ecosystem-swift
Nov 24, 2026
Merged

SamMorrowDrums merged 1 commit into
github:mainfrom
burrows99:fix/advisory-ecosystem-swift

Conversation

@burrows99

Copy link
Copy Markdown
Contributor

Summary

list_global_security_advisories now accepts ecosystem: "swift". The GitHub Advisory Database has a Swift ecosystem and the REST API accepts it, but the tool's enum left it out, so every Swift request was rejected by schema validation before reaching the API.

Why

The ecosystem enum lists 12 values ending at rust. The REST endpoint's own error message lists 13: rubygems, npm, pip, maven, nuget, composer, go, rust, erlang, actions, pub, other, swift. The server validates arguments against the tool schema, so:

validating "arguments": validating root: validating /properties/ecosystem: enum: swift does not equal any of: [actions composer erlang go maven npm nuget other pip pub rubygems rust]

and clients that build forms or prompts from the schema never offer Swift. GET /advisories?ecosystem=swift returns Swift advisories (for example GHSA-86wm-r4c5-2rc9).

No upstream issue is associated with this fix. Reproduced on main at 9a72d8d.

flowchart TD
    A[list_global_security_advisories with ecosystem swift] --> B{Schema validation}
    B -->|Before| C[Rejected, swift not in enum]
    B -->|After| D[Swift advisories returned]
Loading

What changed

  • pkg/github/security_advisories.go: add "swift" to the ecosystem enum.
  • pkg/github/__toolsnaps__/list_global_security_advisories.snap: refreshed with UPDATE_TOOLSNAPS=true.
  • pkg/github/security_advisories_test.go: Test_ListGlobalSecurityAdvisories_SwiftEcosystem calls the tool through an MCP server and client (so schema validation runs) and checks that ecosystem=swift reaches the API.

Narrated recording in the MCP Inspector, before then after (sound on). Server run with --read-only --toolsets=repos,security_advisories:

evidence.mp4

Edge cases and unchanged behaviour checked (in the running server through the Inspector, as shown in the video):

  • ecosystem: go still returns Go advisories (unchanged)
  • ecosystem: swift with severity: critical returns critical Swift advisories (edge case)
  • ecosystem: swiftly is still rejected by validation (unchanged; the message now lists swift)

MCP impact

  • No tool or API changes
  • Tool schema or behavior changed
    One value added to the ecosystem enum of list_global_security_advisories.
  • New tool added

Prompts tested (tool changes only)

  • "List reviewed security advisories for Swift packages"
  • "List critical Swift advisories"

Security / limits

  • No security or limits impact

Tool renaming

  • I am renaming tools as part of this PR (e.g. a part of a consolidation effort)
    • I have added the new tool aliases in deprecated_tool_aliases.go
  • I am not renaming tools as part of this PR

Lint & tests

  • Linted locally with ./script/lint
    gofmt -s -l pkg/github clean; golangci-lint v2.14.0 (the pinned version) on ./pkg/github/...: 0 issues.
  • Tested locally with ./script/test
    go test ./pkg/github/ and go test ./pkg/skills/catalog -run TestCatalogToolRequirementsAreRegistered pass. The new test fails on main (the call returns the validation error above) and passes with the fix. script/generate-docs produced no README change. I did not run the whole repository suite.

Docs

  • Not needed

Skills

  • Updated relevant skills or confirmed no bundled skill applies
    security-alert-triage mentions the tool but not its ecosystem values; no change needed.

AI assistance (Claude Code) was used to find the bug, write the fix and test, and record the video.

🤖 Generated with Claude Code

The GitHub Advisory Database has a Swift ecosystem and the REST API
accepts ecosystem=swift, but the tool's ecosystem enum left it out.
The server validates arguments against that enum, so every call with
ecosystem "swift" failed with a validation error before reaching the
API.

Add "swift" to the enum and refresh the tool snapshot.
@burrows99
burrows99 requested a review from a team as a code owner November 24, 2026 04:36
Copilot AI adaptive review requested due to automatic review settings November 24, 2026 04:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The Swift ecosystem support is covered by the enum update, an MCP regression test confirming API reachability, and the refreshed schema snapshot, with no active review issues.

No open issues 🎉

What changed in this PR

This pull request updates list_global_security_advisories to accept Swift as a valid ecosystem, allowing Swift advisory requests to pass schema validation and reach GitHub's REST API.

Changes:

  • Added swift to the ecosystem enum.
  • Added an MCP-level regression test verifying Swift reaches the API.
  • Refreshed the corresponding tool schema snapshot.
File Description
pkg/​github/​security_advisories.go Adds swift as an accepted ecosystem value.
pkg/​github/​security_advisories_test.go Verifies Swift requests pass MCP schema validation and reach the API.
pkg/​github/​__toolsnaps__/​list_global_security_advisories.snap Records the updated ecosystem enum in the tool schema snapshot.

Review effort: Lite (adaptive)

@SamMorrowDrums

Copy link
Copy Markdown
Collaborator

Thank you!

@SamMorrowDrums
SamMorrowDrums merged commit c6b6295 into github:main Nov 24, 2026
14 checks passed
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.

3 participants