Merge lp:~corey.bryant/charm-helpers/git-1531612 into lp:charm-helpers
| Status: | Merged | ||||
|---|---|---|---|---|---|
| Merged at revision: | 515 | ||||
| Proposed branch: | lp:~corey.bryant/charm-helpers/git-1531612 | ||||
| Merge into: | lp:charm-helpers | ||||
| Diff against target: |
135 lines (+13/-22) 4 files modified
charmhelpers/contrib/openstack/utils.py (+6/-9) charmhelpers/fetch/giturl.py (+0/-3) tests/contrib/openstack/test_openstack_utils.py (+5/-5) tests/fetch/test_giturl.py (+2/-5) |
||||
| To merge this branch: | bzr merge lp:~corey.bryant/charm-helpers/git-1531612 | ||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Liam Young | 2016-01-08 | Approve on 2016-01-08 | |
|
Review via email:
|
|||
- 515. By Corey Bryant on 2016-01-08
-
Add git clone depth option to OpenStack deploy from source
| Corey Bryant (corey.bryant) wrote : | # |
| Corey Bryant (corey.bryant) wrote : | # |
Sample of yaml that overrides the default shallow clone to a normal git clone (see pbr depth):
repositories:
- {name: requirements,
repository: 'git://
branch: stable/kilo}
- {name: pbr,
repository: 'git://
branch: stable/kilo,
depth: 0}
- {name: neutron-fwaas,
repository: 'git://
branch: stable/kilo}
- {name: neutron-lbaas,
repository: 'git://
branch: stable/kilo}
- {name: neutron-vpnaas,
repository: 'git://
branch: stable/kilo}
- {name: neutron,
repository: 'git://
branch: stable/kilo}
| Corey Bryant (corey.bryant) wrote : | # |
Added a few inline comments.


The deploy from source support in the OpenStack charms performs shallow git clones (e.g. git clone --depth 1) by default. This increases the speed of a git clone significantly. However, there is a side-effect of shallow clones when they are pip installed, in that it causes pip to list the package version as 0.0.0, when in actuality the package version may have been 11.0.0. The next time a pip installed package needs a minimum version of that package (e.g. let's say it needs >= 10.0.0), it'll see that 0.0.0 is installed and it'll install the latest package from pypi.
Non-shallow git clones enable pip to see the actual version and prevent this issue. The openstack- origin- git yaml should support an option to override the default depth of git clones on a per-repo basis.