Skip to content

feat(stream): import - #224

Open
jamie-at-bunny wants to merge 17 commits into
mainfrom
feat/stream-import
Open

feat(stream): import#224
jamie-at-bunny wants to merge 17 commits into
mainfrom
feat/stream-import

Conversation

@jamie-at-bunny

Copy link
Copy Markdown
Member

No description provided.

amir-at-bunny and others added 4 commits September 11, 2026 08:37
…face Stream error messages

Verbose debug logging read every request body as JSON, which would buffer
an entire video into memory on octet-stream uploads; non-JSON bodies are
now described from their headers instead. Error extraction also learns the
Stream API's StatusModel shape (lowercase message), so 400/422/429 responses
carry the API's explanation instead of a generic HTTP error.
@bunnynet-devops

Copy link
Copy Markdown

@codex review

@greptile-apps

greptile-apps Bot commented Sep 11, 2026

Copy link
Copy Markdown

Too many files changed for review (134 files, 100 file limit).

Bypass the limit by tagging @greptile-apps to review.

@changeset-bot

changeset-bot Bot commented Sep 11, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 15f2adb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 14 packages
Name Type
@bunny.net/cli Minor
@bunny.net/stream-import Minor
@bunny.net/stream-import-vimeo Minor
@bunny.net/stream-import-s3 Minor
@bunny.net/stream-import-wistia Minor
@bunny.net/stream-import-mux Minor
@bunny.net/stream-import-cloudflare Minor
@bunny.net/stream-import-jwplayer Minor
@bunny.net/stream-import-brightcove Minor
@bunny.net/cli-darwin-arm64 Minor
@bunny.net/cli-darwin-x64 Minor
@bunny.net/cli-linux-arm64 Minor
@bunny.net/cli-linux-x64 Minor
@bunny.net/cli-windows-x64 Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-11T08:36:54.793417Z f47e145 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Comment thread packages/stream-import-s3/src/keys.ts Fixed
Comment thread packages/stream-import/src/http.ts Fixed
Comment thread packages/stream-import/src/sanitize.ts Fixed
@jamie-at-bunny

Copy link
Copy Markdown
Member Author

@greptile review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f47e14568b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/stream-import/src/migration.ts Outdated
Comment thread packages/cli/src/commands/stream/import.ts Outdated
Comment thread packages/stream-import/src/migration.ts Outdated
Comment thread packages/stream-import/src/rate-limit.ts Outdated
Comment thread packages/cli/src/commands/stream/import.ts Outdated
Comment thread packages/stream-import-s3/src/plugin.ts Outdated
Comment on lines +18 to +21
// Credentials are optional: omitting them uses the AWS default chain, which is how this runs on instance roles.
accessKeyId: z.string().optional(),
secretAccessKey: z.string().optional(),
sessionToken: z.string().optional(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reject half-configured static AWS credentials

The schema accepts accessKeyId and secretAccessKey independently, but S3SourceClient uses the pair only when both are present and otherwise silently selects the ambient AWS credential chain. If a user accidentally sets only one variable while a profile or instance role is available, the import runs as that unrelated principal instead of reporting the incomplete credential pair; refine the schema so both keys must be supplied together or both omitted.

Useful? React with 👍 / 👎.

Comment on lines +77 to +79
const playbackId =
asset.playback_ids?.find((p) => p.policy === "public")?.id ??
asset.playback_ids?.[0]?.id;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Do not treat signed Mux playback IDs as public URLs

When an asset has no public playback ID, this fallback selects the first ID even if its policy is signed, then constructs an unsigned stream.mux.com URL from it. Bunny cannot fetch that URL without a playback JWT, so signed-only Mux assets fail even when a temporary master URL could be used below; only select a public playback ID here or implement signing before using a signed one.

Useful? React with 👍 / 👎.

Comment thread packages/cli/src/commands/stream/import-setup.ts Outdated
Comment thread packages/stream-import/src/bunny-stream.ts
Comment on lines +280 to +285
if (!body?.id) {
return {
success: false,
error:
"Bunny accepted the fetch but returned no video ID, so the video cannot be tracked or de-duplicated.",
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Handle successful fetch responses that contain no video ID

The committed Stream OpenAPI contract types this endpoint's response as StatusModel, which contains only success, message, and statusCode, and the sibling queueVideoFetch() helper also documents that no GUID is returned. A conforming successful response therefore enters this branch after Bunny has already queued the fetch, records the video as failed, and leaves an untagged orphan that a later run can duplicate; use a fetch flow that deterministically obtains the created GUID instead of requiring an undocumented id field.

Useful? React with 👍 / 👎.

…ts cancel their work; 429 replays get a fresh deadline
…com URL; signed-only assets fall through to the master
…m endpoint is configurable and its host is validated
…nks tagged videos by Bunny status, and a saved run can be refreshed against Bunny
…with live progress, and import status shows Bunny's progress
… that died before tagging; refresh flags videos stalled at zero bytes
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.

4 participants