Repository navigation
ci: publish canary versions to npm by default - #4512
Conversation
|
Codex Review SummaryThis 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: |
|
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
Port of upstream MoonshotAI/kimi-code 9793044 (MoonshotAI#4425) with the rest of the chain it opened: b9fa2b1 (MoonshotAI#4469), 84a392e (MoonshotAI#4490), ebe14e1 (MoonshotAI#4504) and f695b1f (MoonshotAI#4512). They land together because each one rewrites files the previous introduced, and the dev->canary rename in the middle would otherwise create and delete the same script twice. A release channel is now part of every update decision. `stable` keeps the existing CDN /latest + /latest.json feed; `canary` reads the /channels/canary.json pointer and never falls back to stable, because the two are different release lines. The rename from `dev` to `canary` (MoonshotAI#4490) is part of this landing, so the channel name, the CDN pointer and the canary release script's `-canary.` version suffix all agree. The channel comes from the installed version's prerelease tag, KIMI_CODE_UPDATE_CHANNEL, or the homebrew install source (always stable); an unusable value warns and keeps the installed channel. A pointer for another channel is a switch, not an upgrade, and only the interactive prompt can act on it. The update cache and the staged native record both carry the channel, so a stage downloaded for one line is never adopted by the other, and the hidden downloader takes --channel / --switch-channel alongside --manual. Rollout gating stays off for a switch. The canary release script derives its base version from `changeset status` and refuses a run that would replace a newer published canary. CI gains a scripts-tests job: the root test run covers the workspace packages only, so scripts/test (release trigger, canary release) had no job running it anywhere. Local-form notes: - The fork's update tree was restructured by 8c865f4 (MoonshotAI#2994 staged swap): preflight injects spawn/clock through PreflightDeps, the install lock and auto-install gates live in install-lock.ts / auto-install.ts, and main() moved to cli/main.ts. The ported code keeps that shape instead of upstream's parameter lists. - All new copy goes through t() with en/zh keys (14 new keys) rather than upstream's literals, because check:no-hardcoded-prose is a baseline gate here. Regenerating that baseline after the change lowers sub/upgrade.ts from 8 to 7 literals (the install failure message is localized now) and rewrites the digests of update/cdn.ts and update/native-swap.ts for reworded diagnostics. - The CDN URL helpers live in constant/region-urls.ts here, not constant/app.ts, so kimiCodeCdnDevChannelUrl is added there. - The fork prompts from the cache and revalidates after the user accepts, so the tests pin the prompt at the cached plan and the install at the refreshed one; upstream refreshes before prompting. - ci.yml gets a bun scripts-tests job instead of upstream's node release-workflow-tests, and the canary workflow uses bun plus `bun pm pkg set` / `bun publish` in place of pnpm and node. The canary publish keeps upstream's repository_owner guard, so this fork's CI never publishes; per AGENTS.md the release/publish commands themselves are still not run from this repository. - native-stage's two new guards are localized too, since the baseline is shrink-only and may not absorb new literals. Verified: apps/kimi-code typecheck clean apart from two untouched TUI test files (footer/welcome) that are already red at HEAD; test/cli/update 14 files 215 pass, update-download 20, upgrade 17, native-stage 34/1 skip, scripts suite 228; oxlint --type-aware 0 errors on the touched files; check:no-comments, check:no-hardcoded-prose, check:locale-keys, check:locale-placeholders, check:t-coverage and check:status-surface-i18n green.
Requirement or Bug
移除 Canary npm 发布的仓库变量开关,使后续 Canary 版本默认发布到 npm 的
canarydist-tag。npm 管理员已为canary-release.yml配置 Trusted Publishing;本次不改变latestdist-tag。Bug Reproduction Steps
N/A
Root Cause
N/A
Code Changes
未修改 stable
release.yml、latestdist-tag、npm 包名、Canary 版本算法或其他发布流程。Behavior Changes and Affected Users
canarydist-taglatest不变受影响模块与验证:
.github/workflows/canary-release.yml:YAML 解析通过;id-token: write、npm 11、registry、构建和 GitHub prerelease 步骤保留。scripts/canary-release.mjs/scripts/canary-release.test.mjs:相关脚本测试 20/20,通过;新增测试证明 npm dist-tag 查询始终执行、空值可接受、异常版本会失败。pnpm run typecheck与pnpm run lint均通过;git diff --check通过;KIMI_CODE_CANARY_NPM_PUBLISH残留引用为 0。Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.