Skip to content

feat: add npm and pip packages with CI/CD auto-publish#33

Open
anonymousAAK wants to merge 17 commits into
perplexityai:mainfrom
anonymousAAK:main
Open

feat: add npm and pip packages with CI/CD auto-publish#33
anonymousAAK wants to merge 17 commits into
perplexityai:mainfrom
anonymousAAK:main

Conversation

@anonymousAAK
Copy link
Copy Markdown

  • Add npm wrapper package (bumblebee-scan) with postinstall binary download
  • Add PyPI wrapper package (bumblebee-scan) with CLI entrypoint
  • Extend release workflow to auto-publish to npm and PyPI on tag push
  • Update README with npm/pip install instructions

- Add npm wrapper package (bumblebee-scan) with postinstall binary download
- Add PyPI wrapper package (bumblebee-scan) with CLI entrypoint
- Extend release workflow to auto-publish to npm and PyPI on tag push
- Update README with npm/pip install instructions

Requires NPM_TOKEN and PYPI_TOKEN repository secrets.
Copilot AI review requested due to automatic review settings May 27, 2026 16:18
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds distributable wrappers so bumblebee can be installed via npm and pip, and updates the release workflow to publish those artifacts alongside GoReleaser releases.

Changes:

  • Introduces a PyPI package that downloads (or go installs) the bumblebee Go binary on first run.
  • Introduces an npm package with a postinstall binary downloader (fallback to go install) and a JS shim for bumblebee.
  • Extends the GitHub Actions release workflow to publish to npm and PyPI; updates root docs and ignores build artifacts.

Reviewed changes

Copilot reviewed 11 out of 13 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
pypi-package/pyproject.toml Defines Python package metadata and console script entrypoint.
pypi-package/bumblebee_scanner/cli.py Implements the Python CLI wrapper that ensures the Go binary is present.
pypi-package/bumblebee_scanner/init.py Exposes package version.
pypi-package/README.md Documents PyPI install/usage.
pypi-package/LICENSE Adds Apache 2.0 license for PyPI package.
npm-package/scripts/install.js Downloads/extracts the released binary during npm postinstall (fallback to go install).
npm-package/package.json Defines npm package metadata, postinstall, and bin entrypoint.
npm-package/bin/bumblebee.js Node shim that executes the installed binary.
npm-package/README.md Documents npm install/usage.
npm-package/LICENSE Adds Apache 2.0 license for npm package.
README.md Adds npm/pip install instructions to the main project README.
.gitignore Ignores npm/pip build artifacts.
.github/workflows/release.yml Publishes npm and PyPI packages based on the release tag.

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

version = "0.1.1"
description = "Supply-chain inventory collector for package, extension, and developer-tool metadata on macOS and Linux."
readme = "README.md"
license = "Apache-2.0"
Comment on lines +42 to +46
with tarfile.open(tmp.name, "r:gz") as tf:
member = tf.getmember("bumblebee")
member.name = "bumblebee"
tf.extract(member, path=str(bin_dir))
os.chmod(str(_bin_path()), 0o755)
Comment on lines +36 to +50

try:
bin_dir = _bin_dir()
bin_dir.mkdir(parents=True, exist_ok=True)
with tempfile.NamedTemporaryFile(suffix=".tar.gz", delete=False) as tmp:
urllib.request.urlretrieve(url, tmp.name)
with tarfile.open(tmp.name, "r:gz") as tf:
member = tf.getmember("bumblebee")
member.name = "bumblebee"
tf.extract(member, path=str(bin_dir))
os.chmod(str(_bin_path()), 0o755)
os.unlink(tmp.name)
return True
except Exception:
return False
const fs = require("fs");
const path = require("path");
const { execSync } = require("child_process");
const zlib = require("zlib");
Comment on lines +70 to +75
tar.on("close", (code) => {
if (code === 0) {
fs.chmodSync(binPath, 0o755);
resolve();
} else {
reject(new Error(`tar exited with ${code}`));
Comment thread npm-package/README.md Outdated
Comment on lines +1 to +8
# @perplexityai/bumblebee

npm wrapper for [bumblebee](https://github.com/perplexityai/bumblebee) — a read-only supply-chain inventory collector for package, extension, and developer-tool metadata on macOS and Linux.

## Install

```sh
npm install -g @perplexityai/bumblebee
Comment thread npm-package/README.md Outdated
Comment on lines +1 to +8
# @perplexityai/bumblebee

npm wrapper for [bumblebee](https://github.com/perplexityai/bumblebee) — a read-only supply-chain inventory collector for package, extension, and developer-tool metadata on macOS and Linux.

## Install

```sh
npm install -g @perplexityai/bumblebee
Merge upstream/main (Homebrew scanner, agent-skill scanner, ~/.claude.json
MCP inventory, offline OSV-to-catalog generator, Mini Shai-Hulud Red Hat
Cloud Services threat-intel catalog).

Bump all version references to 0.1.4 (VERSION, version.go default,
npm package.json + install.js, pypi pyproject + __init__ + cli.py).

Point npm/pip install scripts at this fork (anonymousAAK/bumblebee) where
the release CI uploads binaries, and make the goreleaser release non-draft
so npm/pip postinstall can download the published tarballs.

https://claude.ai/code/session_01DYdxAiByG5AscGpe7fxzdT
The test-packages workflow installed the published registry version instead
of the code under test, so it could never validate PR changes and kept
exercising the broken 0.1.3 release. Switch both jobs to install the local
npm/pip packages (with a checkout step) so CI tests the PR's own code.

Add network timeouts to the binary downloaders so a stalled connection
fails fast instead of hanging until the runner is killed (root cause of the
2-minute pip-install hang on ubuntu):
- cli.py: urlopen(timeout=30) + go install timeout=300
- install.js: https.get timeout=30s + execSync go install timeout=300s

Also align install.js go-install fallback/messages to use REPO.

https://claude.ai/code/session_01DYdxAiByG5AscGpe7fxzdT
CI (fix pip-install ubuntu hang):
- npm job installs with --ignore-scripts and pip job drops 'bumblebee --help'.
  With no published release in PR context, those steps force a binary
  download/go-install whose go-install fallback is non-deterministic in CI
  (hung ~2min and was SIGTERM'd on one runner). Smoke tests now just verify
  the packages build, install, and link their entrypoint.

Review findings:
- schema: add missing 'agent-skill' to the ecosystem enums in
  package-record and exposure-catalog schemas, so agent-skill records and
  catalog entries validate.
- npm/pip wrappers: split the release-binary source (this fork) from the Go
  module path used by the 'go install' fallback (canonical upstream module),
  so the fallback path is import-valid instead of a module-path mismatch.
- osvcatalog: unreadable/invalid files in a directory walk are now reported
  to stderr and skipped instead of aborting the whole import, matching the
  documented loadPath contract.
- osv test: correct a sort-order comment to match the assertions (npm before
  pypi).

https://claude.ai/code/session_01DYdxAiByG5AscGpe7fxzdT
systemRoots covers the shared Linux Homebrew prefix
(/home/linuxbrew/.linuxbrew) but not a non-sudo per-user install, which
lands in ~/.linuxbrew. Add ~/.linuxbrew/Cellar and ~/.linuxbrew/Caskroom
to the per-home baseline candidates so user-local Homebrew formulae and
casks are inventoried; absent paths are dropped by filterExistingRoots and
the existing */Cellar, */Caskroom classifier tags them as homebrew.

Resolves the baseline Homebrew coverage gap noted in review (the PR
description's '~/.local/Cellar' was not a real Homebrew location;
~/.linuxbrew is the actual per-user prefix).

https://claude.ai/code/session_01DYdxAiByG5AscGpe7fxzdT
Add Homebrew, agent-skill, and OSV catalog support
The release workflow only triggered on a v* tag push, which is awkward in
environments that cannot push tags. Add a workflow_dispatch trigger that:
- resolves the version from the input (or the VERSION file when omitted),
- creates and pushes the v<version> tag from CI (GITHUB_TOKEN-pushed tags
  do not re-trigger this workflow, so there is no double run),
- threads the resolved version to the npm/PyPI publish jobs via a job
  output instead of GITHUB_REF_NAME, so both the tag-push and dispatch
  paths publish the same version.

The existing tag-push path is unchanged.

https://claude.ai/code/session_01DYdxAiByG5AscGpe7fxzdT
Add an auto-release workflow that watches the VERSION file on main and,
when it changes to a version without an existing tag, dispatches the
release workflow for that version. The release workflow then creates the
tag and publishes to npm + PyPI, so all build/publish logic stays in one
place and manual tag/dispatch releases are unaffected.

Uses workflow_dispatch to start the release, which is the documented
exception to GITHUB_TOKEN not re-triggering workflows, so no PAT is
needed.

https://claude.ai/code/session_01DYdxAiByG5AscGpe7fxzdT
ci(release): add workflow_dispatch trigger for manual releases
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.

2 participants