version detection code produces wrong version

Bug #1090592 reported by Joshua Harlow
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Undecided
Unassigned
Grizzly
Fix Released
Undecided
Unassigned
Glance Client
Fix Released
Medium
Unassigned
OpenStack Compute (nova)
Fix Released
High
Unassigned
oslo-incubator
Fix Released
High
Monty Taylor
python-keystoneclient
Fix Released
Undecided
Unassigned
python-novaclient
Fix Released
Low
Unassigned

Bug Description

Running the following is making some pretty odd files...

python setup.py --version on 0.6.0 tag.

$ python setup.py --version
0.6.0
0.7.0

It seems to be due to the common/openstack setup.py.

It uses the following.

$ git tag --contains HEAD
0.6.0
0.7.0

To reproduce:

1. git clone git://github.com/openstack/python-glanceclient.git
2. cd python-glanceclient/
3. git checkout 0.6.0
4. git tag --contains HEAD

The common setup.py might want to use the following instead.

$ git describe --always --tag

Revision history for this message
Joshua Harlow (harlowja) wrote :

Or perhaps the glanceclient git repo shouldn't have 2 tags linked to head (??)

Revision history for this message
Joshua Harlow (harlowja) wrote :

Note this weirdness causes the versioninfo file to be wrong also.

$ cat glanceclient/versioninfo
0.6.0
0.7.0

Revision history for this message
Brian Waldon (bcwaldon) wrote :

Your HEAD points at the commit which the 0.6.0 tag also points to. Since 0.7.0 is a superset of 0.6.0, it makes sense for the commit that HEAD resolves to is contained in both tags.

Not saying this isn't weird, just lending a bit of explanation.

Revision history for this message
Joshua Harlow (harlowja) wrote :

Makes a little more sense with the above, perhaps version detection code isn't 100% the best. I can see people checking out tags and wanting to have the version that python thinks its on actually be the tag they are on and not many tags. Thats how i ran into this, was a wtf moment :-P

Revision history for this message
Monty Taylor (mordred) wrote :

Yeah - I need to fix the code. Noted. thanks!

Revision history for this message
Mark McLoughlin (markmc) wrote :

Pretty confident this is fixed by https://review.openstack.org/18897

Changed in oslo:
status: New → Fix Committed
assignee: nobody → Monty Taylor (mordred)
importance: Undecided → High
Monty Taylor (mordred)
summary: - Glance client version incorrect
+ version detection code produces wrong version
no longer affects: openstack-ci
iopenstack (drdanhe)
Changed in nova:
importance: Undecided → Low
Changed in python-novaclient:
importance: Undecided → Low
Revision history for this message
Johannes Erdfelt (johannes.erdfelt) wrote :

This change broke running unit tests for me. 822 tests fail with an error similar to this:

Traceback (most recent call last):
  File "/home/johannes/openstack/nova/trunk/nova/tests/test_service.py", line 172, in test_init_and_start_hooks
    serv.start()
  File "/home/johannes/openstack/nova/trunk/nova/service.py", line 425, in start
    verstr = version.version_string_with_package()
  File "/home/johannes/openstack/nova/trunk/nova/version.py", line 87, in version_string_with_package
    return version_info.version_string()
  File "/home/johannes/openstack/nova/trunk/nova/openstack/common/version.py", line 63, in version_string
    for part in self.release_string().split('.'):
AttributeError: 'NoneType' object has no attribute 'split'

Changed in oslo:
status: Fix Committed → New
Changed in nova:
importance: Low → High
Revision history for this message
Brian Waldon (bcwaldon) wrote :

This does appear to fix the original bug reported by josh in python-glanceclient. It does introduce the 'bug' of ignoring unsigned tags (which all of the python-glanceclient tags happen to be).

Changed in python-glanceclient:
status: New → Fix Committed
Changed in glance:
status: New → Fix Committed
milestone: none → grizzly-3
Brian Waldon (bcwaldon)
Changed in python-glanceclient:
importance: Undecided → Medium
Brian Waldon (bcwaldon)
Changed in python-glanceclient:
milestone: none → v0.8.0
Thierry Carrez (ttx)
Changed in glance:
status: Fix Committed → Fix Released
Brian Waldon (bcwaldon)
Changed in python-glanceclient:
status: Fix Committed → Fix Released
Changed in nova:
status: New → Fix Released
Revision history for this message
Thierry Carrez (ttx) wrote :

pretty sure this is fixed everywhere now. Please reopen if that's not the case.

Changed in oslo:
status: New → Fix Released
Changed in python-keystoneclient:
status: New → Fix Released
Changed in python-novaclient:
status: New → 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.