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
...

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

chx’s picture

Note: i am not rerolling this just yet but it misses --git-dir.

dww’s picture

After 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.

chx’s picture

OK, I willl reroll this in ~24 hrs based on the code in git deploy because that's way more advanced by now.

moshe weitzman’s picture

Would there be any changes to the update XML based on this issue? If so, Drush wants to know about it.

dww’s picture

Just the payload of the version string for -dev releases. No new attributes or other changes to the schema.

dww’s picture

dww’s picture

#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...

chx’s picture

FileSize
3.07 KB

New 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.

moshe weitzman’s picture

Just 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.

dww’s picture

Status: Needs review » Needs work

Hrm, seems to not handle the case of a branch without a point release:

http://distro-drupal.redesign.devdrupal.org/node/1320270

Development snapshot from branch: 7.x-2.x
Last packaged version: 6.x-1.0-alpha5+2-dev

:( Haven't had a chance to dig deeper yet, but wanted to post that here for initial feedback...

chx’s picture

I 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).

chx’s picture

FileSize
2.77 KB

The amount of comments begin to approach webchick-approved amounts.

dww’s picture

Assigned: chx » dww

Cool 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.

dww’s picture

Status: Needs work » Needs review
FileSize
4.93 KB

Cool, 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...

hunmonk’s picture

definitely 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.

dww’s picture

Okay, 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...

hunmonk’s picture

Status: Needs review » Reviewed & tested by the community

looks great.

arlinsandbulte’s picture

sounds great to me!

dww’s picture

Status: Reviewed & tested by the community » Fixed

Committed, 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:

% wget http://ftp.drupal.org/files/projects/project-6.x-1.x-dev.tar.gz
% tar zxvf project-6.x-1.x-dev.tar.gz
% cat project/project.info
name = Project
description = Provides a project node type and browsing of projects.
package = Project
dependencies[] = views
core = 6.x

; Information added by drupal.org packaging script on 2012-01-14
version = "6.x-1.0-alpha5+17-dev"
core = "6.x"
project = "project"
datestamp = "1326507234"

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.

Pasqualle’s picture

this is really good, thanks

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

clarified the proposed format of version strings and provided examples