Remove askpraxis default from CLI - #74
Conversation
WalkthroughThe CLI now requires an account-specific deployment URL for new profiles without a saved URL. The default URL fallback and obsolete ChangesDeployment URL transition
Sequence Diagram(s)sequenceDiagram
participant User
participant LoginCommand
participant CredentialStore
participant Browser
User->>LoginCommand: Start login
LoginCommand->>CredentialStore: Resolve saved URL
CredentialStore-->>LoginCommand: Return saved URL or no URL
alt No saved URL and no --url
LoginCommand-->>User: Show required deployment URL guidance
else Deployment URL available
LoginCommand->>Browser: Start authentication
LoginCommand->>CredentialStore: Save canonical URL and credentials
end
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@internal/credentials/credentials_test.go`:
- Around line 195-198: Update the fixture setup in the credentials serialization
test around Put, os.UserHomeDir, and os.ReadFile to check each returned error,
reporting the operation and error value through the test failure mechanism.
Assert the expected error type or contents where applicable rather than only
checking err != nil, and only continue to inspect the credentials file after
setup succeeds.
In `@internal/skillinstall/dummy.go`:
- Around line 233-234: Update the guidance in internal/skillinstall/dummy.go
lines 233-234 and internal/render/preamble.go line 46 to align with
matches_praxis_url: every false result must require confirmation before any
write, while naming both hosts and reporting a different control plane only when
both parsed hosts are present and differ; otherwise describe the hosts as
missing or unverifiable. Apply the same wording and distinction in both
generated guidance paths.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 62e334a0-a3dc-4de7-8599-4e73526115c5
📒 Files selected for processing (14)
.goreleaser.ymlCLAUDE.mdREADME.mdcmd/login.gocmd/login_canonical_test.gocmd/login_reuse_test.gocmd/logout_test.gocmd/mcp.gocmd/mcp_test.gointernal/credentials/credentials.gointernal/credentials/credentials_test.gointernal/raptorstate/raptorstate_test.gointernal/render/preamble.gointernal/skillinstall/dummy.go
| _ = Put("default", Profile{URL: "https://default.test", Username: "a@x", Token: "t"}) | ||
| home, _ := os.UserHomeDir() | ||
| body, _ := os.ReadFile(filepath.Join(home, ".praxis", "credentials")) | ||
| for _, want := range []string{"[default]", "url = https://askpraxis.ai", "username = a@x", "token = t"} { | ||
| for _, want := range []string{"[default]", "url = https://default.test", "username = a@x", "token = t"} { |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Handle fixture setup errors instead of discarding them.
Put, os.UserHomeDir, and os.ReadFile errors are ignored in this modified test block. A setup failure can produce a misleading assertion or read the wrong file. Check each error and include the operation and error value in the failure.
As per coding guidelines, tests must assert error types or contents rather than only err != nil.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@internal/credentials/credentials_test.go` around lines 195 - 198, Update the
fixture setup in the credentials serialization test around Put, os.UserHomeDir,
and os.ReadFile to check each returned error, reporting the operation and error
value through the test failure mechanism. Assert the expected error type or
contents where applicable rather than only checking err != nil, and only
continue to inspect the credentials file after setup succeeds.
Source: Coding guidelines
| plane than this praxis profile. Say which two hosts you see and ask the | ||
| user which is intended BEFORE any raptor write; |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
Align both generated guidance paths with the matches_praxis_url contract.
matches_praxis_url == false means that the hosts do not match or cannot be verified. It does not prove that raptor targets a different control plane. Keep confirmation before writes for every false result. Name two hosts and report a different control plane only when both parsed hosts differ.
internal/skillinstall/dummy.go#L233-L234: distinguish missing or invalid hosts from a confirmed mismatch.internal/render/preamble.go#L46-L46: use the same wording in the execution preamble.
📍 Affects 2 files
internal/skillinstall/dummy.go#L233-L234(this comment)internal/render/preamble.go#L46-L46
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@internal/skillinstall/dummy.go` around lines 233 - 234, Update the guidance
in internal/skillinstall/dummy.go lines 233-234 and internal/render/preamble.go
line 46 to align with matches_praxis_url: every false result must require
confirmation before any write, while naming both hosts and reporting a different
control plane only when both parsed hosts are present and differ; otherwise
describe the hosts as missing or unverifiable. Apply the same wording and
distinction in both generated guidance paths.
Summary
--urlfor new profileshttps://facets.cloudValidation
go test -race ./...go vet ./...git diff --checkSummary by CodeRabbit
New Features
Documentation
Bug Fixes