[Bug]: Nightly package versions do not sort by build time
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 72/100
调研方向
从工作流文件 ci.yml 开始,找到名为“Compute version suffix”的步骤,该步骤将 VersionSuffix 写入 $GITHUB_ENV。把它改为提案中的定宽 UTC 时间戳,并在构建步骤中通过 -p:SourceRevisionId 传入提交 SHA,使其出现在 InformationalVersion 中。当同一天的新 nightly 版本排序高于较早的构建,且 SHA 仅作为构建元数据出现时,即完成。可以在本地或通过工作流试运行执行打包步骤来检查结果。
由索引模型根据 Issue 内容生成。
描述
Problem
Nightly packages get a version suffix of the build date plus the commit SHA (ci.yml, "Compute version suffix"):
echo "VersionSuffix=$(date +'%Y%m%d')-${GITHUB_SHA::7}" >> "$GITHUB_ENV"
Within one day, versions are ordered by the SHA, which is random. NuGet compares 20261102-8979913 and 20261102-800815c as strings (SemVer alphanumeric identifiers), and 9 > 0, so the older build counts as higher:
| Version | Published | NuGet order |
|---|---|---|
1.0.0-alpha.20261102-8979913 |
14 hours ago | higher |
1.0.0-alpha.20261102-800815c |
12 hours ago | lower |
As a result:
dotnet tool install --global RazorConsole.Cli --version 1.0.0-alpha.20261102-800815cfails with "the requested version is lower than the installed version" when the older build is installed; it needsdotnet tool update --allow-downgrade.dotnet tool update,dotnet add package --prereleaseand Dependabot can pick an older build of the same day as the "latest".
This affects every package built with this suffix, not only RazorConsole.Cli.
Proposal
Use a fixed-width UTC timestamp instead of the SHA, keeping the hyphen:
echo "VersionSuffix=$(date -u +'%Y%m%d-%H%M%S')" >> "$GITHUB_ENV"
- The identifier stays alphanumeric and fixed-width, so string comparison follows build time.
- New versions sort above every version already published (except other builds of 2026-11-02, which is in the past).
- Keep the commit in the package as build metadata: pass
-p:SourceRevisionId=${GITHUB_SHA}so it ends up inInformationalVersion(1.0.0-alpha.20261103-083000+<sha>). Build metadata does not affect version ordering.
A purely numeric suffix (for example $(date +%Y%m%d).${GITHUB_RUN_NUMBER}) would sort correctly among new builds, but SemVer ranks numeric identifiers below alphanumeric ones. All new builds would then rank below the versions already published, so it should not be used without a version bump.
Workaround
dotnet tool update --global RazorConsole.Cli --version <version> --allow-downgrade
- 主要语言
- C#
- 星标
- 1.7k
- 派生
- 51
- 平均合并
- 2 天 6 小时
- 30 天内合并 PR
- 40
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
RazorConsole/RazorConsole 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 25/100
RazorConsole/RazorConsole#445 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 4/5 1-2 天 新手友好度 40/100
RazorConsole/RazorConsole#441 ·
维护者通常 1 天内回复
-
Bug
难度 3/5 1-2 天 新手友好度 45/100
RazorConsole/RazorConsole#437 ·
维护者通常 1 天内回复
-
Focus request made before the focus session starts is dropped可能已有人在做 @zidad 于 2 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 35/100
RazorConsole/RazorConsole#435 ·
维护者通常 1 天内回复
-
Events dispatched during a render batch duplicate elements可能已有人在做 @zidad 于 2 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 18/100
RazorConsole/RazorConsole#433 ·
维护者通常 1 天内回复
查看 RazorConsole/RazorConsole 的全部 Issue
相似的 Issue
-
难度 1/5 1-3 小时 新手友好度 78/100
QuantConnect/Documentation#2838 ·
维护者通常 1 天内回复
-
"Create your app": .sln/.slnx step and Solution Explorer instructions don't match current C# Dev Kit未关闭area-tutorials needs-triage
难度 1/5 1-3 小时 新手友好度 72/100
dotnet/website-feedback#1844 ·
-
Needs: Attention :wave: v5 v5-preview5
难度 2/5 1-3 小时 新手友好度 62/100
Azure/azure-functions-core-tools#5852 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
OrchardCMS/OrchardCore#20194 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 69/100
Gothic-Unity-Project/Gothic-Unity#487 ·
维护者通常 1 天内回复