feat: automate app-modules release and app-monorepo sync - #123
huhuanming wants to merge 7 commits into
Conversation
|
@codex review |
|
@codex security review |
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cdd5bbbdba
ℹ️ 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".
|
Claude review session: https://claude.ai/code/session_01GN4VAXu1Jw39qQ51fL1Yrr |
Local Codex CLI reviewOpen the review session in Slack The review runs in a read-only local worktree and continues in this session when the PR receives a substantive commit. |
849537f to
42439d7
Compare
| return missing; | ||
| } | ||
|
|
||
| export function selectRetags(workspaces, packuments, distTag) { |
There was a problem hiding this comment.
🟠 P1 selectRetags 会把 next 拨回更旧版本
Problem
本轮把「版本已存在但 dist-tag 不匹配就失败」改成了无条件 npm dist-tag add。selectUnpublished 的回退保护只在两端都是 \d+.\d+.\d+ 时生效;prerelease 时 compareStableVersions 返回 null,检查被跳过。selectRetags(scripts/publish-missing.mjs:47-54)只要「该 version 已在 registry 且当前 tag 不是它」就会 retag,没有顺序比较。
本地复现:next 指向 3.0.153-alpha.11 时,工作区 3.0.153-alpha.10 会被选进 retags;workflow_dispatch + next 且工作区仍是已发布的 3.0.152 时,同样会把 next 拨到 3.0.152。package-publish.yml 的 preview 只在 pull_request && dist_tag==next 跑 prepare-preview,手动 next 走同一条 publish-missing。
Impact
next 是本轮新的 preview 通道。重跑更早的 preview workflow,或按 README 用 manual next 做 recovery,都会把 @pkg@next 从更新的 alpha 拨回旧 alpha 或稳定版。消费 next 的人会突然拿到更旧的包。latest 的稳定回退仍被挡住,所以不是 P0,但是明确的状态/并发缺陷。
Recommendation
retag 前用能比较 prerelease 的顺序:仅当现有 tag 缺失或严格旧于工作区 version 才 dist-tag add;现有 tag 更新则跳过或失败。workflow_dispatch + next 不要把已指向 alpha 的 next 拨到 main 上的稳定版。测试应覆盖「next 指向更新 alpha 时不得回拨」。
| if (!/^\d+\.\d+\.\d+$/.test(left) || !/^\d+\.\d+\.\d+$/.test(right)) { | ||
| return null; |
There was a problem hiding this comment.
🟡 P2: Preview reruns move next backwards
Severity: non-severe
Rerunning an older preview lets selectUnpublished accept a newer prerelease carrying next. compareStableVersions skips prereleases, so retagging makes consumers resolve the older preview.
| NPM_DIST_TAG: ${{ inputs.npm_dist_tag }} | ||
| ONLY_WORKSPACE: ${{ inputs.only_workspace }} | ||
| NPM_DIST_TAG: ${{ steps.channel.outputs.dist_tag }} | ||
| run: yarn workspace "$ONLY_WORKSPACE" release --tag "$NPM_DIST_TAG" |
There was a problem hiding this comment.
🟡 P2: Single-workspace retag recovery fails
Severity: non-severe
When a workspace version already exists, release republishes it instead of retagging it. npm rejects the recovery, leaving the requested dist-tag unchanged.
Problem
app-modules needs automatic preview packages for ordinary merged changes, while stable releases must use the version explicitly reviewed in source. npm acceptance alone is not enough to prove that a version is available to consumers.
Release policy
-alpha.<workflow run number>version across all publishable workspaces and exact internal dependencies, then publishes under npmnext. The preview version is not committed tomainand does not update app-monorepo.latest. The workflow does not bump versions or update CHANGELOG. Source PR approval is also release approval for a version-changing PR.Publishing and downstream sync
latestonly, update all app-modules pins on app-monorepox, including mobile npm aliases, components dependencies, and root dependency/resolution pins; refresh the lockfile, check the module-ID registry, and open an app-monorepo PR. Do not auto-merge it.Validation
queue: maxsetting.Required setup and boundaries