Skip to content

ci: place the native binaries without napi artifacts when platforms are skipped - #248

Merged
prisis merged 1 commit into
nextfrom
fix/ci-skip-platforms-artifacts
Nov 25, 2026
Merged

prisis merged 1 commit into
nextfrom
fix/ci-skip-platforms-artifacts

Conversation

@prisis

@prisis prisis commented Nov 25, 2026

Copy link
Copy Markdown
Member

Problem

After #235 the macOS native builds are skipped on pull requests into next that do not touch macOS code. The install smoke then fails on the Ubuntu and Windows legs at the "Native release artifacts" step:

Internal Error: Missing artifacts for configured targets: x86_64-apple-darwin (task-runner-native.darwin-x64.node), aarch64-apple-darwin (task-runner-native.darwin-arm64.node)
    at collectArtifactsUnlocked ... @napi-rs/cli

napi artifacts requires a binary for every configured target. #235's PR body listed this as unverified ("napi artifacts with no darwin .node files"). Seen on #244.

Fix

In .github/actions/native-release-artifacts/action.yml, when skip-platforms is set the step moves each <name>-native.<platform>.node into packages/<pkg>/npm/<platform>/ itself (the file name and directory napi artifacts uses). Releases and previews leave the input empty and keep going through napi artifacts, so they still require every target. The following "Verify platform packages are complete" step already honours skip-platforms.

Verified

  • The placement logic run in a temp directory with a vis-native.linux-x64-gnu.node file: it ends at packages/tooling/vis/npm/linux-x64-gnu/vis-native.linux-x64-gnu.node.
  • zizmor: no findings. actionlint can only check workflows, not a composite action.

Not verified here: a real Actions run. Check on a PR that skips macOS (for example this one, a docs-style change under .github/... note this file is not on the macOS path list): the Ubuntu and Windows smoke legs should pass the "Native release artifacts" step.

🤖 Generated with Claude Code

…re skipped

Since macOS native builds are skipped on pull requests that do not touch macOS
code, the install smoke runs the release-artifact layout without the darwin
binaries. `napi artifacts` aborts in that case ("Missing artifacts for
configured targets: x86_64-apple-darwin ..."), so the Ubuntu and Windows smoke
legs failed on every such pull request. When `skip-platforms` is set, move each
`<name>-native.<platform>.node` into `npm/<platform>/` directly, which is the
name and the directory `napi artifacts` uses; releases and previews leave the
input empty and still go through `napi artifacts`, which requires every target.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

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

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b75e3fd8-ae92-400a-9dc1-7456576d024a

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
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@qodo-code-review

qodo-code-review Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

PR Summary by Qodo

Fix native artifact placement when CI skips platforms

🐞 Bug fix 🕐 10-20 Minutes

Grey Divider

AI Description

• Place available native binaries directly into platform packages when CI skips targets, preventing
 install-smoke failures.
• Keep napi artifacts for releases and previews, where every configured target remains required.
• Preserve the existing completeness check for platforms that were built.
Merge Risk 🟡 Medium

Blast radius 🟢 Low 💥 1 capability

  • 1 affected end-to-end capability after fault-specific containment; implementation boundaries do not widen its functional scope.
  • The changed relocation, package manifests, and install-smoke consumer form one bounded end-to-end integration: artifacts from Build Native are staged into platform packages and then checked for installability.
  • The four package loops are implementations of the same staging operation, not independent user capabilities.
  • The workflow evidence shows this path is specifically consumed by install-smoke when a platform family was not built.
Behavioral complexity 🟡 Medium 🧩 Interacting branches

  • Before: every package used napi artifacts to distribute binaries, and that command assumed the configured target set was complete.
  • After: the action has two materially different distribution states selected by SKIP_PLATFORMS: the established complete-target path and a direct relocation path for partial target sets.
  • The new correctness condition is that filename-derived platform directories must exactly match the package layout while skipped platform directories remain intentionally unverified and all built platform directories remain valid.
  • This is an interaction between the partial-build state, the branch gate, package-specific filename prefixes, and the later manifest verification; it is more than routine reuse of the existing distribution helper.
  • No new concurrency protocol, persistent migration, or external-effect ordering is introduced.
Potential damage 🟡 Medium 🩹 Temporary loss

  • If the newly activated relocation logic produces an incomplete or unusable package layout, the affected capability is the PR install-smoke validation and temporary package assembly, not a published release.
  • The subsequent manifest-based check should stop the workflow for missing files.
  • Recovery consists of correcting or rerunning the workflow; no persistent package registry state, user data, or external side effect is created by this staging path.
  • Release and preview callers inspected here use the empty-input branch and are not affected by this new mode.
  • Recoverable by fixing the workflow or input and rerunning the native artifact staging/install-smoke job.
  • A failed ephemeral checkout does not require persistent-state repair or external compensation.
Assessed commit f2223f4
Diagram

graph TD
    A["Downloaded binaries"] --> B{"Platforms skipped?"}
    B -->|Yes| C["Place available binaries"] --> E["Verify platform packages"]
    B -->|No| D["Run napi artifacts"] --> E
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Filter napi targets for partial runs
  • ➕ Could retain a single artifact-placement mechanism for both partial and full builds.
  • ➖ Requires changing the target configuration used by napi artifacts and ensuring release configuration remains untouched.

Recommendation: Keep the PR’s direct-placement path for skipped-platform runs. It avoids altering configured release targets, while the existing verification step still checks every platform expected in that run.

Files changed (1) +17 / -2

Bug fix (1) +17 / -2
action.ymlDistribute available binaries when platforms are skipped +17/-2

Distribute available binaries when platforms are skipped

• Passes the skip-platforms input to the distribution step. When it is nonempty, moves each available native binary into its corresponding npm platform directory instead of invoking 'napi artifacts'; full-target runs retain the existing command.

.github/actions/native-release-artifacts/action.yml

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can copy the agent prompt from any finding and feed it to your IDE agent

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for following the naming conventions! 🙏

@github-actions github-actions Bot added size:S Size of the change, tests and generated files excluded. vouch:trusted PR author is a collaborator, a bot or on the VOUCHED list. labels Nov 25, 2026
@prisis
prisis merged commit c67e9c8 into next Nov 25, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S Size of the change, tests and generated files excluded. vouch:trusted PR author is a collaborator, a bot or on the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant