Skip to content

[log] Add debug logging to GraphQL root field parsing - #15538

Merged
lpcox merged 1 commit into
mainfrom
log/graphql-root-fields-98f414cf3ac82971
Oct 26, 2026
Merged

lpcox merged 1 commit into
mainfrom
log/graphql-root-fields-98f414cf3ac82971

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Adds debug log calls (reusing existing logGraphQL) to graphqlRootFields in internal/proxy/graphql.go, covering each early-return path (parse failure, ambiguous/duplicate/missing operation, non-query operation, operation text extraction failure) and the successful parse result.

Log arguments are side-effect free and don't include query text.

Validation: go vet ./internal/proxy, go test ./internal/proxy, and go build pass.

Generated by Go Logger Enhancement · copilot · auto · ~37 AIC · ⊞ 6K · ◷

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added automation enhancement New feature or request labels Oct 25, 2026
@lpcox
lpcox marked this pull request as ready for review October 26, 2026 11:03
Copilot AI max review requested due to automatic review settings October 26, 2026 11:03
@github-actions

Copy link
Copy Markdown
Contributor Author

🔒 mcpg Read-Only Stress — default

Surface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Isolation runtime: default

Part Surface Op Result Expected Status
A MCP reads (list_issues, list_pull_requests, get_file_contents, list_commits) data returned ALLOWED ✅
B MCP writes (reaction/star/issue/comment/branch/file/PR) all 6 target tools absent from catalog (23 read-only tools only) BLOCKED ⚠️
C CLI reads via proxied github CLI data returned ALLOWED ✅
D CLI REST writes gh not authenticated (no token) BLOCKED ⚠️
E CLI GraphQL mutations gh not authenticated (no token) BLOCKED ⚠️

Overall: INCONCLUSIVE

Notes:

  • No write leaked on any surface.
  • Part B: all 6 targeted write tools (add_issue_comment, star_repository, issue_write, create_branch, create_or_update_file, create_pull_request) are entirely absent from the gateway-proxied github CLI catalog (23 read-only tools exposed). This confirms backend/toolset config (GITHUB_READ_ONLY=1) but cannot independently confirm the gateway's own DIFC/guard write-blocking layer, since no write-capable tool call ever reached it.
  • Part D/E: gh auth status showed not logged in and GH_TOKEN/GITHUB_TOKEN were unset, so REST/GraphQL write probes were not attempted; the token-scope boundary could not be exercised this run.

🔒 mcpg read-only stress (default AWF runtime) by Read-Only Stress: default runtime

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 logging-only additions use side-effect-free arguments, preserve existing behavior, and introduce no identified blocking issues.

No open issues 🎉

What changed in this PR

Adds diagnostic logging to the proxy’s GraphQL root-field parser without changing parsing behavior or return values.

Changes:

  • Logs each early-return path using the existing logGraphQL logger.
  • Logs successful root-field counts and names without including query text.
File Description
internal/​proxy/​graphql.go Adds diagnostics for parsing failures and successful root-field extraction.

Review effort: Max

@lpcox
lpcox merged commit 4d5d6e0 into main Oct 26, 2026
26 of 28 checks passed
@lpcox
lpcox deleted the log/graphql-root-fields-98f414cf3ac82971 branch October 26, 2026 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants