Mirroring #1013302: Versioned dependencies fail with dev versions and git clones . Depending #1314122: Allow grabbing the drupal_exec output. Because git gives it to us, this makes dev version numbers useful and different for every single dev release.
---
To clarify, the proposed structure of -dev versions strings would be like this:
[last-point-release]+[number-of-commits-since-then]-dev
For example, on the 7.x-3.x branch, if 7.x-3.0-rc1 is the most recent point release, -dev numbers would like like this:
7.x-3.0-rc1+228-dev
(assuming there have been 228 commits since rc1).
Once rc2 is out, -dev would start looking like this:
7.x-3.0-rc2+0-dev
Once there are a handful of more commits on the branch, it'd look like this:
7.x-3.0-rc2+4-dev
...
Comment | File | Size | Author |
---|---|---|---|
#16 | 1314180-16.fancy-rebuild-version.patch | 5.4 KB | dww |
#14 | 1314180-14.fancy-rebuild-version.patch | 4.93 KB | dww |
#12 | 1314180-12.patch | 2.77 KB | chx |
#8 | 1314180-8.patch | 3.07 KB | chx |
useful_dev_versions.patch | 1.26 KB | chx |
Comments
Comment #1
chx CreditAttribution: chx commentedNote: i am not rerolling this just yet but it misses --git-dir.
Comment #2
dwwAfter various discussions (especially at BADCamp) I'm basically +1 to this. See also #1360474: Record the exact git hash checked out in -dev releases into the packaged .info files (related, but different).
Fixing this will also allow Drupal distributions to reference -dev releases, instead of requiring official releases (which a lot of distro maintainers would love to be able to do). So, this issue is now listed at the Distribution Packaging community initiative page.
I'll hopefully be able to review and deploy this next week. Stay tuned.
Comment #3
chx CreditAttribution: chx commentedOK, I willl reroll this in ~24 hrs based on the code in git deploy because that's way more advanced by now.
Comment #4
moshe weitzman CreditAttribution: moshe weitzman commentedWould there be any changes to the update XML based on this issue? If so, Drush wants to know about it.
Comment #5
dwwJust the payload of the version string for -dev releases. No new attributes or other changes to the schema.
Comment #6
dwwSee also #1401990: Record a 'rebuild_version' for release nodes that are rebuilt
Comment #7
dww#1401990: Record a 'rebuild_version' for release nodes that are rebuilt is now done, pushed, and deployed live. So, we're ready to make use of that here...
Comment #8
chx CreditAttribution: chx commentedNew version, same code as git_deploy which runs this since October and didnt get a single bug report on the parsing itself so it mustn't be that bad.
Comment #9
moshe weitzman CreditAttribution: moshe weitzman commentedJust chatted with dww and we agreed not to change version_extra element of update xml since drush dl looks for dev releases with the xpath: /project/releases/release[status='published'][version_extra='dev']. I think that drupal core does the same.
Comment #10
dwwHrm, seems to not handle the case of a branch without a point release:
http://distro-drupal.redesign.devdrupal.org/node/1320270
:( Haven't had a chance to dig deeper yet, but wanted to post that here for initial feedback...
Comment #11
chx CreditAttribution: chx commentedI need a tarball of that partcular repo because if I run in a clone of project 7.x-2.x then a) correctly the release_version will be 7.x-2.x-dev b) git describe --tags 2768cc5cfcfe9792caa7245b1e81483b6e0f1409
says 6.x-1.0-alpha5-4-g2768cc5 (4, not 2).
Comment #12
chx CreditAttribution: chx commentedThe amount of comments begin to approach webchick-approved amounts.
Comment #13
dwwCool yeah, that's basically working now. However, we're re-doing all this work for *every* .info file in the thing we're packaging. And, we *only* do it if there are any .info files at all. It'd be nice to just do this once and always save the result, even if there's no .info files. I'm working on refactoring now... stay tuned.
Comment #14
dwwCool, this is now working pretty well:
http://distro-drupal.redesign.devdrupal.org/node/1320270
project 7.x-2.x-dev
Last packaged version: 7.x-2.x-dev
http://distro-drupal.redesign.devdrupal.org/node/357811
project 6.x-1.x-dev
Last packaged version: 6.x-1.0-alpha5+6-dev
The one slightly wonky case is when there have been no commits on a branch since the last release:
http://distro-drupal.redesign.devdrupal.org/node/408056
drupalorg_testing 6.x-1.x-dev
Last packaged version: 6.x-1.0-alpha10
Hrm. Not sure what I think about that. On the one hand, the Git hashes are the same, it really is identical code. OTOH, I'm downloading a tarball from -dev, so I'd expect to always have -dev in my version string. I was thinking I'd get something more like this in this case:
6.x-1.0-alpha10+0-dev
-- i.e. 0 commits since alpha10 on this -dev branch. Maybe that's over-complicating things. But I'm a little bit hesitant about deploying this with the current behavior.Anyway, here's the latest patch...
Comment #15
hunmonk CreditAttribution: hunmonk commenteddefinitely in favor of putting a +0 on if there's been no commits since the last tag. looks like that can just be tacked on to
$last_tag
at the end of this line?$this->release_version = isset($matches['gitextra']) ? $matches['drupalversion'] . '+' . $matches['numberofcommits'] . 'dev' : $last_tag;
the rest of the code looks good. i didn't waste time diving into the exact workings of the git magic or the regex stuff, as i'm guessing that's already been pretty well vetted.
Comment #16
dwwOkay, this fixes it so we now get '+0-dev' appended in the case that the branch points to the same commit as the last tag.
Tested and working. I think I'm ready to commit and deploy this...
Comment #17
hunmonk CreditAttribution: hunmonk commentedlooks great.
Comment #18
arlinsandbulte CreditAttribution: arlinsandbulte commentedsounds great to me!
Comment #19
dwwCommitted, pushed to 6.x-1.x, deployed live, and confirmed to be working:
http://drupal.org/node/357811
"Last packaged version: 6.x-1.0-alpha5+17-dev"
6.x-1.0-alpha5 was: 297dd4494600141f272aa01ad2208b51f80a24ec
Currently on 6.x-1.x branch, we're at: a4791f17ce839728c65a7c429cd48ec35c0b42ea
That's exactly the 17th commit in the git log along the 6.x-1.x branch. Yee haw! ;)
Now that the OSUOSL's rsync job to ftp.d.o has run, you can also do this:
Double yee haw! ;)
Now, of course this is only going to start showing up in -dev tarballs as new commits happen and the packaging script rebuilds them. We're not retroactively going back to rebuild everything.
Comment #20
Pasquallethis is really good, thanks
Comment #21.0
(not verified) CreditAttribution: commentedclarified the proposed format of version strings and provided examples