Skip to content
Source
Sign inSign up
pingdotgg/t3code

Smoke test bundled CLI before publish #2656

Closedanyonebutyou(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/2656/headopened View on GitHub

Summary

  • add a bundled CLI smoke script that runs dist/bin.mjs project add against temporary directories
  • run the bundled CLI smoke in CI after the desktop/server build
  • run the same smoke in the npm publish job before npm publish

Why

Published t3@0.0.23 can fail after startup in a way source-level CLI tests do not catch. This adds a release-artifact check so packaged CLI regressions fail before publish.

Verification

  • npx --yes bun@1.3.11 --filter=t3 run build:bundle
  • npx --yes bun@1.3.11 --filter=t3 run smoke:cli-bundle
  • npx --yes bun@1.3.11 run fmt
  • npx --yes bun@1.3.11 run --bun lint (passes with existing warnings)
  • npx --yes bun@1.3.11 run --bun typecheck
  • npx --yes bun@1.3.11 --filter=t3 run test -- src/bin.test.ts

Full npx --yes bun@1.3.11 run --bun test was also attempted locally, but failed in unrelated packages/effect-codex-app-server/src/client.test.ts with a 5000ms timeout.


Note

Low Risk Test-only and workflow wiring with no production runtime or auth changes; low risk aside from CI/release failing if the bundled CLI is broken (intended).

Overview Adds a release-artifact check for the packaged t3 CLI so bundling regressions fail in CI and release before npm publish.

A new smoke:cli-bundle script runs dist/bin.mjs with project add against temporary --base-dir and workspace paths and asserts stdout contains Added project. CI runs it after the desktop build pipeline; the release publish_cli job runs the same step after vp run --filter t3 build and immediately before publish.

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 91ae1f31c42894d9be60b751e3d7360aa43a0088. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).

Note

Add bundled CLI smoke test before publish in CI and release workflows

  • Adds smoke-cli-bundle.ts which verifies the built dist/bin.mjs exists, runs project add against a temporary workspace, and checks stdout for "Added project".
  • Wires the test into both the CI quality job and the release pipeline via a new smoke:cli-bundle npm script, running before the publish step in releases.
Macroscope summarized 91ae1f3.
    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    2. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro

      Run ID: b57a0102-de61-410e-965b-ecba5168e21f

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create PR with unit tests

      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      ❤️ Share
      Comment `@coderabbitai help` to get the list of available commands.
    3. @@ -0,0 +1,8 @@
      1+// @effect-diagnostics nodeBuiltinImport:off
      2+import { execFileSync } from "node:child_process";
      3+import { existsSync, mkdtempSync, rmSync } from "node:fs";
      4+import { tmpdir } from "node:os";
      5+import { dirname, join, resolve } from "node:path";
      6+import { fileURLToPath } from "node:url";
      7+import * as Console from "effect/Console";
      8+import * as Effect from "effect/Effect";

      Unnecessary Effect imports for simple console.log

      Low Severity

      effect/Console and effect/Effect are imported solely for Effect.runSync(Console.log(...)), which is functionally identical to console.log(...). A smoke test that validates a bundled artifact ideally avoids pulling in the very framework being tested as a transitive dependency; a plain console.log keeps the script minimal and removes two unused-beyond-one-line imports.

      Additional Locations (1)
      Fix in Cursor Fix in Web
      Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit e6ecfabc1e43beac9fcb7b11ee3c3937f5a422b9. Configure [here](https://www.cursor.com/dashboard/bugbot).
    4. Approvability

      Verdict: Approved

      This PR adds CI smoke tests to validate the bundled CLI before publishing. All changes are test infrastructure (CI workflow steps and a test script) with no production code modifications. The unresolved comment is a minor style suggestion.

      You can customize Macroscope's approvability policy. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    5. Cursor Bugbot has reviewed your changes and found 1 potential issue.

      There are 2 total unresolved issues (including 1 from previous review).

      Fix All in Cursor ❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the [Cursor dashboard](https://www.cursor.com/dashboard/bugbot). Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit c64e17073a2f0bcb8ece2779878fc4b089b0ca2d. Configure [here](https://www.cursor.com/dashboard/bugbot).
      @@ -34,3 +34,5 @@
      3434 - name: Build desktop pipeline
      3535 run: vp run build:desktop
      3636
      37+ - name: Smoke test bundled CLI
      38+ run: bun --filter=t3 run smoke:cli-bundle

      CI uses bun not vp

      Medium Severity

      The new smoke steps run bun --filter=t3 run smoke:cli-bundle, while this repo’s workflows install dependencies with setup-vp and pnpm and every other filtered task uses vp run --filter …. On runners without Bun on PATH, the smoke step fails before the bundled CLI is exercised.

      Additional Locations (1)
      Fix in Cursor Fix in Web
      Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit c64e17073a2f0bcb8ece2779878fc4b089b0ca2d. Configure [here](https://www.cursor.com/dashboard/bugbot).

Sign in to join this conversation.