0xMiden / 0xMiden/miden-vm

bug: version_cmp ignores prerelease labels, treats "1.5.0" and "1.5.0-alpha.3" as equal

未关闭 适合新手
#3,654 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Rust
星标
772
派生
352
平均合并
1 天 7 小时
30 天内合并 PR
84

描述

### Packages versions

miden-vm: 0.30.0 (this bug is in scripts/lib/release-plan-common.sh, part of the repo's release tooling, not a published crate not really version-specific, but this is the current workspace version)

### Bug description

this time in scripts/lib/release-plan-common.sh. There is a function called version_cmp that checks whether a new version is actually newer than what is already published. The problem is it ignores prerelease labels like "-alpha.1". So it thinks "1.5.0" and "1.5.0-alpha.3" are the exact same version, when really 1.5.0 should count as newer.

This could cause a real release to get wrongly rejected as "not newer than what's already published" if the last published version was a prerelease.

I already have a fix ready with tests.

### How can this be reproduced?

1. source scripts/lib/release-plan-common.sh
2. Run: version_cmp "1.5.0" "1.5.0-alpha.3"
3. It prints 0 (equal). It should print 1, since 1.5.0 is the real release and should count as newer than its own alpha version.

### Relevant log output

```shell

```

贡献指南

打开贡献指南

调研方向

The bug is in the `version_cmp` function in `scripts/lib/release-plan-common.sh`. Start by reading that file to understand the current version comparison logic. The fix must make the function recognize that a release version (e.g., '1.5.0') is newer than its prerelease (e.g., '1.5.0-alpha.3'). Test the fix by sourcing the script and running the example command from the issue to verify it returns 1.

由索引模型根据 Issue 内容生成。

评估

技术栈
bash, shell
领域
cli, release
Issue 类型
缺陷
难度
2/5
预计耗时
1-3 小时
活跃度
活跃
描述清晰度
描述清楚
新手友好度
75/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。