Skip to content

fix: code audit — error handling, parity, SPEC, tests#19

Merged
robbycochran merged 3 commits into
mainfrom
rc-k8s
Jun 5, 2026
Merged

fix: code audit — error handling, parity, SPEC, tests#19
robbycochran merged 3 commits into
mainfrom
rc-k8s

Conversation

@robbycochran

@robbycochran robbycochran commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes all high + medium findings from a 73-agent deep code audit, plus adds --reuse-gateway for faster OCP test cycles.

Audit fixes (issues #15-#18)

#15 (high): providers --force now deletes custom profiles before reimport, matching bash parity. Added ProviderProfileDelete to Gateway interface.

#16 (medium): Error handling cleanup:

  • SilenceErrors + SilenceUsage on root command — no more Cobra double-printing
  • Teardown checks SandboxList/ProviderList errors instead of silently treating failures as "none found"
  • SandboxDelete/ProviderDelete errors reported in teardown loops
  • Preflight strict mode returns error instead of os.Exit(1) from library code
  • Providers command shows registered provider names and inference model after registration

#17 (medium): Gateway CLI consistency:

  • ANSI stripping added to ProviderList (was the only parser without it)
  • --kubeconfig flag added to deploy, forwarded to bash for --remote
  • 10 new gateway CLI tests: GatewayList, SandboxList, ActiveGateway, InferenceModel, CLIVersion, CLIPath

#18 (medium): SPEC.md + DRY:

  • Preflight: documented --strict, available/names subcommands
  • Providers: documented --force, registration details, OPENSHELL_MODEL
  • Deploy: documented --kubeconfig, clarified --local/--remote required
  • New Environment Variables section, Go tests documented
  • Extracted loadEnabledProviders helper (was triplicated)

--reuse-gateway for faster OCP tests

Skip helm deploy/teardown-k8s when the gateway is already running. Resets sandboxes + providers between runs instead. Falls back to full deploy if gateway unreachable.

49s vs 137s for a full OCP test cycle (64% faster).

./test/test-flow.sh ocp --full --reuse-gateway

Test results

Path Result
Go unit tests 38/38
Launcher tests 7/7
Bats preflight (Python) 29/29
Bats preflight (Go) 29/29
bash + podman (full) 19/19
Go + podman (full) 19/19
bash + OCP (full) 17/17 (137s)
bash + OCP (reuse-gateway) 17/17 (49s)

Closes #15, #16, #17, #18.

🤖 Generated with Claude Code

robbycochran and others added 3 commits June 4, 2026 20:43
Fixes issues #15-#18 from the 5-dimension code audit.

#15 (high): providers --force now deletes custom profiles before
reimport, matching bash parity. Add ProviderProfileDelete to Gateway.

#16 (medium): SilenceErrors/SilenceUsage on root command (no more
Cobra double-print. Check discarded errors in teardown (SandboxList,
ProviderList, SandboxDelete, ProviderDelete). Return error from
preflight strict mode instead of os.Exit(1). Fix providers display —
show provider names and inference model after registration.

#17 (medium): ANSI stripping in ProviderList (was the only parser
without it). Add --kubeconfig flag to deploy, forwarded to bash.
10 new gateway CLI tests: GatewayList, SandboxList, ActiveGateway,
InferenceModel, CLIVersion, CLIPath.

#18 (medium): SPEC.md updated — preflight --strict + subcommands,
providers --force + registration details, deploy --kubeconfig,
environment variables section, Go tests documented. DRY: extract
loadEnabledProviders helper (was triplicated).

Validated: unit 38+7, bats 29+29, podman 19+19, OCP 17/17.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
EOF
)
Skip helm deploy/teardown-k8s when the gateway is already running.
Resets sandboxes + providers between runs instead of full infrastructure
teardown. Falls back to full deploy if gateway is unreachable.

49s vs 137s for a full OCP test cycle (64% faster).

Usage: ./test/test-flow.sh ocp --full --reuse-gateway

Validated: unit 38+7, bats 29+29, podman 19+19, OCP 17/17,
OCP --reuse-gateway 17/17.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: providers --force doesn't delete custom profiles (parity gap)

1 participant