Skip to content

ci: build dist before macos tests#52279

Merged
Takhoffman merged 3 commits intomainfrom
codex/fix-main-ci-plugin-sdk
Mar 22, 2026
Merged

ci: build dist before macos tests#52279
Takhoffman merged 3 commits intomainfrom
codex/fix-main-ci-plugin-sdk

Conversation

@Takhoffman
Copy link
Copy Markdown
Contributor

Summary

  • build dist before the macOS TS test step
  • align the macOS lane with the earlier Linux and Windows dist hydration fix
  • prevent plugin-sdk package export tests from resolving into a missing dist directory on macOS

Verification

  • inspected failed macOS job 68080806345 from CI run 23404315300
  • confirmed the failure is the same missing dist/plugin-sdk/core.js error in src/plugin-sdk/subpaths.test.ts
  • local workflow edit passed repository commit hooks

@openclaw-barnacle openclaw-barnacle bot added size: XS maintainer Maintainer-authored PR labels Mar 22, 2026
@aisle-research-bot
Copy link
Copy Markdown

aisle-research-bot bot commented Mar 22, 2026

🔒 Aisle Security Analysis

We found 1 potential security issue(s) in this PR:

# Severity Title
1 🟡 Medium Unpinned GitHub Action reference (supply-chain risk) in CI workflow

1. 🟡 Unpinned GitHub Action reference (supply-chain risk) in CI workflow

Property Value
Severity Medium
CWE CWE-829
Location .github/workflows/ci.yml:266-271

Description

The CI workflow executes a third-party GitHub Action using only a mutable major-version tag:

  • The newly added steps use actions/download-artifact@​v8.
  • Major-version tags (e.g., v8) can be moved to a different commit by the action publisher.
  • If the upstream action release process or account is compromised, a malicious update could execute arbitrary code on CI runners (RCE), potentially exfiltrating secrets or altering build outputs.

Vulnerable code (newly added):

- name: Download dist artifact
  if: github.event_name == 'push' && matrix.task == 'test'
  uses: actions/download-artifact@​v8

This is especially relevant because these steps run on push to main, where workflows often have higher privileges than PR workflows.

Recommendation

Pin GitHub Actions to an immutable commit SHA (and optionally keep the human-readable tag as a comment), then use automation (e.g., Dependabot) to update.

Example:

- name: Download dist artifact
  uses: actions/download-artifact@<FULL_COMMIT_SHA> # v8
  with:
    name: dist-build
    path: dist/

Apply the same pinning strategy to other uses: actions/...@​v* references in workflows to reduce CI supply-chain risk.


Analyzed PR: #52279 at commit 1667865

Last updated on: 2026-03-22T14:15:54Z

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 22, 2026

Greptile Summary

This PR fixes a missing dist/ directory error that caused macOS TS test failures (src/plugin-sdk/subpaths.test.ts) by inserting a pnpm build step immediately before the TS test step in the macos job. It also aligns the checks (Linux) and checks-windows jobs with the same artifact-sharing pattern already present in build-smoke: on push events these jobs download the pre-built dist-build artifact; on PR events they build locally.

Key changes:

  • macos job: adds an unconditional Build dist (macOS) step before TS tests (macOS) — correct since the macOS job is already gated to pull_request events only, so there is never a pre-built artifact to download
  • checks job: adds build-artifacts to needs, always() guard, and download-or-build-locally steps scoped to matrix.task == 'test'
  • checks-windows job: same pattern as Linux checks, without the matrix.runtime == 'node' filter (safe, since the Windows matrix is node-only)
  • All three jobs correctly handle the scenario where build-artifacts is skipped on PRs via always() + github.event_name != 'push' short-circuit

Confidence Score: 5/5

  • Safe to merge — targeted, minimal CI fix with correct logic across all three platforms.
  • The change is a narrow CI configuration fix: one new step in the macOS job and consistent guard/dependency alignment for Linux and Windows. The artifact download vs. local build branching logic (event_name == 'push' vs. not) is correct and follows the existing build-smoke pattern already live in the file. No application code is touched. The macOS job's always-build-locally approach is the right call given the job is unconditionally gated to pull_request events.
  • No files require special attention.

Reviews (1): Last reviewed commit: "ci: build dist before macos tests" | Re-trigger Greptile

@Takhoffman Takhoffman merged commit 52a0aa0 into main Mar 22, 2026
43 of 44 checks passed
@Takhoffman Takhoffman deleted the codex/fix-main-ci-plugin-sdk branch March 22, 2026 14:10
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

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: 1667865a40

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +712 to +714
- name: Build dist (Windows)
if: github.event_name != 'push' && matrix.task == 'test'
run: pnpm 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.

P2 Badge Avoid full pnpm build in each PR test shard

On pull_request runs, this step now executes pnpm build inside every Windows test shard; .github/workflows/ci.yml already fans this job out to 6 shards, and the build script in package.json goes through scripts/runtime-postbuild.mjs into scripts/stage-bundled-plugin-runtime-deps.mjs, which runs npm install --omit=dev for bundled plugins that opt into openclaw.bundle.stageRuntimeDependencies (see extensions/discord/package.json, extensions/feishu/package.json, extensions/slack/package.json, and extensions/telegram/package.json). That means a transient npm registry/network failure now knocks out all PR test shards before the unit tests start, even though the original regression only needed dist/plugin-sdk/*.js; a narrower build or shared artifact would avoid introducing this CI-only failure mode.

Useful? React with 👍 / 👎.

MaheshBhushan pushed a commit to MaheshBhushan/openclaw that referenced this pull request Mar 22, 2026
* ci: hydrate dist before plugin-sdk test lanes

* ci: skip bun-only dist build on PRs

* ci: build dist before macos tests
frankekn pushed a commit to artwalker/openclaw that referenced this pull request Mar 23, 2026
* ci: hydrate dist before plugin-sdk test lanes

* ci: skip bun-only dist build on PRs

* ci: build dist before macos tests
furaul pushed a commit to furaul/openclaw that referenced this pull request Mar 24, 2026
* ci: hydrate dist before plugin-sdk test lanes

* ci: skip bun-only dist build on PRs

* ci: build dist before macos tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant