Skip to content

Refactor GitHub MCP transport options to share a single common option struct - #54714

Open
pelikhan with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-9919-1036865607-848d83ef-21b4-47cc-b9b8-e044e0e3105e
Open

Refactor GitHub MCP transport options to share a single common option struct#54714
pelikhan with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-9919-1036865607-848d83ef-21b4-47cc-b9b8-e044e0e3105e

Conversation

Copilot AI commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

GitHubMCPDockerOptions and GitHubMCPRemoteOptions had re-diverged, each redeclaring the same 8 shared fields. This change consolidates those fields into one embedded GitHubMCPCommonOptions to keep shared MCP behavior aligned across transport modes.

  • Shared option model

    • Added GitHubMCPCommonOptions with:
      • ReadOnly, Lockdown, LockdownFromStep, GuardPoliciesFromStep
      • Toolsets, Features, AllowedTools, GuardPolicies
    • Updated GitHubMCPDockerOptions and GitHubMCPRemoteOptions to embed the common struct.
  • Renderer construction updates

    • Updated GitHub MCP option construction in mcp_renderer_github.go to initialize shared fields via GitHubMCPCommonOptions, leaving transport-specific fields in the transport structs.
  • Test alignment + regression guard

    • Updated existing Docker/Remote config tests to use embedded common options in keyed literals.
    • Added a focused type-level regression test asserting both transport option structs embed GitHubMCPCommonOptions.
type GitHubMCPCommonOptions struct {
    ReadOnly              bool
    Lockdown              bool
    LockdownFromStep      bool
    GuardPoliciesFromStep bool
    Toolsets              string
    Features              string
    AllowedTools          []string
    GuardPolicies         map[string]any
}

type GitHubMCPDockerOptions struct {
    GitHubMCPCommonOptions
    DockerImageVersion string
    CustomArgs         []string
    IncludeTypeField   bool
    EffectiveToken     string
}

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Copilot Request Refactor GitHub MCP transport options to share a single common option struct Aug 22, 2026
Copilot AI requested a review from pelikhan August 22, 2026 04:09
@github-actions

Copy link
Copy Markdown
Contributor

PR Triage

  • Category: refactor
  • Risk: low
  • Priority score: 30/100 (impact 10, urgency 5, quality 15)
  • Recommended action: defer
  • CI status: no_checks

Generated by 🔧 PR Triage Agent · auto · 82.9 AIC · ⌖ 6.65 AIC · ⊞ 8.3K ·

@github-actions

Copy link
Copy Markdown
Contributor

PR Triage

Category: refactor | Risk: low | Priority: low | Score: 28/100
Recommended action: defer

Draft. Consolidates GitHub MCP transport option structs.

Automated triage — run 32572524009

Generated by 🔧 PR Triage Agent · auto · 65.4 AIC · ⌖ 6.04 AIC · ⊞ 8.3K ·

@pelikhan
pelikhan marked this pull request as ready for review August 22, 2026 13:02
Copilot AI balanced review requested due to automatic review settings August 22, 2026 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[deep-report] Re-file: GitHubMCPDockerOptions/GitHubMCPRemoteOptions still duplicate 8 shared fields (prior fix #51076 didn't stick)

2 participants