Skip to content

ci(release): avoid duplicate pnpm cache writes in joint releases - #5277

Merged
liruifengv merged 5 commits into
mainfrom
perf/stable-ci-cache
Nov 24, 2026
Merged

liruifengv merged 5 commits into
mainfrom
perf/stable-ci-cache

Conversation

@liruifengv

@liruifengv liruifengv commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Requirement or Bug

CLI 和 Desktop 同时发正式版时,同一操作系统和架构的两个打包任务使用相同的 pnpm 依赖缓存。在 Desktop 1.4.2 的 Intel Mac 构建中,安装包已经上传,任务却又花了 84 秒尝试保存缓存,最后因为 CLI 已占用同一个缓存键而失败。

Bug Reproduction Steps

查看一次缓存未命中的联合发版,对比 CLI 和 Desktop 两个 Intel Mac 任务的 setup-node 日志:两者使用相同的缓存键,结束时也都尝试写入。

Root Cause

两个任务都会在构建结束后独立打包并保存 pnpm 依赖缓存。GitHub Actions 的缓存一旦写入就不能覆盖,因此只有一个任务能保存成功。

Code Changes

发布计划包含新的 CLI 版本,或该版本的 Git 标签指向本次发布提交时,由 CLI 保存缓存。Desktop 仍从同一个缓存键恢复依赖,但不再重复写入。如果发布计划中保留的是旧提交已发布的 CLI 版本,则仍由 Desktop 保存缓存。

Behavior Changes and Affected Users

场景 改动前 改动后 影响对象 未命中或校验失败时
CLI 和 Desktop 联合发版 两个任务都尝试保存缓存 CLI 写入,Desktop 只读取 发布维护者 缓存未命中时,仍按锁文件安装依赖
仅发 Desktop,或直接运行 Desktop 构建 Desktop 读取并保存缓存 不变 Desktop 维护者 默认仍允许读写缓存
npm 已发布,但 GitHub 原生包上传中断后全量重跑 Changesets 没有新版本可发,工作流跳过上传 核对 npm 上的精确版本,并确认远端标签指向本次通过 CI 的提交;附件不齐时重新上传安装包和校验文件,最后上传 manifest.json。附件已齐全则不覆盖 CLI 发布维护者 无法确认版本或提交时,停止上传

发布流程测试已通过,缓存键也已与 CLI 2.7.2 的实际写入日志核对。在 macOS 上使用该版本的真实 npm 元数据、带注解的 Git 标签和全部 37 个 GitHub 附件,以只读方式验证了重试逻辑。未触发正式发布。

Checklist

  • 已阅读贡献指南。
  • 已链接受影响的构建记录;本次改动属于内部 CI。
  • 测试覆盖了联合发版、仅发 Desktop,以及发布计划保留旧 CLI 版本的场景。
  • 已说明行为变化及影响对象。
  • 无需 changeset 或用户文档更新。

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 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-23T11:40:20.403863Z 6f27b6c Manual request
ℹ️ 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.

@changeset-bot

changeset-bot Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 6f27b6c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@6f27b6c
npx https://pkg.pr.new/@moonshot-ai/kimi-code@6f27b6c

commit: 6f27b6c

#5278)

* ci(release): skip the Electron PTY rebuild for standalone CLI installs

* test(release): handle PTY test registration explicitly

* ci(release): build native binaries alongside npm publication (#5280)

* ci(release): build native binaries alongside npm publication

* ci(release): compress native downloads in parallel by platform (#5281)

* ci(release): compress native downloads in parallel by platform

* ci(release): reuse the tested desktop renderer for stable installers (#5282)

* ci(release): reuse the tested desktop renderer for stable installers

* ci(release): share the verified CLI web bundle across native targets (#5283)

* ci(release): share the verified CLI web bundle across native targets

* ci(release): build only publishable npm workspace closures (#5284)

@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: 4f6c5ce635

ℹ️ 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 thread .github/workflows/release.yml Resolved
@liruifengv

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 6f27b6cdda

ℹ️ 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".

@liruifengv
liruifengv merged commit c3c52fc into main Nov 24, 2026
26 checks passed
@liruifengv
liruifengv deleted the perf/stable-ci-cache branch November 24, 2026 03:45
7723qqq pushed a commit to 7723qqq/kimi-code that referenced this pull request Nov 24, 2026
The fork's release workflow is gated to MoonshotAI with publishing
disabled, and its CI has no desktop-e2e/e2e-smoke/layered-qa workflows;
record MoonshotAI#5277, MoonshotAI#5092, MoonshotAI#5088, MoonshotAI#5084, MoonshotAI#5309 and MoonshotAI#5264 accordingly.
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