Name the S3 keys when storage_url moves to s3:// first (closes #428) #454

Merged
clawbot merged 1 commits from issue-428-s3-keys-before-storage-url into next 2026-11-11 06:48:46 +01:00
Collaborator

Fixes #428.

On a config that loads with a file:// destination, vaultik config set storage_url "s3://..." is still refused, because the result would not load without S3 credentials. The refusal now ends with set s3.access_key_id and s3.secret_access_key first, then storage_url. Both keys can be set while the old file:// URL is in place.

  • internal/config: the two credential errors are exported as ErrS3KeyIDRequired and ErrS3SecretRequired so config set can recognise them with errors.Is.
  • internal/cli: the hint is added only when the key being set is storage_url. Clearing a credential key gives the plain refusal.
  • Tests: the refusal names the keys for a missing key ID and for a missing secret. Setting the keys and then storage_url succeeds on a loading file:// config.

README is unchanged: its "Restoring on another machine" order is still correct on the config config init writes.

Model: opus-5-5

Fixes https://git.eeqj.de/sneak/vaultik/issues/428. On a config that loads with a `file://` destination, `vaultik config set storage_url "s3://..."` is still refused, because the result would not load without S3 credentials. The refusal now ends with `set s3.access_key_id and s3.secret_access_key first, then storage_url`. Both keys can be set while the old `file://` URL is in place. - `internal/config`: the two credential errors are exported as `ErrS3KeyIDRequired` and `ErrS3SecretRequired` so `config set` can recognise them with `errors.Is`. - `internal/cli`: the hint is added only when the key being set is `storage_url`. Clearing a credential key gives the plain refusal. - Tests: the refusal names the keys for a missing key ID and for a missing secret. Setting the keys and then `storage_url` succeeds on a loading `file://` config. README is unchanged: its "Restoring on another machine" order is still correct on the config `config init` writes. Model: opus-5-5
clawbot added the needs-review label 2026-11-11 05:24:43 +01:00
clawbot self-assigned this 2026-11-11 05:24:43 +01:00
Author
Collaborator

FAIL (needs-rework)

  1. internal/cli/config_test.go: no test covers the key == storageURLKey condition in wouldNotLoadError (internal/cli/config.go). The PR body says clearing a credential key gives the plain refusal, but nothing checks it: with the condition dropped, config set s3.access_key_id "" on a config with an s3:// storage_url would tell the user to set the key they just cleared, and every test would still pass. Acceptable: a test that writes a config that loads with an s3:// storage_url and both keys set, runs writeConfigSet setting s3.access_key_id to "", and checks that the change is refused, the file is unchanged, and errors.Is(err, errSetS3KeysFirst) is false.

Model: opus-5-5

FAIL (`needs-rework`) 1. `internal/cli/config_test.go`: no test covers the `key == storageURLKey` condition in `wouldNotLoadError` (`internal/cli/config.go`). The PR body says clearing a credential key gives the plain refusal, but nothing checks it: with the condition dropped, `config set s3.access_key_id ""` on a config with an `s3://` `storage_url` would tell the user to set the key they just cleared, and every test would still pass. Acceptable: a test that writes a config that loads with an `s3://` `storage_url` and both keys set, runs `writeConfigSet` setting `s3.access_key_id` to `""`, and checks that the change is refused, the file is unchanged, and `errors.Is(err, errSetS3KeysFirst)` is false. Model: opus-5-5
Author
Collaborator

For the reworker: fix the finding of #454 (comment) as its "Acceptable" line says, and change nothing else. Rebase onto current origin/next, run make fmt and make check, push with --force-with-lease, and reply here with one line.

For the next reviewer: check that finding against the rework, and anything the rework broke.

Model: opus-5-5

For the reworker: fix the finding of https://git.eeqj.de/sneak/vaultik/pulls/454#issuecomment-177573 as its "Acceptable" line says, and change nothing else. Rebase onto current `origin/next`, run `make fmt` and `make check`, push with `--force-with-lease`, and reply here with one line. For the next reviewer: check that finding against the rework, and anything the rework broke. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-11-11 06:07:02 +01:00
clawbot added 1 commit 2026-11-11 06:21:45 +01:00
On a config that loads, `config set storage_url s3://...` is refused
until `s3.access_key_id` and `s3.secret_access_key` are set. The refusal
now says to set those two keys first, then `storage_url`.

Model: opus-5-5
clawbot force-pushed issue-428-s3-keys-before-storage-url from 45d758e08e to f2138dafc8 2026-11-11 06:21:45 +01:00 Compare
Author
Collaborator
  1. Fixed as the "Acceptable" line says: TestConfigSetRefusesClearingS3Key in internal/cli/config_test.go; it fails when the key == storageURLKey condition is dropped.

Model: opus-5-5

1. Fixed as the "Acceptable" line says: `TestConfigSetRefusesClearingS3Key` in `internal/cli/config_test.go`; it fails when the `key == storageURLKey` condition is dropped. Model: opus-5-5
clawbot added needs-review and removed needs-rework labels 2026-11-11 06:23:24 +01:00
Author
Collaborator

PASS: when config set storage_url to an s3:// URL is refused for a missing S3 key, the refusal now says to set s3.access_key_id and s3.secret_access_key first, and the earlier finding is fixed.

Judgement call: README.md is unchanged, since the plan on #428 limited the fix to the refusal.

Model: opus-5-5

PASS: when `config set storage_url` to an `s3://` URL is refused for a missing S3 key, the refusal now says to set `s3.access_key_id` and `s3.secret_access_key` first, and the earlier finding is fixed. Judgement call: `README.md` is unchanged, since the plan on https://git.eeqj.de/sneak/vaultik/issues/428 limited the fix to the refusal. Model: opus-5-5
clawbot merged commit 5f1f8c4f66 into next 2026-11-11 06:48:46 +01:00
clawbot deleted branch issue-428-s3-keys-before-storage-url 2026-11-11 06:48:46 +01:00
Sign in to join this conversation.