feat: add list-versions action#133
Closed
goanpeca wants to merge 3 commits into
Closed
Conversation
|
Build artifact for this PR: |
There was a problem hiding this comment.
Pull request overview
Adds a new list-versions action to enumerate all Backblaze B2 file versions under a prefix (including historical uploads and hide markers) and to emit per-version metadata via summary-json, with dispatcher wiring, docs, tests, and bundled dist updates.
Changes:
- Introduces
listVersionsCommandpowered byBucket.paginateFileVersions()and wires it into the main dispatcher. - Extends inputs/outputs/docs to include
action: list-versionsand clarifiesmax-results/ truncation behavior. - Adds unit/integration coverage and updates
dist/index.jsto matchsrc.
Reviewed changes
Copilot reviewed 8 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/main.ts | Dispatches action: list-versions, emits outputs, warnings, and step summary rows. |
| src/inputs.ts | Registers list-versions as a valid action and defines its effect as read-only. |
| src/commands/list.ts | Adds ListedFileVersion / ListVersionsResult and implements listVersionsCommand. |
| README.md | Documents the new verb, example usage, and summary-json shape for list-versions. |
| action.yml | Updates action input/output descriptions to include list-versions. |
| tests/main.test.ts | Adds dispatcher test coverage for list-versions summaries/outputs. |
| tests/main-output-contract.test.ts | Extends output-key contract to include list-versions. |
| tests/commands/list-hide-verify.test.ts | Adds integration tests for version enumeration and truncation behavior. |
| dist/index.js | Updates bundled output to include the new action and command logic. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Build artifact for this PR: |
|
Build artifact for this PR: |
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
action: list-versionsto enumerate every B2 file version under thesourceprefix, including hide markers and historical uploads.fileId,action,uploadTimestamp,contentLength, and related metadata insummary-json.max-resultstruncation, rejectslist-versionsrequests above 10000 before pagination, forwards cancellation signals, and requests one extra page item when possible to detect truncation efficiently.distoutput.Linked issue
Closes #93
Tests run
pnpm lintpnpm typecheckpnpm docs:check-action-ymlpnpm exec vitest run __tests__/commands/list-hide-verify.test.ts __tests__/main.test.ts __tests__/main-output-contract.test.tspnpm exec vitest run __tests__/commands/list-hide-verify.test.tspnpm testpnpm buildpnpm verify-distpnpm spellcheckvitest --coverageFollow-up notes