Skip to content

feature: use bun archive instead of tar package - #678

Open
C4illin wants to merge 3 commits into
mainfrom
feature/use-bun-archive
Open

C4illin wants to merge 3 commits into
mainfrom
feature/use-bun-archive

Conversation

@C4illin

@C4illin C4illin commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

Summary by cubic

Replaces the tar package with Bun's native Archive API for creating download archives, removing the external dependency. Archives are written to disk at the job output path.

  • Archive entries are now stored without the ./ prefix, so download listings and tests no longer include it.
  • Hidden files are now included in the archive.
  • Tests were updated to read archives via Bun.Archive directly.

Written for commit dc26689. Summary will update on new commits.

View guided diff Turn on auto-fix

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 4 files

Tip: Get a Slack DM when cubic finishes reviewing your PRs. Connect Slack

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread src/pages/download.tsx Outdated
Comment thread src/pages/download.tsx Outdated
C4illin and others added 2 commits October 20, 2026 01:05
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 issue found across 1 file (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/pages/download.tsx">

<violation number="1" location="src/pages/download.tsx:62">
P2: Concurrent requests to `/archive/:jobId` write the same archive path, so one response can stream a partially written or truncated tar. Write to a unique temp file and `rename` it into place. The temp file also needs to be excluded from the glob so other requests don't pack it.</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread src/pages/download.tsx
files[file] = Bun.file(path.join(outputPath, file));
}
}
await Bun.Archive.write(outputTar, files);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2: Concurrent requests to /archive/:jobId write the same archive path, so one response can stream a partially written or truncated tar. Write to a unique temp file and rename it into place. The temp file also needs to be excluded from the glob so other requests don't pack it.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At src/pages/download.tsx, line 62:

<comment>Concurrent requests to `/archive/:jobId` write the same archive path, so one response can stream a partially written or truncated tar. Write to a unique temp file and `rename` it into place. The temp file also needs to be excluded from the glob so other requests don't pack it.</comment>

<file context>
@@ -50,21 +50,17 @@ export const download = new Elysia()
-          "Content-Type": "application/x-tar",
-        },
-      });
+      await Bun.Archive.write(outputTar, files);
+      return Bun.file(outputTar);
     },
</file context>

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.

1 participant