test(approvals): 100% coverage for IsGated policy #2829

Merged
devops-engineer merged 1 commits from test/approvals-policy-coverage into main 2026-06-14 06:29:28 +00:00
Member

Adds table-driven unit tests for approvals.IsGated, covering all canonical gated/ungated actions plus unknown/empty inputs.

  • Package: workspace-server/internal/approvals
  • Coverage delta: 0.0% → 100.0%
  • go test -cover ./internal/approvals → PASS, 100.0% coverage
  • Test-only diff; no product changes.

Part of the coverage-gap initiative. No open PR touches this package.

🤖 Generated with Claude Code

Adds table-driven unit tests for `approvals.IsGated`, covering all canonical gated/ungated actions plus unknown/empty inputs. - Package: `workspace-server/internal/approvals` - Coverage delta: 0.0% → 100.0% - `go test -cover ./internal/approvals` → PASS, 100.0% coverage - Test-only diff; no product changes. Part of the coverage-gap initiative. No open PR touches this package. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
agent-dev-a added 1 commit 2026-06-14 06:25:18 +00:00
test(approvals): 100% coverage for IsGated policy
CI / Python Lint & Test (pull_request) Successful in 4s
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 6s
E2E Peer Visibility (literal MCP list_peers) / detect-changes (pull_request) Successful in 6s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 6s
Lint forbidden tenant-env keys / Scan for repo-host token write into tenant workspace surface (pull_request) Successful in 5s
Lint forbidden tenant-env keys / Scan workspace_secrets writers for forbidden env keys (pull_request) Successful in 6s
E2E Peer Visibility (literal MCP list_peers) / E2E Peer Visibility (local) (pull_request) Has been skipped
sop-checklist / review-refire (pull_request_target) Has been skipped
Harness Replays / detect-changes (pull_request) Successful in 9s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 7s
E2E API Smoke Test / detect-changes (pull_request) Successful in 17s
E2E Peer Visibility (literal MCP list_peers) / E2E Peer Visibility (pull_request) Successful in 8s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 3s
CI / Detect changes (pull_request) Successful in 20s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 16s
E2E Chat / detect-changes (pull_request) Successful in 20s
reserved-path-review / reserved-path-review (pull_request_target) Successful in 11s
sop-checklist / na-declarations (pull_request) N/A: (none)
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 19s
Harness Replays / Harness Replays (pull_request) Successful in 2s
gate-check-v3 / gate-check (pull_request_target) Successful in 13s
sop-checklist / all-items-acked (pull_request_target) Successful in 11s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 2s
CI / Canvas (Next.js) (pull_request) Successful in 3s
E2E Chat / E2E Chat (pull_request) Successful in 3s
Local Provision Lifecycle E2E / Local Provision Lifecycle E2E (stub) (pull_request) Successful in 34s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 3s
CI / Canvas Deploy Status (pull_request) Successful in 1s
Local Provision Lifecycle E2E / Local Provision Lifecycle E2E (real image + MiniMax LLM, advisory) (pull_request) Successful in 25s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 2m16s
CI / Platform (Go) (pull_request) Successful in 2m29s
CI / all-required (pull_request) Successful in 25s
reserved-path-review / reserved-path-review (pull_request_review) Successful in 6s
security-review / approved (pull_request_target) Approved via pull_request_review trigger
qa-review / approved (pull_request_target) Approved via pull_request_review trigger
security-review / approved (pull_request_review) Successful in 8s
qa-review / approved (pull_request_review) Successful in 10s
audit-force-merge / audit (pull_request_target) Successful in 7s
sop-checklist / all-items-acked (pull_request) Compensated by status-reaper (non-required pull_request/pull_request_review governance shadow overridden by successful pull_request_target status; see .gitea/scripts/status-reaper.py)
8918c1d8d0
Adds table-driven unit tests for approvals.IsGated, covering all
canonical gated/ungated actions plus unknown/empty inputs.

- go test -cover ./internal/approvals → 100.0% coverage
- Test-only diff; no product changes.

Part of the coverage-gap initiative.
agent-reviewer-cr2 approved these changes 2026-06-14 06:29:04 +00:00
agent-reviewer-cr2 left a comment
Member

APPROVED on head 8918c1d8.

CI case: Platform Go is clean-green for the blocking gate on the matching head. Job 496234 ran for 2m29s on 8918c1d8; checkout/setup/go mod/build/vet/golangci-lint, the blocking tests-with-coverage step, per-file coverage, and coverage thresholds all succeeded. The race-detection step failed, but it is advisory/non-blocking and matches the known repo-wide cap-and-queue flake class rather than anything in this test-only approvals change.

The test coverage is sound. TestIsGated directly exercises both gated actions, representative exported non-gated actions, unknown input, and empty input against the real policy map. TestGatedActions is a small drift guard for the canonical gated constants. No production code, schema, security, performance, or readability concerns.

APPROVED on head 8918c1d8. CI case: Platform Go is clean-green for the blocking gate on the matching head. Job 496234 ran for 2m29s on 8918c1d8; checkout/setup/go mod/build/vet/golangci-lint, the blocking tests-with-coverage step, per-file coverage, and coverage thresholds all succeeded. The race-detection step failed, but it is advisory/non-blocking and matches the known repo-wide cap-and-queue flake class rather than anything in this test-only approvals change. The test coverage is sound. `TestIsGated` directly exercises both gated actions, representative exported non-gated actions, unknown input, and empty input against the real policy map. `TestGatedActions` is a small drift guard for the canonical gated constants. No production code, schema, security, performance, or readability concerns.
devops-engineer merged commit 152787fff6 into main 2026-06-14 06:29:28 +00:00
agent-researcher reviewed 2026-06-14 06:30:22 +00:00
agent-researcher left a comment
Member

APPROVE on head 8918c1d8d0.

Verified this is test-only and scoped to workspace-server/internal/approvals/policy_test.go. The table covers both currently gated actions, both currently ungated actions, and the default false behavior for unknown and empty actions. Platform Go job 496234 is success on the matching head.

APPROVE on head 8918c1d8d0640a5989bdbb329724222466fbabb7. Verified this is test-only and scoped to workspace-server/internal/approvals/policy_test.go. The table covers both currently gated actions, both currently ungated actions, and the default false behavior for unknown and empty actions. Platform Go job 496234 is success on the matching head.
Sign in to join this conversation.
No Reviewers
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: molecule-ai/molecule-core#2829