-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rfc: 0012-changelog-specification.md #12
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
b9442bc
Create 0012-changelog-specification.md
Zeno-sole 11ec97d
Update 0012-changelog-specification.md
Zeno-sole e027844
Update 0012-changelog-specification.md
Zeno-sole e6b601a
Update 0012-changelog-specification.md
Zeno-sole bf5f1df
Update 0012-changelog-specification.md
Zeno-sole b2e06dc
Update 0012-changelog-specification.md
Zeno-sole d783d84
Update 0012-changelog-specification.md
Zeno-sole d0d1fbc
Update 0012-changelog-specification.md
Zeno-sole 11e9ae3
Update 0012-changelog-specification.md
Zeno-sole 19c2cf5
Update 0012-changelog-specification.md
Zeno-sole 29dcf8a
Update 0012-changelog-specification.md
Zeno-sole 4dadd40
Update 0012-changelog-specification.md
Zeno-sole 38689e5
Update 0012-changelog-specification.md
Zeno-sole File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
# 统一的changelog版本号规范 | ||
|
||
- 提案发起时间:2024-07-25 | ||
- 提案拉取请求:https://github.com/deepin-community/rfcs/pull/12 | ||
|
||
## 概要 | ||
|
||
当前版本号管理较为混乱,各场景下的规则并未明细,应该提供统一的版本号规范 | ||
|
||
## 动机 | ||
|
||
明确版本号规范标记软件包修改信息、来源,方便通过版本号追踪与上游版本差异,提供更合理的rebuild版本机制。 | ||
|
||
## 详细设计 | ||
|
||
**changelog版本规范** | ||
|
||
`upstreamversion-${ver1}deepin${ver2}` | ||
|
||
#### 1. 假设上游项目打包版本号为 x.y.z ,deepin打包版本则为 `x.y.z-${ver1}deepin${ver2}` | ||
|
||
- ver1:ver1为0时表示 deepin自行打包的上游软件,ver1不为0时表示来自上游的quilt软件包自带的-ver版本 | ||
- ver2:表示来自deepin社区的修改,依次递增,不可为空从0开始计算 | ||
|
||
#### 2. 来自deepin community自行打包的上游软件 以0deepin开头标识,若该项目添加了来自deepin的patch则以deepin1 标识,依次累加, 版本号形式x.y.z-0deepin1 , 若上游已经添加-2这类版本号,版本号则为 x.y.z-2deepin1 | ||
|
||
#### 3. 集成native软件包 | ||
将native软件包直接改成quilt格式存在一些changelog版本格式不兼容问题 | ||
因此重新修订native版本规范,形式为 `upstreamversion+deepin${ver2}` | ||
native软件包没有-的连字符,因此直接在上游版本号后添加+deepin${ver2} 标记来自deepin的修改 | ||
Zeno-sole marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
#### 4. CI自动构建版本号 `x.y.z-${ver1}deepin${ver2}+u001+rb1`,001为距离上一次修改changelog的commit次数,rb1为rebuild次数,依次累加 | ||
> [!WARNING] | ||
> 注:commit版本号使用仅限于开发阶段自测验证,不应流转到集成阶段 | ||
|
||
#### 5. rebuild版本号规范 | ||
上文一二条保持不变,若存在需要rebuild软件包, | ||
|
||
##### quilt软件包rebuild规范: | ||
|
||
情况1:ver2不为空时直接+rb{ver}后缀,表现形式为`x.y.z-1deepin1+rb1` | ||
|
||
情况1:ver2为空时的rebuild版本ver2默认为0,表现形式为 | ||
`x.y.z-1deepin0+rb1` | ||
|
||
##### native软件包rebuild规范: | ||
|
||
情况1:ver2不为空时直接+rb{ver}后缀,表现形式为`x.y.z+deepin1+rb1` | ||
|
||
情况1:ver2为空时的rebuild版本ver2默认为0,表现形式为 | ||
`x.y.z+deepin0+rb1` | ||
|
||
> [!WARNING] | ||
> 注:rebuild版本号使用仅限于依赖包升级,相关依赖树需要基于新版本构建编译的场景使用 | ||
|
||
> [!TIP] | ||
> 注: deepin0版本的用意是为了方便后续的更新迭代,按照版本号规则 deepin+rb1版本大于deepin1+rb1,所以使用deepin0后缀方便后续维护 | ||
|
||
#### 6. 安全更新版本规范: | ||
|
||
- 对于相同版本软件包需要在两个以上的版本中做安全更新(例如 v23 and v26)时,为确保版本号正确,必须大于当前软包版本且小于后续发行版中的软件包版本,请示在版本号后缀中添加+dp${version}u${num}形式 | ||
- 对于v23版本 `upstreamversion-${ver1}deepin${ver2}+dp23u1` 对于v26版本 `upstreamversion-${ver1}deepin${ver2}+dp26u1` ,对于首次更新${ver2}值应当增加假设{ver2}为1 更新后应该为1.1此举是为了区别于主线版本号避免影响主线上的rebuild版本机制,对于主线的安全更新版本{ver2}加1即可, 对于后续的更新,$num值都应当累加,由于版本号形式较多建议使用 `dpkg --compare-versions` 验证版本号是否符合要求。 | ||
- 参考的形式 原版本 `upstreamversion-1deepin1` 安全更新版本 `upstreamversion-1deepin1.1+dp23u1` | ||
- 当deepin${ver2} 不存在时,此时安全更新的ver2版本应该使用0.1 主线版本使用1 避免与主线版本冲突, 参考的形式`upstreamversion-1deepin0.1+dp23u1` | ||
- 对于非上述情况时应当遵循上文的版本号规范提交。 | ||
> [!TIP] | ||
> 注: dp为deepin的缩写 | ||
|
||
> [!TIP] | ||
> 注: 历史遗留的版本号不在本次讨论范围内,新的提交的软件包构建集成等应遵循新版本规范 | ||
|
||
|
||
Zeno-sole marked this conversation as resolved.
Show resolved
Hide resolved
|
||
#### 7. 总结 | ||
##### BNF规则 | ||
``` | ||
<digit> ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | ||
<nonzero_digit> ::= "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | ||
<digit_sequence> ::= <digit> | <digit> <digit_sequence> | ||
/* >= 1 */ | ||
<positive_integer> ::= <nonzero_digit> | <nonzero_digit> <digit_sequence> | ||
|
||
|
||
/* This coresponds to the "upstream‐version" field in deb-version(7) */ | ||
<UPSTREAM_VERSION> ::= "1.0.0" | ||
|
||
/* This coresponds to the "[epoch:]" field in deb-version(7) */ | ||
<EPOCH> ::= E | <positive_integer> ":" | ||
|
||
/* This coresponds to the "debian‐revision" field in deb-version(7) */ | ||
<DEBIAN_REVISION> ::= <positive_integer> | ||
|
||
/* ${ver1}deepin${ver2}, ver2 is incremental */ | ||
/* 0deepinY: Y >= 1 */ | ||
/* XdeepinY: Y=0 means rebuild, Y>1 means patching */ | ||
<DEEPIN_REVISION> ::= "0deepin" <positive_integer> | <DEBIAN_REVISION> "deepin" [0-9]+ | ||
|
||
<VER_MAINLINE_GITHUB_DEBIAN> ::= <EPOCH> <UPSTREAM_VERSION> "-" <DEBIAN_REVISION> | ||
<VER_MAINLINE_GITHUB_DEEPIN> ::= <EPOCH> <UPSTREAM_VERSION> "-" <DEEPIN_REVISION> | ||
<VER_MAINLINE_GITHUB> ::= <VER_MAINLINE_GITHUB_DEBIAN> | <VER_MAINLINE_GITHUB_DEEPIN> | ||
|
||
<REBUILD_TAG> ::= E | "+rb" <positive_integer> | ||
|
||
/* We don't allow REBUILD_TAG after VER_MAINLINE_GITHUB_DEBIAN */ | ||
<VER_MAINLINE_REPO> ::= <VER_MAINLINE_GITHUB_DEBIAN> | <VER_MAINLINE_GITHUB_DEEPIN> <REBUILD_TAG> | ||
|
||
/* Definition of CI version */ | ||
<CI_REVISION> ::= [0-9] [0-9] [0-9] | ||
<CI_TAG> ::= E | "+u" <CI_REVISION> | ||
|
||
<VER_CI> ::= <VER_MAINLINE_GITHUB> <CI_TAG> | ||
|
||
/* Definition of Security version */ | ||
<VER_DEEPIN_MAJOR> ::= "23" | "25" | ||
<SECURITY_TAG> ::= "+dp" <VER_DEEPIN_MAJOR> "u" <positive_integer> | ||
|
||
/* SECURITY_SUFFIX is used to override ver2 when needed */ | ||
/* See: https://github.com/deepin-community/rfcs/pull/12/#discussion_r1721540877 */ | ||
/* if mainline is 1.0.0-1, the security version should be 1.0.0-1deepin0.1+dp23u1 */ | ||
/* if mainline is 1.0.0-1deepin0, the security version should be 1.0.0-1deepin1.1+dp23u1 too */ | ||
/* if mainline is 1.0.0-1deepinY (Y>1), the security version should be 1.0.0-1deepinY.1+dp23u1 */ | ||
<SECURITY_VER2_SUFFIX> ::= E | "." <positive_integer> | ||
<VER_SECURITY_GITHUB> ::= <VER_MAINLINE_GITHUB_DEEPIN> <SECURITY_VER2_SUFFIX> <SECURITY_TAG> | ||
<VER_SECURITY_REPO> ::= <VER_SECURITY_GITHUB> <REBUILD_TAG> | ||
``` | ||
|
||
附带一个 BNF Playground: https://bnfplayground.pauliankline.com/ | ||
|
||
> [!TIP] | ||
> 可参考BNF验证自己写的版本号是否符合规范 | ||
|
||
##### 完整的构造 | ||
`upstreamversion-${ver1}deepin${ver2}[+dp26u${num}][+u${ver3}][+rb${ver4}]` | ||
- ${ver1} 来自deepin的上游的版本 | ||
- ${ver2} 来自deepin的patch版本,这块必须,且从0开始 如无任何修改则不需要加该字 | ||
- [+dp26u${num}] 安全补丁版本,这块只有在多版本发布安全补丁时需要 | ||
- [+u${ver3}] CI编译版本,只有CI开发环境编译时有 | ||
- [+rb${ver4}] rebuild次数,这块只有rebuild时才添加 | ||
- 主线 GitHub 版本为 `upstreamversion-${ver1}deepin${ver2}` | ||
- 主线仓库会有 [+rb],不在GitHub,在OBS生成; | ||
- 安全更新在 GitHub,非主线,有 [+dp26u${num}]; | ||
- [+u${ver3}] 为开发版本,在GitHub内不出现,在仓库内不出现,但是出现在 CI 中 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为啥不定一个全局统一的版本号规范呢,这样的话不用判断那么多种情况了
我的建议如下
upstreamversion+deepin${ver1}[+dp26u${ver2}][+u${ver3}][+rb${ver4}]
ver1 来自deepin的patch版本,这块必须,且从0开始
ver2 安全补丁版本,这块只有发布安全补丁时需要
ver3 CI编译版本,这快只有CI编译时有
ver4 rebuild次数,这块只有rebuild时才添加
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
针对不用情况下使用不同的版本号规范,上述的很多情况都是少数情况下才会使用,开发者&审阅者需要判断当前软件包处理什么状态
其次这个规范本就是全局统一的, 只是分不同的情况分开讨论了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
因为我们要定主线/非主线
主线是没有安全补丁、CI编译的,只有rebuild
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我这个是所有的都使用同一个格式, upstreamversion 后跟了四大块,[] 里的内容是非必须的,需要的时候添加,这样可以组合出文章里提到的全部情况
upstreamversion
+deepin${ver1}
[+dp26u${ver2}]
[+u${ver3}]
[+rb${ver4}]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我的意思是不同情况下格式不太一样,我上边的建议是统一的格式,需要的项目自由增删
upstreamversion
+deepin${ver1}
[+dp26u${ver2}]
[+u${ver3}]
[+rb${ver4}]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
使用 UTsweetyfish 提的方案3 也就不需要改这个了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kt286 @RevySR @UTsweetyfish 已更新 用UTsweetyfish提出的方案三解决 +dp23u1 < rb1 的问题 ,请各位及时review或提出其他问题
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BNF 已更新
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BNF已经加入正文中
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kt286 @RevySR @UTsweetyfish BNF已更新 请及时review 期望本周内能merge