0xMiden / 0xMiden/miden-vm

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

Aperta
#3,654 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Rust
Stelle
772
Fork
352
Merge medio
1g 12h
PR unite (30g)
93

Descrizione

### 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

```

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.