feat: add bucket management actions#152
Draft
goanpeca wants to merge 1 commit into
Draft
Conversation
|
Build artifact for this PR: |
There was a problem hiding this comment.
Pull request overview
This PR expands the action’s command surface to include control-plane bucket administration, aligning the action with the B2 SDK’s bucket APIs and closing the linked issue’s acceptance criteria (create, list, delete empty buckets).
Changes:
- Adds
create-bucket,delete-bucket, andlist-bucketscommand implementations and dispatch paths, including bucket-specific outputs and step summaries. - Introduces
bucket-typeandbucket-infoinputs (with validation/parsing) to support bucket creation metadata. - Updates action metadata, README documentation, tests (dispatcher + output contract + command tests), and regenerates
dist/index.js.
Reviewed changes
Copilot reviewed 10 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/main.ts | Dispatches new bucket verbs, emits bucket outputs (bucket-*, bucket-count, buckets-listed) and summary-json for bucket results. |
| src/inputs.ts | Extends action enum, makes bucket optional only for list-buckets, adds bucket-type and bucket-info parsing/validation. |
| src/commands/buckets.ts | Implements SDK-backed create/delete/list bucket commands with grouped logging and structured results. |
| README.md | Documents the three new verbs, their inputs, and the new bucket-related outputs. |
| dist/index.js | Updates the bundled action entrypoint to include the new commands and input parsing changes. |
| action.yml | Exposes new verbs and inputs, adjusts bucket required-ness, and documents new outputs. |
| tests/main.test.ts | Extends dispatcher tests to cover the three new actions and their output expectations. |
| tests/main-output-contract.test.ts | Adds golden output-key sets for bucket actions and mocks the new command module. |
| tests/inputs.test.ts | Adds coverage for list-buckets bucket optionality, create-bucket parsing, and bucket-info validation. |
| tests/commands/buckets.test.ts | Adds simulator-backed integration tests for bucket create/list/delete behaviors. |
| tests/_parsed-inputs.ts | Extends parsed-input test helper defaults with bucketType and bucketInfo. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
create-bucket,delete-bucket, andlist-bucketsactions backed by the B2 SDK bucket APIsbucket-typeandbucket-infoparsing for bucket creation plus bucket-specific outputsdist/entrypointLinked issue
Closes #100
Tests run
pnpm typecheckpnpm exec vitest run __tests__/inputs.test.ts __tests__/commands/buckets.test.ts __tests__/main.test.ts __tests__/main-output-contract.test.tspnpm docs:check-action-ymlpnpm lintpnpm spellcheckpnpm testpnpm buildFollow-up notes
Advanced bucket settings such as CORS, lifecycle, default encryption, retention, and replication remain out of scope for this issue.