Skip to content

download: support file ID and range requests#138

Open
goanpeca wants to merge 7 commits into
mainfrom
feat/issue-97-download-file-id-range
Open

download: support file ID and range requests#138
goanpeca wants to merge 7 commits into
mainfrom
feat/issue-97-download-file-id-range

Conversation

@goanpeca

@goanpeca goanpeca commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add file-id and range inputs for download
  • route file-ID downloads through the SDK downloadById path and pass range to download calls
  • verify file-id metadata belongs to the configured bucket before streaming
  • keep file-ID metadata lookup keyed by file-id; source remains only a local filename hint
  • validate range and file-id inputs before logging or SDK use
  • cancel the download response body if local setup or piping fails after the response opens
  • omit content-sha1 for ranged downloads and document that whole-object SHA-1 verification is skipped for partial responses
  • update source docs/comments for ranged downloads, file-ID mode, and zero-length progress behavior

Closes #97

Tests

  • mamba run -n b2-action-issue-97 pnpm docs:check-action-yml
  • mamba run -n b2-action-issue-97 pnpm typecheck
  • mamba run -n b2-action-issue-97 pnpm lint
  • mamba run -n b2-action-issue-97 pnpm test __tests__/commands/upload-download.test.ts __tests__/inputs.test.ts
  • mamba run -n b2-action-issue-97 pnpm test __tests__/commands/upload-download.test.ts
  • mamba run -n b2-action-issue-97 pnpm test
  • mamba run -n b2-action-issue-97 pnpm build
  • mamba run -n b2-action-issue-97 pnpm spellcheck
  • git diff --check
  • pre-commit hook: lint, release provenance, typecheck, vitest, ncc build, cspell
  • pre-push hook: vitest --coverage

Follow-up notes

  • Parallel ranged download tuning with createReadStream remains out of scope for this issue.

Copilot AI review requested due to automatic review settings July 6, 2026 14:12
@goanpeca goanpeca added the enhancement New feature or request label Jul 6, 2026
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

Build artifact for this PR: build.tar.gz (valid 1 hour)

@goanpeca goanpeca added the sdk-parity SDK capability not yet exposed by the action label Jul 6, 2026
@goanpeca goanpeca self-assigned this Jul 6, 2026
@goanpeca goanpeca added this to the v1.2.0 milestone Jul 6, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the download command surface to support downloading an exact file version by file ID and requesting HTTP byte ranges, aligning the action’s interface with existing Backblaze SDK capabilities and documenting the SHA-1 output implications for partial responses.

Changes:

  • Add file-id and range inputs, parse them into ParsedInputs, and document them in README.md / action.yml.
  • Route file-ID downloads through the SDK downloadById path and pass range through to download calls.
  • Omit content-sha1 output for ranged downloads (since B2’s SHA-1 header is for the full object, not the partial body), with added tests for both features.

Reviewed changes

Copilot reviewed 7 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/inputs.ts Adds parsed fileId + range inputs and updates source docs to allow omission when downloading by ID.
src/commands/download.ts Implements download-by-ID routing, range pass-through, and skips contentSha1 for ranged downloads.
README.md Documents new inputs and clarifies SHA-1 behavior for ranged downloads.
action.yml Exposes file-id and range as action inputs and updates content-sha1 output description.
tests/inputs.test.ts Adds coverage for parsing file-id and range.
tests/commands/upload-download.test.ts Adds integration-style tests for downloading by file ID and for ranged downloads.
tests/_parsed-inputs.ts Updates test helper defaults to include fileId and range.
dist/index.js Updates the bundled build output to reflect source changes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/commands/download.ts Outdated
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

Build artifact for this PR: build.tar.gz (valid 1 hour)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 9 changed files in this pull request and generated no new comments.

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

Build artifact for this PR: build.tar.gz (valid 1 hour)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 9 changed files in this pull request and generated 1 comment.

Comment thread src/commands/download.ts Outdated
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

Build artifact for this PR: build.tar.gz (valid 1 hour)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 9 changed files in this pull request and generated 1 comment.

Comment thread src/commands/download.ts
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

Build artifact for this PR: build.tar.gz (valid 1 hour)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 9 changed files in this pull request and generated 1 comment.

Comment thread src/commands/download.ts
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

Build artifact for this PR: build.tar.gz (valid 1 hour)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 9 changed files in this pull request and generated no new comments.

@goanpeca
goanpeca marked this pull request as ready for review July 6, 2026 15:04
@goanpeca
goanpeca requested a review from jeronimodeleon as a code owner July 6, 2026 15:04
@goanpeca
goanpeca requested a review from sophiecarreras as a code owner July 6, 2026 15:04
Copilot AI review requested due to automatic review settings July 8, 2026 23:19
@goanpeca
goanpeca force-pushed the feat/issue-97-download-file-id-range branch from c7d9ee8 to a7d3242 Compare July 8, 2026 23:19
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

Build artifact for this PR: build.tar.gz (valid 1 hour)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 9 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request sdk-parity SDK capability not yet exposed by the action

Projects

None yet

Development

Successfully merging this pull request may close these issues.

download: support download by file-id and byte ranges

2 participants