Skip to content

fix(buckets): read camelCased enable-snapshots flag in create#120

Merged
designcode merged 1 commit into
mainfrom
fix/enable-snapshots-create
Jul 2, 2026
Merged

fix(buckets): read camelCased enable-snapshots flag in create#120
designcode merged 1 commit into
mainfrom
fix/enable-snapshots-create

Conversation

@designcode

@designcode designcode commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

What

buckets create --enable-snapshots never enabled snapshots — it created the bucket but silently left snapshots off. (mk --enable-snapshots was unaffected.)

Root cause

Commander passes flags to handlers as camelCase keys, so --enable-snapshots arrives as enableSnapshots. buckets/create.ts looked up only ['enable-snapshots', 's', 'S'] — missing the camelCase key — so the value was always undefined and enableSnapshot: enableSnapshots === true was always false. mk.ts already reads the camelCase key, which is why it worked there.

Fix

Add 'enableSnapshots' to the getOption lookup, matching mk.ts and the sibling enableDirectoryListing/sourceSnapshot reads.

Test

The existing "create with all flags" integration test passed --enable-snapshots but only asserted exit code, so it never caught this. Added a regression test that creates a bucket with --enable-snapshots and verifies snapshots are actually enabled via buckets get. Verified passing against the live backend.

🤖 Generated with Claude Code


Note

Low Risk
Small option-parsing fix in bucket create plus a new integration test; behavior change is limited to honoring an existing flag correctly.

Overview
Fixes buckets create --enable-snapshots so it actually turns snapshots on instead of succeeding with snapshots still disabled.

Commander exposes that flag to handlers as enableSnapshots, but buckets/create.ts only looked up kebab-case and short aliases, so the value was always missing and enableSnapshot was sent as false. The change adds enableSnapshots to the getOption list, consistent with other create flags and with mk.

Adds a CLI integration test that creates a bucket with --enable-snapshots and asserts buckets get shows snapshots enabled, since the prior “all flags” test only checked exit code.

Reviewed by Cursor Bugbot for commit f46ab4c. Bugbot is set up for automated code reviews on this repo. Configure here.

Commander delivers `--enable-snapshots` to handlers as the camelCased key
`enableSnapshots`, but `buckets create` only looked up
`enable-snapshots`/`s`/`S`, so the flag was never read and snapshots were
never enabled — the bucket was created with snapshots off. (`mk` reads
the camelCase key, which is why it worked there.)

Add `enableSnapshots` to the lookup, matching mk.ts and the sibling
enableDirectoryListing/sourceSnapshot reads. Adds an integration test
that verifies snapshots are actually enabled via `buckets get`; the
existing "create with all flags" test only asserted exit code and so
missed this.

Assisted-by: Claude Opus 4.8 via Claude Code
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@designcode designcode merged commit 8e1e1e6 into main Jul 2, 2026
3 checks passed
@designcode designcode deleted the fix/enable-snapshots-create branch July 2, 2026 11:45
designcode added a commit that referenced this pull request Jul 2, 2026
Seed the first Changesets release: a minor for the `buckets rebase` /
`buckets merge` commands (#119) and a patch for the `buckets create
--enable-snapshots` fix (#120) — both merged to main but unreleased
since v3.3.0. Together they cut 3.4.0 once this lands.

Assisted-by: Claude Opus 4.8 via Claude Code
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
designcode added a commit that referenced this pull request Jul 2, 2026
)

* chore: migrate release tooling from semantic-release to changesets

Replace semantic-release with Changesets for versioning and publishing:

- Add @changesets/cli + @changesets/changelog-github and .changeset
  config (public access, github changelog, baseBranch main). Set the
  package version to the real base 3.3.0.
- Rework release.yaml: stable releases run on push to main via the
  changesets action (Version Packages PR -> publish -> v<version> tag,
  GitHub release, binaries, Homebrew). Beta prereleases publish an npm
  snapshot to the `beta` dist-tag on manual workflow_dispatch only.
- Drop the release-branch flow: delete sync-release-to-main.yaml.
- npm publishing stays on OIDC / provenance (auth unchanged); keeping
  the release.yaml filename preserves the trusted-publisher config.

Also drop commitlint (no longer needed now that commits don't drive
versioning) and sweep unused dev dependencies:

- Remove @commitlint/cli, @commitlint/config-conventional, the
  commitlint config block, and the .husky/commit-msg hook.
- Remove conventional-changelog-conventionalcommits, orphaned by the
  semantic-release removal.

Assisted-by: Claude Opus 4.8 via Claude Code
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* chore: add changesets for pending fork commands and enable-snapshots fix

Seed the first Changesets release: a minor for the `buckets rebase` /
`buckets merge` commands (#119) and a patch for the `buckets create
--enable-snapshots` fix (#120) — both merged to main but unreleased
since v3.3.0. Together they cut 3.4.0 once this lands.

Assisted-by: Claude Opus 4.8 via Claude Code
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* ci: gate npm publish on integration tests in the release job

The stable release job dropped `npm run test:integration`, so a Version
Packages merge could publish to npm without integration passing (ci.yaml
runs it only in parallel). Re-add it in the release job, gated to pushes
with no pending changesets — i.e. exactly the publish push — so it gates
the publish without running on every feature merge.

Assisted-by: Claude Opus 4.8 via Claude Code
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

2 participants