preversioning versions don't take pre-release tags into account
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
PBR |
Fix Released
|
Critical
|
Robert Collins |
Bug Description
In neutron's stable/kilo branch, top four commits and their pbr versions:
7260e0e Run radvd as root [tagged 2015.1.0rc3 ] => 2015.1.0.0rc3
d37e566 Don't resync on DHCP agent setup failure => 2015.1.0.dev1
9e11336 Merge "Restrict subnet create/update to avoid DHCP resync" into stable/kilo [tagged 2015.1.0rc2]=> 2015.1.0.0rc2
The middle version is wrong - it preceeds the rc versions.
(x.dev < x.rc1.dev < x.rc1 < x.rc2.dev < x.rc2 < x)
To reproduce in a neutron tree:
$ git reset --hard d37e566
HEAD is now at d37e566 Don't resync on DHCP agent setup failure
$ git describe
2015.1.
$ python setup.py egg_info
$ grep Version neutron.
Version: 2015.1.0.dev1
What we'd expect is 2015.1.0.0rc3.dev1 which will be generated if we remove version: from setup.cfg.
Preversioning is the culprit:
556 if distance == 0:
557 return last_semver
558 import pdb;pdb.set_trace()
559 -> if target_version is not None:
560 return target_
561 else:
562 return new_version.
A possible fix would be to compare target_
I'm not sure that it won't fall out somewhere else, but its worth trying.
Changed in pbr: | |
importance: | High → Critical |
Changed in pbr: | |
status: | Fix Committed → Fix Released |
(from 1206730)