主题: release-management
-
Tags and releases: lightweight versus annotated tags and how they travel
A lightweight tag is only a name for a commit; an annotated tag is an object with tagger, date, message and optional signature, which is why git describe ignores lightweight tags by default and why releases should use annotated or signed tags; tags are not pushed with branches unless --follow-tags or --tags is used, and a published tag should never be moved.
-
Cherry-picking: when it fits and what it costs the history
git cherry-pick replays the change of a commit as a new commit with a different ID; it is the right tool for backporting a fix to a maintenance branch or salvaging one commit from an abandoned branch, but each pick creates a duplicate that merges cannot recognise, so record the origin with -x and merge instead of picking when the whole branch is wanted.
-
小型项目的发布节奏:定时发布列车与就绪即发布
版本号说明一个版本承诺什么,发布节奏策略则说明何时发布。Rust 通过 nightly、beta、stable 发布列车每六周推出稳定版;Python 根据 PEP 602 改为每年发布功能版本;Django 按时间表发布功能版本,按需发布补丁。小型项目可以借用这种形式:功能版本按日历发布或在积累了显著变化后发布,补丁版本在修复合入后发布。
-
Deprecating a function in a library: warn, document the replacement, remove on schedule
A library deprecation has four parts: a replacement that exists first, a runtime warning plus a documentation note naming the version and the replacement, a changelog entry, and a removal release fixed in advance by policy. PEP 387 requires a deprecation period of at least two years under Python's annual cadence and describes a documentation-only soft deprecation; Django removes shims no earlier than two feature releases after the warning.
-
Conventional Commits:机器可读的提交类型
Conventional Commits 规范为提交消息添加类型前缀(feat、fix 等)和破坏性变更标记,从而可以自动生成变更日志并确定版本升级。
-
语义化版本:版本号承诺了什么
Semantic Versioning 2.0.0 将兼容性承诺编码在 MAJOR.MINOR.PATCH 中,并定义预发布和构建元数据后缀;只有明确声明公开 API 时,这套规则才有意义。
-
API 版本管理:何时以及如何打破兼容性
大多数变更都可以通过新增能力完成。引入新主版本应是最后手段,因为它会使需要支持的接口范围翻倍。应在路径或媒体类型中标识版本,记录兼容性规则,并在移除功能之前先宣布弃用。
-
支持多条发布线:哪些修复应进入哪些版本
支持策略是一张列出各发布线状态(功能开发、缺陷修复、仅安全更新、生命周期结束)的表,以及按修复类别规定回移目标的规则。Python 为一个系列提供两年的缺陷修复版本,再提供三年仅含安全修复的版本;Django 将关键修复回移到最后一个功能版本,将安全和数据丢失修复回移到最后两个功能版本及长期支持线;Rust 仅支持最新稳定版。小型项目应发布该表,并默认作出自己能够兑现的最小范围承诺。
-
为人维护变更日志
变更日志是按版本整理、按时间排序的重要变更列表;Keep a Changelog 定义了一个小型结构(Added、Changed、Deprecated、Removed、Fixed、Security)和一个 Unreleased 部分。
机器可读: JSON