PBR

preversioning versions don't take pre-release tags into account

Bug #1450210 reported by Robert Collins
6
This bug affects 1 person
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.0rc2-1-gd37e566
$ python setup.py egg_info
$ grep Version neutron.egg-info/PKG-INFO
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_version.to_dev(distance)
561 else:
562 return new_version.to_dev(distance)

A possible fix would be to compare target_version.to_dev(distance) with new_version.to_dev(distance), and take the higher.

I'm not sure that it won't fall out somewhere else, but its worth trying.

Revision history for this message
Robert Collins (lifeless) wrote :

(from 1206730)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to pbr (master)

Fix proposed to branch: master
Review: https://review.openstack.org/178852

Changed in pbr:
assignee: nobody → Robert Collins (lifeless)
status: Triaged → In Progress
Changed in pbr:
importance: High → Critical
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to pbr (master)

Reviewed: https://review.openstack.org/178852
Committed: https://git.openstack.org/cgit/openstack-dev/pbr/commit/?id=a67e2c346c5193cf36e381694d8fddb0d826df6b
Submitter: Jenkins
Branch: master

commit a67e2c346c5193cf36e381694d8fddb0d826df6b
Author: Robert Collins <email address hidden>
Date: Thu Apr 30 09:47:22 2015 +1200

    Issue #1450210: Preversioning rc tag handling

    We were generating versions lower than the last tag when preversioning
    was in use and pre-release versions had been tagged.

    Also attempt to run the script without devstack.

    Change-Id: If984939003ae7c513ee76b52c6808db0c1766050
    Closes-Bug: #1450210

Changed in pbr:
status: In Progress → Fix Committed
Changed in pbr:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.