Skip to content

fix(desktop): only guard nightly for Desktop version PRs - #5084

Merged
liruifengv merged 3 commits into
mainfrom
fix/desktop-nightly-version-pr-guard
Nov 19, 2026
Merged

liruifengv merged 3 commits into
mainfrom
fix/desktop-nightly-version-pr-guard

Conversation

@kimi-agent-bot

Copy link
Copy Markdown
Collaborator

Why

The scheduled nightly-guard currently skips for every open same-repository changeset-release/* PR. That incorrectly lets CLI-only version PRs such as #4983 block Desktop nightly.

The confirmed rule is: only an open release version PR that actually contains a Desktop version change skips nightly.

What changed

  • Consider only same-repository changeset-release/<release branch> → release/<release branch> PRs.
  • Inspect each candidate's changed files and recognize Desktop version changes from:
    • the base/head versions in apps/desktop/package.json; and/or
    • a valid kimi-code-app entry in .changeset/release-plan.json (including dependency-propagation bumps).
  • Allow CLI-only and other-package version PRs.
  • Fail closed with a diagnostic error and skip=true when evidence is missing, malformed, or contradictory.
  • Keep non-schedule behavior, branch-kind gating, Canary version derivation, build matrices, and Stable publication unchanged.

The job now checks out the repository and has contents: read so the guard can run the script and read exact base/head package contents.

Tests

node --test \
  scripts/desktop-nightly-guard.test.mjs \
  scripts/release-trigger.test.mjs \
  scripts/release.test.mjs \
  scripts/desktop-artifact-prefix.test.mjs \
  scripts/canary-version.test.mjs

Result: 43/43 passed. The new guard tests cover Desktop-only, CLI-only #4983, mixed packages, unreadable evidence, contradictory evidence, release-plan-only Desktop bumps, non-candidates, and non-schedule runs. Workflow YAML also parses successfully.

A read-only run against the live repository produced:

#4983: desktopVersionChange=false
#4359: desktopVersionChange=false
skip=false

No open live PR currently provides a Desktop bump, so the blocking cases are covered by local fixtures rather than a live schedule/dispatch.

Human review notes

  • The package version diff and validated release plan are authoritative; a CHANGELOG-only change is not independently treated as a Desktop version bump.
  • The new contents: read permission is limited to the guard job and is required for checkout and exact base/head file reads.
  • No workflow was dispatched, no PR was merged, and no CDN or Stable release path was touched.

Requested by 李瑞丰 via Mira.

@changeset-bot

changeset-bot Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: dfc7267

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 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-19T06:03:48.441344Z dfc7267 New commits
ℹ️ 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.

@pkg-pr-new

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

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

commit: dfc7267

@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: c8bdb0a79a

ℹ️ 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 +113 to +114
if (process.env.GITHUB_EVENT_NAME !== 'schedule') {
writeOutput(false);

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 Invoke the guard from an actual nightly trigger

The desktop-build.yml workflow declares only push, workflow_dispatch, and workflow_call events, so this condition is always true in every reachable invocation and the script always writes skip=false before querying any PRs. The test manufactures GITHUB_EVENT_NAME=schedule, but GitHub cannot produce that event for this workflow without a schedule entry; consequently the intended Desktop release-window guard never runs and this fix has no production effect.

Useful? React with 👍 / 👎.

|| typeof desktop[0].version !== 'string' || desktop[0].version.length === 0)) {
throw new Error(`${stage}: invalid kimi-code-app entry`);
}
return { changed: desktop.length === 1, version: desktop[0]?.version };

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 Compare release-plan entries against the base revision

When a later CLI-only version PR is created on the same release branch, version-release.mjs deliberately preserves prior package entries from that branch's existing release plan. This function reads only the head plan and treats the mere presence of kimi-code-app as a new Desktop change, so an unchanged cumulative Desktop entry causes that CLI-only PR to block nightly—the exact population this change is meant to allow. Compare the Desktop entry in the base and head plans, rather than treating head presence as changed.

Useful? React with 👍 / 👎.

@liruifengv
liruifengv merged commit 374466c into main Nov 19, 2026
16 checks passed
@liruifengv
liruifengv deleted the fix/desktop-nightly-version-pr-guard branch November 19, 2026 06:07
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