Repository navigation
fix(desktop): only guard nightly for Desktop version PRs - #5084
Conversation
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
commit: |
There was a problem hiding this comment.
💡 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".
| if (process.env.GITHUB_EVENT_NAME !== 'schedule') { | ||
| writeOutput(false); |
There was a problem hiding this comment.
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 }; |
There was a problem hiding this comment.
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 👍 / 👎.
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.
Why
The scheduled
nightly-guardcurrently skips for every open same-repositorychangeset-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
changeset-release/<release branch>→release/<release branch>PRs.apps/desktop/package.json; and/orkimi-code-appentry in.changeset/release-plan.json(including dependency-propagation bumps).skip=truewhen evidence is missing, malformed, or contradictory.The job now checks out the repository and has
contents: readso the guard can run the script and read exact base/head package contents.Tests
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:
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
contents: readpermission is limited to the guard job and is required for checkout and exact base/head file reads.Requested by 李瑞丰 via Mira.