[log] Add debug logging to guard_visibility.go - #10749
Conversation
Adds meaningful debug logging calls to internal/server/guard_visibility.go using the existing logGuardInit logger: - getTrustedBots: logs number of trusted bots configured - isServerExemptFromSinkVisibility: logs which exemption path applied Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟢 Ready to approve
The logging is accurate, scoped to existing behavior, and uses the established logger.
This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.
Pull request overview
Adds targeted diagnostics for guard visibility configuration.
Changes:
- Logs the configured trusted-bot count.
- Logs why a server is exempt from sink-visibility enforcement.
File summaries
| File | Description |
|---|---|
internal/server/guard_visibility.go |
Adds debug logging for trusted bots and exemption paths. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Balanced
We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.
🔒 mcpg Read-Only Stress — default AWFSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Gateway enforcement (Part B): Gateway exposes only 22 read-only tools; write calls return Overall: PASS ✅
|
🔒 mcpg Read-Only Stress — docker-sbxSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: PASS Notes:
References: §31057249866
|
Summary
Adds meaningful debug logging calls to
internal/server/guard_visibility.go, reusing the existinglogGuardInitlogger (namespaceserver:guard_init) already used throughout this package.Changes
getTrustedBots: logs the number of trusted bots configured for the gateway.isServerExemptFromSinkVisibility: logs which exemption path (blanket forcePublicRepos opt-out or SinkVisibilityExemptServers entry) applied for a given server.No new logger declaration was needed - the file already imports
internal/loggerand the package-levellogGuardInitvariable (declared inguard_init.go) is reused for consistency.Validation
go build ./...- succeedsgo vet ./internal/server/...- cleango test ./internal/server/...- passesNotes
An earlier candidate file (
internal/syncutil/ttl_cache.go) was considered but rejected: adding a logger import there creates an import cycle, sinceinternal/loggeralready importsinternal/syncutil.