Skip to content

fix(s3): configure profile picker + rebuild mv wizard on the shared engine#46

Merged
hi-lei merged 3 commits into
mainfrom
hotfix/s3-configure-profile-picker
Jun 2, 2026
Merged

fix(s3): configure profile picker + rebuild mv wizard on the shared engine#46
hi-lei merged 3 commits into
mainfrom
hotfix/s3-configure-profile-picker

Conversation

@hi-lei
Copy link
Copy Markdown
Collaborator

@hi-lei hi-lei commented Jun 1, 2026

Two related S3 interactive-wizard UX improvements.

1. s3 configure — pick existing profile or create new

The configure wizard's first step was a free-text profile prompt that had no awareness of existing profiles — confusing when you already have default/production set up, and easy to write S3 keys into the wrong section.

Replaced with a Select: lists existing profiles (each tagged "S3 configured" / "no S3 credentials yet") plus "+ Create new profile…" (which reveals a conditional name prompt), defaulting the selection to the active profile (--profile / VERDA_PROFILE / verda auth use). --profile <name> still pre-sets and skips the picker.

2. s3 mv — rebuilt on the shared wizard engine (matches configure)

mv's interactive wizard was hand-rolled (manual "Step N of M" headers, intro banner, per-prompt hint bars). Rebuilt on the verdagostack wizard engine, exactly like configure: progress bar + engine-rendered hint bar + exit-confirmation on Ctrl+C.

  • Steps: source bucket → source object → destination bucket (pick or "+ Create new bucket…") → destination key, using dynamic Loaders (the object list depends on the chosen bucket).
  • A source fixed by an argument (s3 mv s3://b/key) pre-sets and skips those steps.
  • Selection, confirm, bucket creation, and the move run around engine.Run, mirroring configure's save-after-wizard.
  • Removes the hand-rolled helpers (navIdx, selectStep, moveConfirmStep, printMoveStep, buildMoveSteps, selectObjectKey, pickSourceBucket).

Notes & testing

  • configure write-vs-read profile asymmetry documented in the README; the picker defaulting to the active profile keeps them aligned.
  • New tests: TestProfileChoices*, TestBuildMoveFlow_CollectsSelections, TestFinalizeMove_S3ToS3; updated the buildConfigureFlow wizard tests for the Select/create-new path.
  • make build, make test, and make lint (0 issues) all pass — verified against CI's pinned golangci-lint v2.5.0.

🤖 Generated with Claude Code

hi-lei and others added 2 commits June 1, 2026 18:36
The configure wizard's first step was a free-text profile prompt that ignored
existing profiles — confusing when you already have default/production set up.
Replace it with a Select of existing profiles (each tagged "S3 configured" /
"no S3 credentials yet") plus "+ Create new profile…", defaulting the selection
to the active profile. A conditional new-name step prompts only when creating.

--profile and the other flags are unaffected (a preset profile skips the picker).
The new-name step's Resetter is a no-op so skipping it (existing profile) doesn't
clobber the chosen profile back to the default.

Adds profileChoices + tests; updates the wizard-flow docs in README.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The mv interactive wizard was hand-rolled (manual "Step N of M" headers + intro
banner + per-prompt hint bars). Rebuild it on the verdagostack wizard engine,
exactly like `s3 configure`: progress bar + engine-rendered hint bar +
exit-confirmation on Ctrl+C.

Steps — source bucket → source object → dest bucket (pick or "+ Create new
bucket…") → dest key — use dynamic Loaders; the source-object list depends on
the chosen bucket via the store. A source fixed by an argument pre-sets and
skips those steps. Source selection, confirm, bucket creation, and the move run
around engine.Run, mirroring configure's save-after-wizard.

Removes the now-unused hand-rolled helpers (navIdx, selectStep, moveConfirmStep,
printMoveStep, buildMoveSteps, the step consts, plus selectObjectKey /
pickSourceBucket in picker.go). New tests: TestBuildMoveFlow_CollectsSelections
(engine drives the steps into state) and TestFinalizeMove_S3ToS3 (confirm →
CopyObject + DeleteObject), replacing the old hand-rolled wizard tests.

make build / make lint (0 issues, incl. CI's golangci-lint v2.5.0) / make test pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@hi-lei hi-lei changed the title fix(s3): pick existing profile or create new in s3 configure wizard fix(s3): configure profile picker + rebuild mv wizard on the shared engine Jun 1, 2026
… get keys

- DefaultEndpoint is now https://objects.fin-03.verda.storage (replacing the
  stale s3.verda.cloud placeholder) — the configure wizard's pre-filled endpoint
  and the client fallback when none is set.
- The wizard pre-fills the endpoint (Enter to accept) and region (us-east-1), so
  the user typically only picks a profile and pastes the access key + secret.
- configure now triggers the wizard only when a key is missing; the endpoint
  defaults when omitted, so `configure --access-key X --secret-key Y` is fully
  non-interactive.
- Tell users where to create keys (dashboard: log in -> project ->
  Project management -> Credentials -> Object Storage Access Keys) in --help and
  a note printed at the start of the wizard.

Test: TestConfigureFlagMode_DefaultsEndpointAndRegion.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@hi-lei hi-lei merged commit b5329fd into main Jun 2, 2026
12 checks passed
@hi-lei hi-lei deleted the hotfix/s3-configure-profile-picker branch June 2, 2026 07:14
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