PBR

pbr mishandling alpha tags

Bug #1370608 reported by Doug Hellmann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
PBR
Fix Released
Critical
Robert Collins

Bug Description

The master branch of pbr (5ac3783712938b17977c50d1fca0b7c1ccbd9710) reports that the version of oslo.rootwrap tagged 1.3.0.0a3 is "1.3.0". Commits after the alpha are given development version numbers, which are apparently less than the alpha, leading to the wrong versions of packages being installed in the gate.

http://logs.openstack.org/18/109118/4/gate/gate-neutron-dsvm-functional/287cfaf/logs/devstacklog.txt.gz#_2014-09-16_06_48_28_696

That log shows a packaged version of oslo.rootwrap being downloaded and installed because the version installed from source using the master branch was deemed older than the available package.

Changed in pbr:
importance: Undecided → Critical
status: New → Triaged
Revision history for this message
Robert Collins (lifeless) wrote :

so semver spec says that there is no comparison/sorting between dev and alpha versions.

That log shows
2014-09-16 06:46:31.184 | Installing /usr/local/lib/python2.7/dist-packages/oslo.rootwrap-1.3.0.dev10.g8c68df8-py2.7-nspkg.pth

which is expected and correct. Its a dev version because we chose to have fixed length versions,vs nested dev versions.

Then when we install cinder, cinder's versioned requirement on rootwrap >= 1.3.0.a1 is causing the installed version to be considered insufficient and it is upgraded from pypi.

I'm looking into the incorrect assessment of the tagged version.

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/122234

Changed in pbr:
assignee: nobody → Robert Collins (lifeless)
status: Triaged → In Progress
Revision history for this message
Robert Collins (lifeless) wrote :

Found the issue - we discarded the tag metadata when we went to a dev version, but for release tags of any sort we don't want a dev version.

Revision history for this message
Doug Hellmann (doug-hellmann) wrote :
Changed in pbr:
milestone: none → next-juno
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to pbr (master)

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

commit 7613992db7bc509ed154a83a8e2469561f4ab9db
Author: Robert Collins <email address hidden>
Date: Thu Sep 18 07:56:06 2014 +1200

    Honour validly tagged versions.

    There was a bug in the code to ignore bad tags - we stopped outputting
    actual release versions altogether.

    Change-Id: I0eb3fe6a09f0e696b96eab1e14549ea0a8fe27ba
    Closes-Bug: #1370608

Changed in pbr:
status: In Progress → Fix Committed
Changed in pbr:
milestone: next-juno → next-kilo
Revision history for this message
Robert Collins (lifeless) wrote :

Ok, with the tag recognition patch landed, lets see if this is still an issue.

From the log file:
Requirements:
oslo.rootwrap': 'oslo.rootwrap>=1.3.0.0a1

clone git oslo.rootwrap
pip install that

2014-09-16 06:46:29.978 | + pip_install /opt/stack/new/oslo.rootwrap
...

Then we get:

2014-09-16 06:48:27.606 | + pip_install -e /opt/stack/new/cinder
...
2014-09-16 06:48:28.696 | Downloading/unpacking oslo.rootwrap>=1.3.0.0a1 (from cinder==2014.2.0.dev61.g58eda5d)
2014-09-16 06:48:28.731 | Downloading oslo.rootwrap-1.3.0.0a2-py2-none-any.whl

2014-09-16 06:48:29.432 | Found existing installation: oslo.rootwrap 1.3.0.dev10.g8c68df8
2014-09-16 06:48:29.434 | Uninstalling oslo.rootwrap:
2014-09-16 06:48:29.437 | Successfully uninstalled oslo.rootwrap
Version in pip:

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

So whats happening is that pips version comparison is not aligned with the pbr semver doc from way back.

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

Actually no. Whats happening is that

1.3.0.dev10 was presumed < 1.3.0.0a1. Which is very odd. I'm going to ask the PEP-440 folk about this.

Revision history for this message
Alan Pevec (apevec) wrote :

What was the answer?
On neutron stable/kilo branch there's one commit after 2015.1.0rc1 tag and setup.py --version produces 2015.1.dev1
while on tag it produced 2015.1.0rc1 and one commit before the tag 2015.1.dev294

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

Two things; first, 0.10 is broken in this regard, we know this and thats why we want to fix it and release trunk.

The answer to the question was that PEP-440 specifies this order:
1.3.0.dev4 < 1.3.0.a1.dev3 < 1.3.0.a1 < 1.3.0.a2.dev2 < 1.3.0.a2 < 1.3.0

And pbr trunk has been altered so that given a pre-release tag, the next dev version will be assigned like so:
        self.repo.tag('1.2.3.0a1')
        self.repo.commit()
        version = packaging._get_version_from_git()
        self.assertThat(version, matchers.StartsWith('1.2.3.0a2.dev1'))

So from 1.2.3.0a1 -> 1.2.3.0a2.dev1, which is higher.

With neutron trunk pbr gives:
2015.2.0.dev85 with the last tag being 2015.1.0rc1, I'm not sure why - I'm going to investigate during my work week.

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

I looked into this. setup.cfg in Neutron trunk specifies 2015.2 as the next release, so this behaviour is correct.

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.