Skip to content

Download prebuilt binaries in the Herdr plugin build - #91

Merged
powerfooI merged 3 commits into
mainfrom
feat/plugin-prebuilt
Sep 3, 2026
Merged

Download prebuilt binaries in the Herdr plugin build#91
powerfooI merged 3 commits into
mainfrom
feat/plugin-prebuilt

Conversation

@powerfooI

Copy link
Copy Markdown
Owner

Summary

  • build verb now downloads the checksum-verified prebuilt release archive (herdr-gui-<platform>.tar.xz) matching the checkout's package.json version instead of running bun install + compile — plugin users no longer need any source toolchain; the frozen manifest argv is unchanged
  • Compiling from source remains available as the build-source verb for development
  • ensureBinary/service became async to await downloads; the panel guards against re-entrant service keys while a download is in flight
  • New unit tests for the release asset mapping and sha256 parsing; manifest and deployment docs updated ("no source toolchain needed")

Verification

  • bun run format / lint / typecheck / test — 875 tests pass
  • End to end: bun scripts/studio-plugin.ts build downloaded v0.5.0 darwin-arm64, verified the checksum, and installed a working binary in ~5s (vs ~1min compile)
  • panel and url paths regression-checked against the downloaded binary

Known boundary

  • The action shim itself still runs on Bun (single cross-platform entry point); removing that runtime dependency would mean baking the verbs into the binary and is a separate decision
  • build requires the matching release to exist and fails with a clear error otherwise

The plugin build step now downloads the checksum-verified release
archive matching the checkout version instead of compiling from source,
so plugin users no longer need a source toolchain or dependency
installs; a full obtain cycle takes seconds. Compiling remains
available as the build-source verb for development. The frozen manifest
argv is unchanged.
@github-actions github-actions Bot added the enhancement New feature or request label Sep 3, 2026
downloadPrebuilt now catches fetch and extraction exceptions and
returns a friendly error with exit code 1 instead of an unhandled
rejection, which in the panel also left the terminal in raw mode. The
panel additionally skips rendering when its session was cleaned up
while a download was in flight.
@powerfooI
powerfooI marked this pull request as ready for review September 3, 2026 13:58
Copilot AI lite review requested due to automatic review settings September 3, 2026 13:58

Copilot AI 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.

🟡 Changes recommended

There are correctness and diagnosability issues in the new download path (SHA parsing too strict and tar extraction failures can produce empty/unclear errors) that should be addressed before approval.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR updates the Herdr plugin shim (scripts/studio-plugin.ts) so build installs a checksum-verified, prebuilt Herdr Studio binary from the matching GitHub release instead of compiling from source, while keeping a build-source verb for development workflows.

Changes:

  • Added release asset mapping + SHA256 parsing and implemented a download/verify/extract/install path for build.
  • Made binary acquisition/service invocations async and added a re-entrancy guard in the interactive panel.
  • Added unit tests for asset mapping and SHA256 parsing; updated plugin and deployment documentation to reflect the new no-toolchain behavior.
File summaries
File Description
scripts/studio-plugin.ts Implements downloading and installing prebuilt release binaries; adds new build-source verb and async service flow.
scripts/studio-plugin.test.ts Adds unit tests for platform→asset mapping and SHA256 parsing.
herdr-plugin.toml Updates plugin documentation/comments to describe downloading prebuilt binaries and build-source.
docs/DEPLOYMENT.md Updates deployment docs to reflect that plugin installs use prebuilt binaries (Bun still required for the shim).
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread scripts/studio-plugin.ts
Comment thread scripts/studio-plugin.ts
spawnSync sets error and a null status when tar cannot be spawned, so
check extract.error first and name the requirement, and include the
exit status in non-zero extraction failures.
Copilot AI review requested due to automatic review settings September 3, 2026 14:06
@powerfooI
powerfooI merged commit de2e438 into main Sep 3, 2026
2 checks passed
@powerfooI
powerfooI deleted the feat/plugin-prebuilt branch September 3, 2026 14:09

Copilot AI 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.

🟡 Changes recommended

The download/extraction flow should be tightened to extract only the expected tar member, and the new “maps every supported platform” unit test currently doesn’t actually cover all supported platform mappings.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

scripts/studio-plugin.test.ts:26

  • This test claims to cover "every supported platform", but it currently doesn’t assert the darwin-x64 and linux-arm64 entries from PLATFORM_ASSETS. Either add those assertions or rename the test so it matches what’s actually covered.
  • Files reviewed: 4/4 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread scripts/studio-plugin.ts
Comment on lines +137 to +139
const extract = spawnSync("tar", ["-xJf", archivePath, "-C", tmp], {
encoding: "utf8",
});
@powerfooI powerfooI mentioned this pull request Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants