Skip to content

ci(release): fail closed when npm pack reports no tarball - #69

Open
yakimoto wants to merge 3 commits into
mainfrom
ci/pack-fail-closed
Open

ci(release): fail closed when npm pack reports no tarball#69
yakimoto wants to merge 3 commits into
mainfrom
ci/pack-fail-closed

Conversation

@yakimoto

@yakimoto yakimoto commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

The e2e-smoke gate could pass without ever exercising the tarball it exists to
exercise:

TARBALL="$(npm pack --silent | tail -n1)"
TARBALL="$PWD/$TARBALL"
npm install --no-save "$TARBALL"

Some npm versions suppress the emitted filename on stdout under --silent. When
that happens TARBALL is empty, $PWD/ is a DIRECTORY, and npm install
happily installs the workspace directory instead. Every assertion after it
then passes -- against the working tree, not against the packed artifact. The
gate goes green having proved nothing about what would actually ship.

That is the same fail-open shape as a swallowed error: the check does not
fail, it stops being a check.

Replaced with npm pack --json, whose filename field is not
verbosity-dependent, plus two assertions -- the value ends in .tgz, and the
file exists on disk.

Verified both directions rather than just the happy path:

happy path PACK OK -> wave-av-adk-1.0.2.tgz exit 0
empty TARBALL ::error::npm pack --json reported '', not
a .tgz filename exit 1

A guard that has never been observed rejecting anything is not yet a guard.

Credit where it is due: a peer found this in the mcp-server copy of the same
workflow (bb1bf17) and fixed it there. I had written the --silent version and
copied it across repos, so this propagates their fix to the two that still
carry it.


Note

Low Risk
CI-only change to release workflow tarball detection; no runtime or publish logic changes beyond making the existing smoke gate fail closed.

Overview
The release e2e-smoke step no longer derives the pack filename from npm pack --silent | tail -n1, which could leave TARBALL empty on some npm versions and let npm install succeed against the workspace directory instead of a .tgz.

It now uses npm pack --json, parses the filename field with a small Node one-liner, and fails the job if the name does not end in .tgz or the file is missing on disk—so the smoke test always installs the real packed artifact before CJS/ESM/bin checks run.

Reviewed by Cursor Bugbot for commit 37094b3. Configure here.


Summary by cubic

Makes the release e2e-smoke step fail closed and always test the real packed tarball. Uses npm pack --json with guards so we never install the workspace directory by accident.

  • Bug Fixes
    • Parse tarball filename from JSON via a Node one-liner.
    • Require .tgz suffix and verify file exists; otherwise exit 1.
    • Install the verified tarball path, not the workspace.

Written for commit 37094b3. Summary will update on new commits.

Review in cubic

Note

Fail the release e2e-smoke step when npm pack does not produce a valid tarball

  • Replaces npm pack --silent | tail -n1 with npm pack --json piped through a Node script that extracts the first filename field, making tarball capture reliable across npm versions.
  • Adds validation that the result ends with .tgz and that the file exists on disk, emitting GitHub Actions error annotations and exiting non-zero on failure.
  • Risk: any environment where npm pack --json output differs from expectations will now fail the job explicitly rather than silently falling back to a directory install.

Macroscope summarized 37094b3.

The e2e-smoke gate could pass without ever exercising the tarball it exists to
exercise:

  TARBALL="$(npm pack --silent | tail -n1)"
  TARBALL="$PWD/$TARBALL"
  npm install --no-save "$TARBALL"

Some npm versions suppress the emitted filename on stdout under --silent. When
that happens TARBALL is empty, `$PWD/` is a DIRECTORY, and `npm install`
happily installs the workspace directory instead. Every assertion after it
then passes -- against the working tree, not against the packed artifact. The
gate goes green having proved nothing about what would actually ship.

That is the same fail-open shape as a swallowed error: the check does not
fail, it stops being a check.

Replaced with `npm pack --json`, whose filename field is not
verbosity-dependent, plus two assertions -- the value ends in .tgz, and the
file exists on disk.

Verified both directions rather than just the happy path:

  happy path    PACK OK -> wave-av-adk-1.0.2.tgz            exit 0
  empty TARBALL ::error::npm pack --json reported '', not
                a .tgz filename                             exit 1

A guard that has never been observed rejecting anything is not yet a guard.

Credit where it is due: a peer found this in the mcp-server copy of the same
workflow (bb1bf17) and fixed it there. I had written the --silent version and
copied it across repos, so this propagates their fix to the two that still
carry it.
@changeset-bot

changeset-bot Bot commented Aug 2, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: d454835

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

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

@cursor

cursor Bot commented Aug 2, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_5f32e8f7-e5c9-4c18-befa-6334adedb6cd)

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 25 minutes

Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 745d7481-e837-4d8c-87c3-76b22405b4b9

📥 Commits

Reviewing files that changed from the base of the PR and between 43084ea and 37094b3.

📒 Files selected for processing (1)
  • .github/workflows/release.yml

Comment @coderabbitai help to get the list of available commands.

@devin-ai-integration devin-ai-integration 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.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@yakimoto

yakimoto commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Context for the review: this propagates a fail-open fix a peer found in the mcp-server copy of this same workflow (bb1bf17). The e2e-smoke used TARBALL="$(npm pack --silent | tail -n1)"; some npm versions suppress that filename under --silent, leaving TARBALL empty so npm install "$PWD/" installs the workspace DIRECTORY and every downstream assertion passes against the working tree rather than the packed artifact. Replaced with npm pack --json plus two assertions (ends in .tgz, exists on disk). Both directions were exercised, not just the happy path.

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

@yakimoto I will review the release workflow change and verify that the e2e-smoke step fails when it cannot use a packed .tgz artifact.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cursor

cursor Bot commented Aug 2, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_50390b38-143e-47b7-b4e0-f6b56d871133)

@yakimoto

yakimoto commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

(Re-requesting against the new head — the branch was just updated from main, which orphaned the previous request.)

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

@yakimoto I will review the updated PR head.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@yakimoto

yakimoto commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.


Your included review limit is currently reached under our Fair Usage Limits Policy. Your recent PR review activity is in the 95th percentile or higher among CodeRabbit users, so adaptive limits apply. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 39 minutes.

@yakimoto

yakimoto commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.


Your included review limit is currently reached under our Fair Usage Limits Policy. Your recent PR review activity is in the 95th percentile or higher among CodeRabbit users, so adaptive limits apply. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 54 minutes.

@cursor

cursor Bot commented Aug 2, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_c230e756-cfd9-45e0-81a8-93102b3efe18)

@macroscopeapp

macroscopeapp Bot commented Aug 2, 2026

Copy link
Copy Markdown

Approvability

Verdict: Approved 37094b3

This CI workflow change adds defensive validation to npm pack output in the release process, failing loudly instead of silently if the tarball filename is missing or invalid. The author owns the modified file and the change doesn't affect production runtime behavior.

You can customize Macroscope's approvability policy. Learn more.

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