feat: proxy port from config + config set/init commands#35
Merged
Conversation
- Add local_port field to Profile config for proxy port persistence - When config local_port is set and port is in use: - TTY: prompt user to choose random port or quit - Non-TTY: return XSQL_PORT_IN_USE error - Port priority: --local-port flag > profile.local_port > 0 (auto) - Add 'xsql config init' to create template config file - Add 'xsql config set <key> <value>' for quick config modification - Supports profile.<name>.<field> and ssh_proxy.<name>.<field> - Add XSQL_PORT_IN_USE error code - Add RFC 0006 documenting both features - Update docs: cli-spec.md, config.md, error-contract.md - Add comprehensive unit tests and E2E tests Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #35 +/- ##
==========================================
- Coverage 82.03% 80.92% -1.11%
==========================================
Files 37 40 +3
Lines 2449 2726 +277
==========================================
+ Hits 2009 2206 +197
- Misses 331 397 +66
- Partials 109 123 +14
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
Feature 1: Proxy Port from Config
local_portfield to Profile config for proxy port persistencelocal_portis set and port is in use:XSQL_PORT_IN_USEerror--local-portflag >profile.local_port> 0 (auto)Feature 2: Config Set/Init Commands
xsql config init- create template config filexsql config set <key> <value>- quick config modificationprofile.<name>.<field>andssh_proxy.<name>.<field>Changes
internal/config/types.go: AddLocalPortto Profileinternal/config/write.go: Config write/update capabilityinternal/proxy/proxy.go: Port conflict detection withXSQL_PORT_IN_USEcmd/xsql/proxy.go: Config-based port resolution + TTY conflict promptcmd/xsql/config.go: New config init/set commandsinternal/errors/codes.go: NewXSQL_PORT_IN_USEerror codeTesting