commit-helper
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCockroachDB Commit Helper
CockroachDB 提交助手
Help the user create properly formatted commit messages and release notes that follow CockroachDB conventions.
帮助用户创建符合CockroachDB规范、格式正确的提交消息和发布说明。
Workflow
工作流程
- Analyze the changes: Run or
git diff --stagedto understand what was modifiedgit diff - Determine the package prefix: Identify the primary package affected
- Ask the user for:
- Issue/epic number if not already known
- Whether release notes are needed and what category fits best
- Write the subject line: Imperative mood, no period, under 72 characters
- Write the body: Explain the before/after, why the change was needed
- Add issue references: Include Resolves/Epic as appropriate
- Write the release note: Clear, user-focused description of the change
- Create the commit using the properly formatted message
- 分析更改:运行或
git diff --staged以了解修改内容git diff - 确定包前缀:识别受影响的主要包
- 询问用户以下信息:
- 问题/史诗编号(如果尚未知晓)
- 是否需要发布说明以及最适合的类别
- 编写主题行:使用祈使语气,无句号,长度不超过72个字符
- 编写正文:解释更改前后的情况、为什么需要进行此更改
- 添加问题引用:根据需要包含Resolves/Epic
- 编写发布说明:清晰、以用户为中心的更改描述
- 创建提交:使用格式正确的消息
Commit Message Structure
提交消息结构
Basic Format:
package: imperative title without period
Detailed explanation of what changed, why it changed, and
how it impacts users. Explain the problem that existed
before and how this commit solves it.
Include context about alternate approaches considered and
any side effects or consequences.
Resolves: #123
Epic: CRDB-357
Release note (category): Description of user-facing change
in past or present tense explaining what changed, how users
can see the change, and why it's important.Key Requirements:
- Must include release note annotation (even if "Release note: None")
- Must include issue or epic reference
- Must separate subject from body with blank line
- Recommended prefix subject with affected package/area
- Recommended use imperative mood in subject (e.g. "fix bug" not "fixes bug")
- Recommended wrap body at 72-100 characters
基本格式:
package: imperative title without period
Detailed explanation of what changed, why it changed, and
how it impacts users. Explain the problem that existed
before and how this commit solves it.
Include context about alternate approaches considered and
any side effects or consequences.
Resolves: #123
Epic: CRDB-357
Release note (category): Description of user-facing change
in past or present tense explaining what changed, how users
can see the change, and why it's important.关键要求:
- 必须包含发布说明注释(即使是“Release note: None”)
- 必须包含问题或史诗引用
- 必须用空行分隔主题和正文
- 建议在主题前添加受影响的包/区域前缀
- 建议在主题中使用祈使语气(例如“fix bug”而非“fixes bug”)
- 建议正文每行长度控制在72-100个字符
Release Note Categories
发布说明类别
When to include release notes:
- Changes to user interaction or experience
- Changes to product behavior (performance, command responses, architecture)
- Bug fixes affecting external users
When to exclude release notes:
- Internal refactors, testing, infrastructure work
- Code that's too immature for docs (private preview features)
- Internal settings beginning with
crdb_internal. - Functionality not accessible to external users
Valid Categories:
- - Breaking changes to stable interfaces
backward-incompatible change - - Features requiring enterprise license
enterprise change - - Commands/endpoints for operators (logging, metrics, CLI flags)
ops change - - Commands for developers/contributors (SQL shells, debug tools)
cli change - - SQL statements, functions, system catalogs
sql change - - DB Console changes
ui change - - Security feature changes
security update - - Performance enhancements
performance improvement - - Multi-tenancy infrastructure
cluster virtualization - - Problem fixes
bug fix - - Changes that don't fit elsewhere
general change - - Source build requirements
build change
何时需要包含发布说明:
- 用户交互或体验的更改
- 产品行为的更改(性能、命令响应、架构)
- 影响外部用户的 bug 修复
何时无需包含发布说明:
- 内部重构、测试、基础设施工作
- 尚未成熟到可文档化的代码(私有预览功能)
- 以开头的内部设置
crdb_internal. - 外部用户无法访问的功能
有效类别:
- - 对稳定接口的破坏性更改
backward-incompatible change - - 需要企业许可证的功能
enterprise change - - 面向运维人员的命令/端点(日志、指标、CLI 标志)
ops change - - 面向开发者/贡献者的命令(SQL shell、调试工具)
cli change - - SQL 语句、函数、系统目录
sql change - - DB Console 更改
ui change - - 安全功能更改
security update - - 性能增强
performance improvement - - 多租户基础设施
cluster virtualization - - 问题修复
bug fix - - 不适合其他类别的更改
general change - - 源码构建要求
build change
Release Note Best Practices
发布说明最佳实践
Description guidelines:
- Default to more information rather than less
- Explain what changed, how it changed, and why it's relevant
- Use past tense ("Added", "Fixed") or present tense ("CockroachDB now supports")
- For bug fixes: describe cause, symptoms, and affected versions
- Note if change is part of broader roadmap feature
Examples:
Good bug fix:
Release note (bug fix): Fixed a bug introduced in v19.2.3 that
caused duplicate rows in CREATE TABLE ... AS results when multiple
nodes attempt to populate the results.Good feature:
Release note (enterprise change): Shortened the default interval
for the kv.closed_timestamp.target_duration cluster setting from
30s to 3s. This allows follower reads at 4.8 seconds in the past,
a much shorter window than the previous 48 seconds.描述准则:
- 宁多勿少,提供充分信息
- 解释什么更改了、如何更改以及为什么相关
- 使用过去时(“Added”、“Fixed”)或现在时(“CockroachDB now supports”)
- 对于 bug 修复:描述原因、症状和受影响的版本
- 注明更改是否属于更广泛的路线图功能的一部分
示例:
良好的 bug 修复说明:
Release note (bug fix): Fixed a bug introduced in v19.2.3 that
caused duplicate rows in CREATE TABLE ... AS results when multiple
nodes attempt to populate the results.良好的功能说明:
Release note (enterprise change): Shortened the default interval
for the kv.closed_timestamp.target_duration cluster setting from
30s to 3s. This allows follower reads at 4.8 seconds in the past,
a much shorter window than the previous 48 seconds.Issue References
问题引用
- - Auto-closes issue on PR merge
Resolves: #123 - - Cross-references issues
See also: #456, #789 - - Links to epic
Epic: CRDB-357
- - PR 合并时自动关闭问题
Resolves: #123 - - 交叉引用问题
See also: #456, #789 - - 链接到史诗
Epic: CRDB-357
How to Avoid Common Pitfalls
如何避免常见陷阱
- Always include a release note annotation (even "Release note: None")
- Use only valid category names from the list above
- Keep release notes focused on user-facing information
- Write specific descriptions that explain the impact to users
- Use category for any breaking changes
backward-incompatible change - End subject lines without punctuation
- Explain the "why" behind changes, not just the "what"
- 始终包含发布说明注释(即使是“Release note: None”)
- 仅使用上述列表中的有效类别名称
- 发布说明应专注于面向用户的信息
- 编写具体的描述,解释对用户的影响
- 任何破坏性更改都使用类别
backward-incompatible change - 主题行末尾不要加标点
- 解释更改背后的“原因”,而不仅仅是“内容”
Pull Request Guidelines
拉取请求准则
- Create PRs from your personal fork, not directly on cockroachdb/cockroach
- Single-commit PRs: PR title should match commit title, PR body should match commit body
- 从个人分支创建PR,不要直接在cockroachdb/cockroach上创建
- 单提交PR:PR标题应与提交标题匹配,PR正文应与提交正文匹配