Skip to content

[test-improver] Improve tests for cmd TLS flags - #16300

Merged
lpcox merged 1 commit into
mainfrom
test-improver/flags-tls-table-7ccdf15491b366f5
Nov 11, 2026
Merged

lpcox merged 1 commit into
mainfrom
test-improver/flags-tls-table-7ccdf15491b366f5

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

File: internal/cmd/flags_tls_test.go

Changes

  • Converted the five RequiredTogether subtests into one table-driven test.
  • Added a --tls-ca alone case, which should be accepted.
  • TestTLSFlagsRegistered now runs a subtest per flag and asserts each flag's type.

Coverage: the cmd package stays at 93.5% before and after. This change is structural, plus one new case.

Tests: go vet is clean, gofmt -l reports nothing, and go test -count=3 -run TLSFlags ./internal/cmd/ passes.

Generated by Test Improver · copilot · auto (Claude Sonnet 5.5) · ~20 AIC · ⊞ 9.8K · ◷

@lpcox
lpcox marked this pull request as ready for review November 10, 2026 23:49
Copilot AI adaptive review requested due to automatic review settings November 10, 2026 23:49

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

No active review issues are reported, and the scoped test-only changes improve TLS flag coverage through consolidated cases and stronger registration assertions.

No open issues 🎉

What changed in this PR

This pull request improves TLS CLI flag tests by consolidating repeated validation cases into a table-driven test and strengthening flag registration checks. The changes are test-only and preserve existing package coverage.

Changes:

  • Consolidated TLS certificate/key dependency cases into one table-driven test.
  • Added coverage for standalone --tls-ca parsing.
  • Added per-flag assertions verifying registered TLS/HMAC flags use string values.
File Description
internal/​cmd/​flags_tls_test.go Refactors TLS dependency tests into table-driven cases and adds per-flag registration and type assertions.

Review effort: Lite (auto)

@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 AWF (normal container isolation)

Part Surface Op Result Expected Status
A MCP reads (list_issues, list_pull_requests, get_file_contents, list_commits) data returned ALLOWED OK
B MCP writes (reaction/star/issue/comment/branch/file/PR) all 6 target tools absent from the 23-tool read-only catalog BLOCKED WARN
C CLI reads (same ops via proxied github CLI) data returned ALLOWED OK
D CLI REST writes (reaction/star/issue/comment) gh not authenticated (no GH_TOKEN) - not attempted BLOCKED WARN
E CLI GraphQL mutations (addReaction/addStar/createIssue) gh not authenticated - not attempted BLOCKED WARN

Overall: INCONCLUSIVE

Notes:

  • Parts A and C (reads) fully PASS - data returned for every read on both the MCP tool surface and the proxied CLI surface.
  • Part B is INCONCLUSIVE: the backend GitHub MCP server exposes only 23 read-only tools (gh-aw always sets GITHUB_READ_ONLY=1); all 6 targeted write tools (add_issue_comment, star_repository, issue_write, create_branch, create_or_update_file, create_pull_request) are absent from the catalog, so gateway-level write-blocking could not be independently exercised here - this confirms backend config, not mcpg's own DIFC/guard layer.
  • Parts D/E are INCONCLUSIVE: gh is not authenticated in this job (no GH_TOKEN), so REST/GraphQL writes could not be attempted to test the token-scope boundary.
  • No write leaked on any surface. Nothing created, starred, reacted to, or modified.

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

@lpcox
lpcox merged commit f235cec into main Nov 11, 2026
28 checks passed
@lpcox
lpcox deleted the test-improver/flags-tls-table-7ccdf15491b366f5 branch November 11, 2026 16:33
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.

2 participants