Skip to content

fix(deploy): check auth before init dialog#99

Merged
JosiahParry merged 4 commits intomainfrom
fix/deploy-check-auth-before-init
Mar 4, 2026
Merged

fix(deploy): check auth before init dialog#99
JosiahParry merged 4 commits intomainfrom
fix/deploy-check-auth-before-init

Conversation

@pat-s
Copy link
Copy Markdown
Member

@pat-s pat-s commented Mar 3, 2026

Summary

  • Move resolve_server call to before the _ricochet.toml check so users without an API key get an actionable error immediately, instead of going through the entire init dialog only to hit "No API key configured" at the end.
  • Show target server URL in the init prompt so users know where the deploy will go before answering.
  • Remove duplicate resolve_server call at the old location since server_config is already in scope.

fix #97

Move resolve_server call before the _ricochet.toml check so users without an API key get an actionable error immediately instead of going through the entire init dialog first. Also show the target server URL in the init prompt so users know where the deploy will go.
@pat-s pat-s requested a review from JosiahParry March 3, 2026 16:01
@JosiahParry
Copy link
Copy Markdown
Member

JosiahParry commented Mar 4, 2026

I've pulled out the preflight_key_check() from #63 and put it in here combining the language.

We can now use

let server_config = config.resolve_server(server_ref)?;
let client = RicochetClient::new(&server_config)?;
client.preflight_key_check().await?;

wherever we need to check a key.

Edit: some toml tests are failing—checking
Edit 2: just one auth failure related to ordering of tests

Copy link
Copy Markdown
Member

@JosiahParry JosiahParry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a helper preflight_key_check() that can be used in all auth-needed commands to ensure we don't have duplicate code.

Due to putting checks first, some tests failed. Addressed these failures with mocks and serial ordering.

@JosiahParry JosiahParry merged commit 9520a99 into main Mar 4, 2026
2 checks passed
@JosiahParry JosiahParry deleted the fix/deploy-check-auth-before-init branch March 4, 2026 19:30
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.

enh: UX during deploy should detect/warn if non-default server doesn't have any credential

2 participants