Skip to content

chore(ci): publish package previews - #370

Merged
chenjiahan merged 3 commits into
rstackjs:mainfrom
ScriptedAlchemy:codex/add-pkg-pr-new
Nov 10, 2026
Merged

chenjiahan merged 3 commits into
rstackjs:mainfrom
ScriptedAlchemy:codex/add-pkg-pr-new

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Contributor

This PR enables pkg.pr.new previews for rstack and create-rstack so pull requests can be tested through installable package URLs before release.

It installs the publisher from the workspace lockfile, builds both packages, and publishes them in one pnpm-aware workflow invocation. The workflow is ready while the pkg.pr.new GitHub App access request is awaiting approval.

@pkg-pr-new

pkg-pr-new Bot commented Aug 19, 2026 •

Copy link
Copy Markdown
npm i https://pkg.pr.new/create-rstack@370
npm i https://pkg.pr.new/rstack@370

commit: 8c6d95d

@chenjiahan chenjiahan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Requesting changes because the published rstack preview is not release-equivalent.

[P1] Publish native packages with the preview

In .github/workflows/pkg-pr-new.yml:31, the invocation publishes only the two JS package directories. The preceding root build does not run the NAPI build/assembly or napi pre-publish, so the actual rstack@4b142ab archive contains binding.cjs but neither a .node artifact nor any @rstackjs/cli-* optional dependencies. A clean install fails with Cannot find native binding as soon as rs fmt loads a .gitignore or --ignore-path. Please reuse the native release assembly flow, inject the preview native dependencies, and publish those packages in the same invocation.

[P2] Stage bundled docs before packing

In .github/workflows/pkg-pr-new.yml:28, node --run build does not populate packages/rstack/docs, which is generated and ignored. The production release runs node --run release:prepare; this preview tarball consequently has no docs/ or docs/llms.txt. Please run release preparation, or equivalent docs staging, before publishing.

[P3] Remove the string-based workflow test

packages/rstack/tests/pkgPrNew.test.ts duplicates workflow text without validating behavior: comments could satisfy the assertions, a routine pkg-pr-new upgrade requires test churn, and it remains green while the published archive is missing native bindings and docs. The workflow run already validates the wiring. Please remove this test; if regression coverage is desired, add a post-publish smoke test that installs the emitted URL and runs representative rstack and create-rstack commands.

Trigger timing

The current pre-merge pull_request trigger targeting main is appropriate for a PR preview. I would not defer it until merge; a separate push trigger on main can provide post-merge snapshots. As optional CI optimizations, skip draft PRs and add per-PR concurrency with cancellation of superseded runs.

Verification: I inspected https://pkg.pr.new/rstack@4b142ab and reproduced the native binding failure from a clean install.

@chenjiahan
chenjiahan marked this pull request as ready for review November 10, 2026 08:17
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-10T08:23:12.433223Z 8c6d95d Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chenjiahan
chenjiahan merged commit 9f1c8b7 into rstackjs:main Nov 10, 2026
6 checks passed

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8c6d95d5bc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

run_install: true

- name: Build Packages
run: node --run build

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Include native bindings in the rstack preview

On a clean Linux x64 installation of this preview, rs fmt and the formatting stage of rs check will throw Cannot find native binding. This step runs the manifest's build script (node --help: “Run a script specified in package.json”), which is only rslib for rstack. A repo-wide artifact search found no checked-in .node binaries, and packages/rstack/package.json declares no platform-native optional dependencies, so the formatter's loadNativeBinding() call has neither a local binary nor an installed fallback package. Ensure previews include or depend on matching native bindings before publishing, analogous to the native preparation in .github/workflows/release.yml:88-102.

Useful? React with 👍 / 👎.

expect(workflow).toContain("'./packages/create-rstack'");
expect(workflow).not.toContain('head.repo.full_name == github.repository');
expect(packageJson).toContain('"pkg-pr-new": "catalog:"');
expect(workspace).toContain('pkg-pr-new: 0.0.87');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Remove the hard-coded publisher version from the test

When pkg-pr-new is upgraded in the catalog, an otherwise-valid dependency update will make the package test suite fail solely because this assertion requires 0.0.87. AGENTS.md requires tests to be “focused on observable behavior”; this check instead locks an implementation detail without establishing that previews publish correctly. Remove the fixed-version expectation or check manifest/catalog consistency without hard-coding a release.

AGENTS.md reference: AGENTS.md:L33-L33

Useful? React with 👍 / 👎.

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