fix: tenant selector in configure and false update banner#33
Conversation
The Gemini CLI install instructions were a vague one-liner pointing at the Install section to install the binary manually first. With v0.0.11 the SessionStart hook is portable across Claude Code and Gemini CLI, so the binary auto-installs on the first session under Gemini exactly as it does under Claude. - Show the actual 'gemini extension install' command users should run. - Note the GitHub-Releases-asset 404 fallthrough and the 'git clone' fallback prompt (matches what users see today and what the docs hub gemini-cli.md describes). - State that the same SessionStart hook handles binary install and version pinning under Gemini — no manual install needed. Signed-off-by: Ben <ben@armosec.io>
Two bugs:
1. Interactive configure only prompted for api-url (dashboard host) but
never for api-base-url (the API host used by Whoami and every skill
command). US tenant users were stuck with the EU default api.armosec.io
and got Unauthorized on every call. Replace the raw URL text field with
a Tenant selector (EU / US / Custom) that sets both hosts consistently.
2. Goreleaser strips the v prefix (Version = "0.0.11") but the CDN
latest.txt contains "v0.0.11". semver.IsValid("0.0.11") returns false,
falling through to string != which always differs, showing a false
"0.0.11 -> v0.0.11" update notification. Normalize both versions with
ensureVPrefix before comparison.
Signed-off-by: Ben <ben@armosec.io>
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Free Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThis PR introduces tenant-aware credential configuration for interactive setup and normalizes version strings during update detection. It includes updates to README installation instructions, configuration handling with tenant-specific API endpoints, version comparison logic with prefix normalization, and supporting test coverage. ChangesConfiguration and Version Updates
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
There was a problem hiding this comment.
Pull request overview
Fixes two user-facing issues: interactive armoctl configure now correctly supports selecting the right tenant (EU/US) to set both api-base-url and api-url, and the update-check logic no longer reports a false update when the only difference is a missing/extra v prefix in version strings.
Changes:
- Replace the interactive configure prompt’s raw API URL input with a Tenant selector (EU/US/Custom), with Custom prompting for both host fields.
- Normalize version strings in the update checker via
ensureVPrefix()and extend tests to coverv-prefix mismatches. - Update README Gemini CLI instructions with the concrete
gemini extension install ...command and behavior notes.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| README.md | Clarifies Gemini CLI extension installation flow and removes the “install binary first” implication. |
| internal/version/version.go | Normalizes versions before semver comparison to avoid false update banners. |
| internal/version/version_test.go | Adds coverage for v-prefix/no-prefix version combinations. |
| internal/config/config.go | Adds tenant selection (EU/US/Custom) and ensures both API hosts are configured for the selected tenant. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Address Copilot review: avoid duplicating default host literals. Signed-off-by: Ben <ben@armosec.io>
Summary
armoctl configureonly prompted forapi-url(dashboard host), neverapi-base-url(API host). US tenant users gotUnauthorizedon every call because the EU defaultapi.armosec.iowas hardcoded. Replaced the raw URL field with a Tenant selector (EU / US / Custom). Custom reveals the raw URL fields for dev/staging overrides.vprefix (0.0.11) but CDNlatest.txtreturnsv0.0.11.semver.IsValid("0.0.11")→ false → string comparison always differs → false "0.0.11 -> v0.0.11" banner. AddedensureVPrefix()normalization.Test plan
armoctl configure→ select US tenant → Whoami succeeds with US credentialsarmoctl configure→ select Custom → second form appears with URL fields pre-filledarmoctl configure→ select EU → works as beforearmoctl inventory listafter US configure → no Unauthorizedvprefix)go test ./...passesSummary by CodeRabbit
Release Notes
Documentation
New Features
Bug Fixes