Skip to content

fix(release): 浅克隆误打全量 tag + 损坏 changeset 状态 - #74

Merged
Tanya7z merged 1 commit into
mainfrom
cursor/bc-850e218d-9ea4-4e74-a84c-19ff1dff9e9e-d8e9
Jul 25, 2026
Merged

fix(release): 浅克隆误打全量 tag + 损坏 changeset 状态#74
Tanya7z merged 1 commit into
mainfrom
cursor/bc-850e218d-9ea4-4e74-a84c-19ff1dff9e9e-d8e9

Conversation

@cursor

@cursor cursor Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Summary

审查 main@686bdba(发版编排 + beta.1 发布)后的可验证修复。

BLOCKER — LSP / 契约

changeset-release CI 默认 actions/checkout 浅克隆 → HEAD~1 失败 → tag-packages 旧逻辑回退为「给所有可发包打 tag」,导致未在本轮 publish 的包(sdk/cli/eslint-plugin/qq-bridge/tools)也被推 tag 并创建 GitHub Release。

修复:

  • CI=true / --from-existing:只收录本地已有 name@versionchangeset publish 刚建的 tag)
  • 无法解析 HEAD~1 时同样安全回退,禁止全量打 tag
  • workflow fetch-depth: 0 双保险

BLOCKER — 重复 bump

tame-suns-begin.md 在版本已手写 bump 并 publish 为 0.2.0-beta.1 后仍残留,且 pre.json 消费列表被截断为仅该 id。下一轮 Version PR 会再次 patch 同一批包。

修复: 删除残留 changeset,恢复 pre.json 已消费列表;新增 fix-release-tag-shallow 仅 bump @sfmc-bds/tools

MAJOR — DRY / DIP

  • RELEASE_TAGS_STATE + read/write 唯一来源(tag/push/gh)
  • changeset-publish 复用 isPreMode / ROOT
  • packageDirFor 替代 gh-release 再挖 NPM_PUBLISH_PACKAGES

MAJOR — GH Release 笔记截断

extractChangelogNotes 使用了 m 标志,$ 在行尾匹配 → 笔记只剩首行(已发 beta.1 Release 笔记可能已截断)。已去掉 m

验证

  • node --test tools/changeset-release.test.mjs
  • resolvePackagesNeedingTags({}) → 仅 db-server / bds-tools / sfmc 的 beta.1

Test plan

  • unit: tools/changeset-release.test.mjs
  • 合并后 changeset-release 对 pending tools changeset 开 Version PR(不应再二次 bump 已发 beta.1 包)
  • 下次 publish:tag-packages 日志含 [from-existing],只推真正 publish 的 tag
Open in Web View Automation 

- tag-packages:CI/--from-existing 只收录已有 name@version;HEAD~1 不可用时禁止全量回退
- extractChangelogNotes:去掉 m 标志,避免 GH Release 笔记被截成首行
- DRY:RELEASE_TAGS_STATE / read-write / packageDirFor;publish 复用 isPreMode
- 恢复 pre.json 已消费列表;删除误留的 tame-suns-begin(已发 beta.1,防二次 bump)
- changeset-release.yml fetch-depth: 0

Co-authored-by: Shiroha <Tanya7z@users.noreply.github.com>
@Tanya7z
Tanya7z marked this pull request as ready for review July 25, 2026 05:27
@cursor

cursor Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor Author

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@Tanya7z
Tanya7z merged commit d37f166 into main Jul 25, 2026
1 check passed
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