chore: speed up CI installs and desktop packaging#590
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughReorganizes CI into fast PR validation and a heavy macOS packaging workflow; adds/adjusts pnpm/npm cache restores keyed to lockfiles; introduces Changes
Sequence Diagram(s)sequenceDiagram
participant GH as "GitHub Actions"
participant Runner as "Runner (macOS)"
participant Checkout as "actions/checkout"
participant Cache as "actions/cache"
participant Node as "actions/setup-node + pnpm"
participant Installer as "pnpm / scripts/postinstall.mjs"
participant Builder as "pnpm build / electron-builder"
participant Test as "pnpm test / e2e"
participant Artifacts as "actions/upload-artifact"
GH->>Runner: trigger desktop-ci-dist-heavy / PR workflows
Runner->>Checkout: checkout repo
Runner->>Cache: restore ~/.npm & electron caches (lockfile-based keys)
Runner->>Node: setup Node & pnpm (cache-dependency-path: pnpm-lock.yaml)
Runner->>Installer: run pnpm install --frozen-lockfile (may skip runtime postinstall)
Runner->>Builder: run pnpm build / electron-builder (mac targets)
Runner->>Test: run tests and lifecycle e2e
Runner->>Artifacts: validate outputs, upload distributions and logs
Estimated code review effort🎯 4 (Complex) | ⏱️ ~40 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 37b15d81b8
ℹ️ 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".
There was a problem hiding this comment.
🧹 Nitpick comments (3)
.github/workflows/desktop-build.yml (1)
89-94: Optional: centralize repeated runtime-cache workflow snippet.This cache block is now duplicated across desktop workflows; extracting it into a reusable workflow/composite action would reduce future drift.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/desktop-build.yml around lines 89 - 94, The cache step "Restore npm cache for runtime installs" is duplicated; extract that snippet into a reusable workflow or composite action (e.g., create a new workflow/composite named "runtime-npm-cache" that contains the actions/cache@v4 step with the same path and key expression), then replace each duplicated block with a call to that reusable workflow or composite action from the desktop workflows; ensure the cache key remains identical (desktop-npm-cache-${{ runner.os }}-${{ matrix.arch }}-${{ hashFiles('openclaw-runtime/package-lock.json', 'apps/controller/static/runtime-plugins/openclaw-weixin/package-lock.json') }}) so existing cache hits are preserved..github/workflows/desktop-ci-dist.yml (1)
50-55: Consider addingrestore-keysfor better cache hit rate.When the lock files change, the exact key won't match and no cache will be restored. Adding a fallback
restore-keyspattern allows partial cache hits from previous runs, improving CI performance during dependency updates.💡 Suggested improvement
- name: Restore npm cache for runtime installs uses: actions/cache@v4 with: path: ~/.npm key: desktop-npm-cache-${{ runner.os }}-arm64-${{ hashFiles('openclaw-runtime/package-lock.json', 'apps/controller/static/runtime-plugins/openclaw-weixin/package-lock.json') }} + restore-keys: | + desktop-npm-cache-${{ runner.os }}-arm64-🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/desktop-ci-dist.yml around lines 50 - 55, The cache step "Restore npm cache for runtime installs" using actions/cache@v4 only supplies a full key and will miss when lockfiles change; add a restore-keys entry (e.g. a prefix like desktop-npm-cache-${{ runner.os }}-arm64-) under the same step so GitHub Actions can fall back to partial matches and increase cache hit rate when the exact key doesn't exist, keeping the existing key as the primary exact match..github/workflows/desktop-ci-dist-heavy.yml (1)
61-66: Consider addingrestore-keysfor better cache hit rate.Same recommendation as the PR workflow—adding a fallback pattern improves cache utilization when lock files change.
💡 Suggested improvement
- name: Restore npm cache for runtime installs uses: actions/cache@v4 with: path: ~/.npm key: desktop-npm-cache-${{ runner.os }}-${{ matrix.arch }}-${{ hashFiles('openclaw-runtime/package-lock.json', 'apps/controller/static/runtime-plugins/openclaw-weixin/package-lock.json') }} + restore-keys: | + desktop-npm-cache-${{ runner.os }}-${{ matrix.arch }}-🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/desktop-ci-dist-heavy.yml around lines 61 - 66, The cache step named "Restore npm cache for runtime installs" uses a fully specific key (desktop-npm-cache-${{ runner.os }}-${{ matrix.arch }}-${{ hashFiles(...) }}) which causes misses when lockfiles change; add a restore-keys array to the same actions/cache@v4 step that provides progressively looser fallback patterns (for example: desktop-npm-cache-${{ runner.os }}-${{ matrix.arch }}-, desktop-npm-cache-${{ runner.os }}-) so the runner can match older caches when the exact hashFiles key isn’t present.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.github/workflows/desktop-build.yml:
- Around line 89-94: The cache step "Restore npm cache for runtime installs" is
duplicated; extract that snippet into a reusable workflow or composite action
(e.g., create a new workflow/composite named "runtime-npm-cache" that contains
the actions/cache@v4 step with the same path and key expression), then replace
each duplicated block with a call to that reusable workflow or composite action
from the desktop workflows; ensure the cache key remains identical
(desktop-npm-cache-${{ runner.os }}-${{ matrix.arch }}-${{
hashFiles('openclaw-runtime/package-lock.json',
'apps/controller/static/runtime-plugins/openclaw-weixin/package-lock.json') }})
so existing cache hits are preserved.
In @.github/workflows/desktop-ci-dist-heavy.yml:
- Around line 61-66: The cache step named "Restore npm cache for runtime
installs" uses a fully specific key (desktop-npm-cache-${{ runner.os }}-${{
matrix.arch }}-${{ hashFiles(...) }}) which causes misses when lockfiles change;
add a restore-keys array to the same actions/cache@v4 step that provides
progressively looser fallback patterns (for example: desktop-npm-cache-${{
runner.os }}-${{ matrix.arch }}-, desktop-npm-cache-${{ runner.os }}-) so the
runner can match older caches when the exact hashFiles key isn’t present.
In @.github/workflows/desktop-ci-dist.yml:
- Around line 50-55: The cache step "Restore npm cache for runtime installs"
using actions/cache@v4 only supplies a full key and will miss when lockfiles
change; add a restore-keys entry (e.g. a prefix like desktop-npm-cache-${{
runner.os }}-arm64-) under the same step so GitHub Actions can fall back to
partial matches and increase cache hit rate when the exact key doesn't exist,
keeping the existing key as the primary exact match.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: fd4733e9-b7c5-4ffe-9ae3-6752ad77f828
📒 Files selected for processing (12)
.github/workflows/ci.yml.github/workflows/desktop-build.yml.github/workflows/desktop-ci-dev.yml.github/workflows/desktop-ci-dist-heavy.yml.github/workflows/desktop-ci-dist.yml.github/workflows/desktop-release.yml.github/workflows/feishu-project-item-notify.ymlapps/desktop/scripts/dist-mac.mjspackage.jsonscripts/notify/feishu-project-notify.mjsscripts/postinstall.mjsspecs/exec-plans/2026-03-26-ci-optimization-plan.md
💤 Files with no reviewable changes (2)
- .github/workflows/feishu-project-item-notify.yml
- scripts/notify/feishu-project-notify.mjs
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5383ce7ae7
ℹ️ 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".
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
.github/workflows/desktop-ci-dist.yml (1)
58-63: Consider addingrestore-keysfor better cache hit rates.When
package-lock.jsonfiles change, the exact key won't match and no cache will be restored. Addingrestore-keysallows falling back to a previous cache, which can still speed up installs.♻️ Suggested improvement
- name: Restore npm cache for runtime installs uses: actions/cache@v4 with: path: ~/.npm key: desktop-npm-cache-${{ runner.os }}-arm64-${{ hashFiles('openclaw-runtime/package-lock.json', 'apps/controller/static/runtime-plugins/openclaw-weixin/package-lock.json') }} + restore-keys: | + desktop-npm-cache-${{ runner.os }}-arm64-🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/desktop-ci-dist.yml around lines 58 - 63, The cache step "Restore npm cache for runtime installs" currently uses a single exact key (desktop-npm-cache-${{ runner.os }}-arm64-${{ hashFiles('openclaw-runtime/package-lock.json', 'apps/controller/static/runtime-plugins/openclaw-weixin/package-lock.json') }}) which will miss when lockfiles change; update the actions/cache@v4 step to include a restore-keys fallback (e.g., prefix-based patterns like desktop-npm-cache-${{ runner.os }}-arm64- and/or desktop-npm-cache-${{ runner.os }}-) so the step can fall back to previous caches when the exact key is not found, keeping the step name and key logic but adding restore-keys entries to improve cache hit rates..github/workflows/ci.yml (1)
47-49: Apply the same runtime-postinstall skip to thetestjob for full CI speedup.You set
NEXU_SKIP_RUNTIME_POSTINSTALLfor typecheck/lint/build, but the test install step (Line 101-103) still runs full postinstall. If tests don’t require runtime plugin installs, this leaves avoidable install time and network risk.Suggested patch
test: runs-on: ubuntu-latest @@ - name: Install dependencies + env: + NEXU_SKIP_RUNTIME_POSTINSTALL: "1" run: pnpm install --frozen-lockfileAlso applies to: 75-77, 128-130
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/ci.yml around lines 47 - 49, Add the NEXU_SKIP_RUNTIME_POSTINSTALL: "1" environment variable to the pnpm install steps used by the test job (the step that runs pnpm install --frozen-lockfile) so it matches the typecheck/lint/build jobs; update the test job's env block to include NEXU_SKIP_RUNTIME_POSTINSTALL and mirror the same change for the other pnpm install occurrences referenced (the other pnpm install steps around the other jobs) to avoid runtime postinstall during CI installs.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@package.json`:
- Around line 12-13: Update CONTRIBUTING.md to reflect that the npm scripts
"lint" and "lint:fix" run biome only (no typecheck); change any text that says
`pnpm lint`/`pnpm lint:fix` include type checking to instead state they run only
biome checks and how to run typechecks separately (for example `pnpm typecheck`
or the actual typecheck command used in the project). Search for references to
"lint" and "lint:fix" in CONTRIBUTING.md (around the current lines describing
linting) and replace the instructions and examples so they accurately describe
the new semantics and the separate command for type checking.
---
Nitpick comments:
In @.github/workflows/ci.yml:
- Around line 47-49: Add the NEXU_SKIP_RUNTIME_POSTINSTALL: "1" environment
variable to the pnpm install steps used by the test job (the step that runs pnpm
install --frozen-lockfile) so it matches the typecheck/lint/build jobs; update
the test job's env block to include NEXU_SKIP_RUNTIME_POSTINSTALL and mirror the
same change for the other pnpm install occurrences referenced (the other pnpm
install steps around the other jobs) to avoid runtime postinstall during CI
installs.
In @.github/workflows/desktop-ci-dist.yml:
- Around line 58-63: The cache step "Restore npm cache for runtime installs"
currently uses a single exact key (desktop-npm-cache-${{ runner.os }}-arm64-${{
hashFiles('openclaw-runtime/package-lock.json',
'apps/controller/static/runtime-plugins/openclaw-weixin/package-lock.json') }})
which will miss when lockfiles change; update the actions/cache@v4 step to
include a restore-keys fallback (e.g., prefix-based patterns like
desktop-npm-cache-${{ runner.os }}-arm64- and/or desktop-npm-cache-${{ runner.os
}}-) so the step can fall back to previous caches when the exact key is not
found, keeping the step name and key logic but adding restore-keys entries to
improve cache hit rates.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 8c1859e9-a6c0-4ed6-b77c-33b3c96f62c4
📒 Files selected for processing (5)
.github/workflows/ci.yml.github/workflows/desktop-ci-dev.yml.github/workflows/desktop-ci-dist-heavy.yml.github/workflows/desktop-ci-dist.ymlpackage.json
✅ Files skipped from review due to trivial changes (2)
- .github/workflows/desktop-ci-dev.yml
- .github/workflows/desktop-ci-dist-heavy.yml
|
/cr 1. CI 提速
|
|
✅ CR topic created in Feishu topic group Refly CR. |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
.github/workflows/desktop-ci-dist-heavy.yml (1)
1-30: New heavy workflow correctly separates main-branch validation.The workflow appropriately:
- Triggers only on
mainpush andworkflow_dispatch- Uses path filters to avoid unnecessary runs
- Sets proper concurrency to cancel in-progress runs
However, the path filters are missing some entries present in
desktop-ci-dist.yml:
scripts/desktop-stop-smoke.sh(present in PR workflow line 15)scripts/kill-all.sh(present in PR workflow line 18)This could cause the heavy workflow to not trigger when changes to these scripts are merged.
Proposed fix to align path filters
- "scripts/desktop-ci-check.mjs" - "scripts/launchd-lifecycle-e2e.sh" + - "scripts/desktop-stop-smoke.sh" - "scripts/kill-all.sh" - "vitest.config.ts"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/desktop-ci-dist-heavy.yml around lines 1 - 30, The Desktop CI Dist Heavy workflow is missing two path entries that exist in the other dist workflow; update the paths list in the "Desktop CI Dist Heavy" workflow to include "scripts/desktop-stop-smoke.sh" and "scripts/kill-all.sh" so changes to those scripts will trigger this workflow (aligning it with the paths used by the desktop-ci-dist workflow)..github/workflows/desktop-ci-dist.yml (1)
165-167: Verify artifact name collision with heavy workflow.The artifact name
desktop-ci-dist-arm64matches the patterndesktop-ci-dist-${{ matrix.arch }}used indesktop-ci-dist-heavy.yml(line 182). While these workflows target different triggers (PR vs main), if both were to run on the same commit (e.g., during a merge), artifacts with identical names but different contents (zip-only vs dmg+zip) could cause confusion.Consider differentiating the names, for example:
- PR workflow:
desktop-ci-dist-pr-arm64- Heavy workflow:
desktop-ci-dist-heavy-arm64🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/desktop-ci-dist.yml around lines 165 - 167, The artifact name desktop-ci-dist-arm64 currently collides with the desktop-ci-dist-${{ matrix.arch }} pattern used in the heavy workflow; update the artifact name in this workflow to a distinct identifier (e.g., desktop-ci-dist-pr-arm64 or desktop-ci-dist-pr-${{ matrix.arch }}) so PR-run artifacts cannot be confused with heavy-run artifacts (which can keep desktop-ci-dist-heavy-${{ matrix.arch }}), ensuring the artifact name string(s) in the workflow YAML are changed accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.github/workflows/desktop-ci-dist-heavy.yml:
- Around line 1-30: The Desktop CI Dist Heavy workflow is missing two path
entries that exist in the other dist workflow; update the paths list in the
"Desktop CI Dist Heavy" workflow to include "scripts/desktop-stop-smoke.sh" and
"scripts/kill-all.sh" so changes to those scripts will trigger this workflow
(aligning it with the paths used by the desktop-ci-dist workflow).
In @.github/workflows/desktop-ci-dist.yml:
- Around line 165-167: The artifact name desktop-ci-dist-arm64 currently
collides with the desktop-ci-dist-${{ matrix.arch }} pattern used in the heavy
workflow; update the artifact name in this workflow to a distinct identifier
(e.g., desktop-ci-dist-pr-arm64 or desktop-ci-dist-pr-${{ matrix.arch }}) so
PR-run artifacts cannot be confused with heavy-run artifacts (which can keep
desktop-ci-dist-heavy-${{ matrix.arch }}), ensuring the artifact name string(s)
in the workflow YAML are changed accordingly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 325743d8-bd25-4346-ac1f-5d70ea0cb188
📒 Files selected for processing (5)
.github/workflows/desktop-build.yml.github/workflows/desktop-ci-dev.yml.github/workflows/desktop-ci-dist-heavy.yml.github/workflows/desktop-ci-dist.yml.github/workflows/desktop-release.yml
🚧 Files skipped from review as they are similar to previous changes (2)
- .github/workflows/desktop-ci-dev.yml
- .github/workflows/desktop-release.yml
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2094d34c20
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0577906cc5
ℹ️ 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".
Deploying nexu-docs with
|
| Latest commit: |
b03d38f
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://ca074bb5.nexu-docs.pages.dev |
| Branch Preview URL: | https://chore-ci-optimization-plan.nexu-docs.pages.dev |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3737a2848c
ℹ️ 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".
What
Optimize CI by splitting desktop packaging into fast PR vs heavy main flows, trimming duplicate checks, caching runtime npm installs, and removing an unused Feishu project notifier.
Why
Desktop packaging CI was dominated by heavyweight macOS/x64 and DMG work on every PR, while root install also paid repeated runtime postinstall costs that pnpm cache did not cover.
How
dist-mac.mjsoverride mac targets so PRs can build zip onlypnpm lintopenclaw-runtime's cached install path~/.npmcaching for desktop/runtime npm installsAffected areas
Checklist
pnpm typecheckpassespnpm lintpassespnpm testpassespnpm generate-typesrun (if API routes/schemas changed)anytypes introduced (useunknownwith narrowing)Notes for reviewers
Desktop CI Dist Heavyonmainand manual dispatch.specs/exec-plans/2026-03-26-ci-optimization-plan.md.Summary by CodeRabbit
Chores
Documentation