Skip to content

Comments

fix: address code review findings from gateway commands PR#219

Merged
leggetter merged 1 commit intomainfrom
fix/gateway-review-cleanup
Feb 24, 2026
Merged

fix: address code review findings from gateway commands PR#219
leggetter merged 1 commit intomainfrom
fix/gateway-review-cleanup

Conversation

@leggetter
Copy link
Collaborator

Summary

Fixes issues identified during code review of #213 (gateway resource management commands):

  • Missing API key validation: Added ValidateAPIKey() checks to connection enable, connection disable, connection pause, and connection unpause commands — these were the only gateway commands missing the standard guard
  • Structured error handling: Replaced string-matching 404 detection in resolveSourceID, resolveDestinationID, resolveTransformationID, and resolveConnectionID with a proper APIError type and IsNotFoundError() helper
  • Consistent success indicators: Extracted a shared SuccessCheck constant in helptext.go and replaced all 26 inline checkmark literals across source, destination, transformation, and connection commands
  • Event list output: Added Status: and Connection: labels to the text output in event list for readability
  • Redundant nil check: Simplified result.Models == nil || len(result.Models) == 0 to len(result.Models) == 0 in resolveSourceID

Note: The original review flagged disabled=false always being sent in connection list as a bug. Investigation revealed this is intentional — see comments in connection_list.go:88-100.

Closes #217

Test plan

  • go build ./... — compiles cleanly
  • go vet ./... — no new warnings
  • go test ./pkg/... — unit tests pass (pre-existing TestSourceCreateRequiresName failure unrelated)
  • go test ./test/acceptance/... — 60+ acceptance tests pass covering sources, destinations, connections, transformations, events, requests, and attempts

🤖 Generated with Claude Code

- Add missing ValidateAPIKey() checks in connection enable/disable/pause/unpause commands
- Add structured APIError type for proper 404 detection in resolve functions
- Normalise success checkmark to shared SuccessCheck constant
- Add labels to event list text output (Status, Connection)
- Fix redundant nil check in resolveSourceID

Closes #217

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@leggetter leggetter merged commit 68be57b into main Feb 24, 2026
7 checks passed
@leggetter leggetter deleted the fix/gateway-review-cleanup branch February 24, 2026 16:49
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.

gateway commands: bugs, inconsistencies, and cleanup from PR #213 review

1 participant