Skip to content

Fix env add: validate input and verify connection#10

Merged
KeKs0r merged 2 commits intomainfrom
marc/fix-chcli-help-crash
Mar 20, 2026
Merged

Fix env add: validate input and verify connection#10
KeKs0r merged 2 commits intomainfrom
marc/fix-chcli-help-crash

Conversation

@KeKs0r
Copy link
Contributor

@KeKs0r KeKs0r commented Mar 20, 2026

Summary

  • Adds input validation to env add requiring at least --host or --url
  • Adds connection verification with automatic HTTPS/port 8443 detection on failure
  • Adds --no-verify flag to skip connection verification
  • Fixes missing await on expect().rejects.toThrow() in tests
  • Fixes double client.close() call (removed from catch block, kept in finally)

Test plan

  • All 7 existing env tests pass
  • New test verifies env add rejects environments with no host or url
  • Existing tests updated to use --no-verify to avoid real connections

🤖 Generated with Claude Code

KeKs0r and others added 2 commits March 20, 2026 14:48
Adds input validation (requires --host or --url), connection verification
with automatic HTTPS detection, and a --no-verify flag to skip verification.
Fixes missing await in test assertion and double client.close() in catch block.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The first argument to resolveConnectionConfig expects CliConfig which has
required fields. Cast {} as CliConfig since only the named environment
is needed for connection verification.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@KeKs0r KeKs0r merged commit 190aab3 into main Mar 20, 2026
1 check passed
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.

1 participant