Background

#850142: Integrate VCAPI with project_release node add form is a giant snake pit waiting to eat a couple weeks of my life. The current code in cvs.module is basically D4.7 era FAPI that alters a node form and conditionally turns it into a multi-step form with a variable number of steps(!). I've ported the code to D5 and D6, but never fundamentally re-wrote it or revisited how/why it works the way it does (due to time constraints during porting). I'm pretty sure I'm the only person on Earth who understands how this code works. I do not want to replicate this state of affairs when migrating to Git.

Easily 50% (or more) of the complication comes from the dreaded HEAD release nodes. If you create a release node pointing to CVS HEAD, you land on an intermediate page that asks you to fill in some version information. Maintainers regularly get this wrong and end up with wonky version strings. And, there's some weirdness with validation that's allowing some people to use this to create bogus releases with duplicate version strings (see #733286: Multiple releases nodes with the same name for more). In fact, there's whole pile of issues in the cvs.module queue dealing with edge cases and badness of HEAD releases:
#89699: make release node form smarter when editing HEAD releases
#370603: Previewing HEAD release nodes is broken in 6.x
#410182: Fix the UI when creating release nodes pointing to HEAD
...

Plus, there's the end-user problem of if you happen to check out from HEAD and you think that's 6.x-1.x-dev and months later, the maintainer decides to create a real DRUPAL-6--1 branch and start porting to D7 in HEAD.

I've written entire handbook pages about how to handle HEAD releases given talks at numerous DrupalCons (including a Tufte-compliant handout about managing releases). In CVS, all this was sort of necessary and worth it, since it's much more of a pain in the neck to maintain multiple branches. It's much better to do all your development in HEAD and only create branches for stable release series for bug fixes and such. Plus, the way CVS handles file revision numbers, if you keep branching off branches off branches, you end up with completely bizarre revision numbers, the CVS logs get more confusing to understand, etc.

However, in Git, there's basically no cost of having multiple branches. Merging fixes across branches is very easy. There's no specific concept of a privileged HEAD branch (there's a default branch called 'master', but it has no special significance to Git at all).

Proposal

Once we move to Git, there shall never again be release nodes that point to 'HEAD' branches (or anything like them, 'master', etc). We already enforce that if you want an official release, you need a tag. That's staying the same (and in fact, the tags will just look like version strings, no funky mapping necessary). If you want a -dev release node, you have to create a branch that's named appropriately. See http://groups.drupal.org/node/85269 for more.

This has all the following benefits:

A) Massively simplifies the release node integration code since we no longer need the crazy intermediate page. All release nodes will have the same set of pages and steps:
page 0: pick a project (if it's not already in the URL)
page 1: pick a branch or tag
page 2: everything else

B) Easier to document and understand for project maintainers.

C) Easier for end users, since they never are tempted to checkout a generic branch that might change down the road out from under them.

Legacy release nodes currently pointing to HEAD

The one sucky thing here is that we currently have 3388 release nodes pointing to 'HEAD' somewhere. :( We need to do *something* with these. sdboyer tells me that the current plan is during the migration, 'HEAD' will be renamed to 'master'. So, that means we'd still have existing release nodes that point to 'master'. Drat.

However, at least we won't allow *new* release nodes to point to 'master'. And, existing release nodes already know their version information. So, we could just add a special case (sort of like we have now) that allows release maintainers to move the branch a release node points to if a branch with the matching version information is available in that project's Git repo. This is a one-time operation -- you can only move from generic (HEAD/master) to specific (DRUPAL-6--1/6.x-1.x), not the other way around. So, we'd still have these legacy nodes hanging around, but at least no new ones would be created going forward, and hopefully many of them will be moved to proper branches rather quickly after the migration.

----

So, that's the plan. Any objections? Marking this 'major' since the outcome of this decision is blocking progress on the exploratory work I need to do for #850142 to see just how bad that task is really going to be...

Thanks,
-Derek

Comments

dww’s picture

p.s. Another approach to the legacy stuff would be to use the existing HEAD release nodes to know the version information of what's in HEAD and during the migration, instead of renaming HEAD to 'master', give it a proper branch (if we know the version info). But, that's potentially dangerous and error-prone. Probably safer to just force maintainers to do this clean up themselves. Anyway, food for thought.

rfay’s picture

+1

Git has no real attachment to master, and people never understand the whole HEAD thing anyway. So let's do it.

webchick’s picture

Assigned: Unassigned » webchick
Status: Active » Needs review
Issue tags: +git sprint 3

Tagging as something to figure out this sprint. Assigning to myself for lack of a better assignee.

+1000 from me. I'm one of those people who checks projects out from CVS and up until I learned about drush dl --package-handler=cvs this was an incredibly annoying process of having to check the release node for the proper branch and then change my commands accordingly. And there is nothing more irritating than doing a routine cvs up and getting the next version's code. Ugh.

I also estimate that this is the 3rd or so most frequently asked support request on IRC regarding CVS. Barriers to contrbution--. It's also something that requires people with site maintainer privileges to deal with, when someone wants to change the release HEAD is pointing to, and that very tiny group of people has much bigger things they could ideally spend their time on.

So given that, I'd be quite interested to see if there was a possible way to write a migration path for this (even to throw out as a "git low hanging fruit" task for one of the volunteers to possibly take on). Maybe even something that might be doable as a Google Code-In task? Something like...

1. Loop through that list of projects.
2. Find the name of the release node.
3. Create an according branch in the Git repo.
4. Commit all the code there.
5. Repeat.

(Of course, if I am showing ignorance here and it's actually far more complex, let's throw the idea out the window. The important thing is that we can reduce the amount of crying during the VC Project work. :))

webchick’s picture

Assigned: webchick » Unassigned
Status: Needs review » Active

LOL. I see what I wrote at the end there was exactly what you wrote in #1. Duh.

Yeah, I suppose the fact that we might *lose* code is a potential deal-breaker here. OTOH, I imagine we'll keep the legacy CVS mirror up for at least a few months after the initial migration. Hmmm.

webchick’s picture

Assigned: Unassigned » webchick
Status: Active » Needs review

And the weirdest browser caching behaviour award goes to Firefox 4 beta!

webchick’s picture

Status: Needs review » Reviewed & tested by the community

Ok. Unless someone comes up with an argument against this by our Friday stand-up call at noon PST, we're going to call this decision made.

dww’s picture

Status: Reviewed & tested by the community » Needs review

How would anyone even find this issue to know if they have an objection or not? This issue queue is completely hidden from view unless you know the secret password (the URL). It's not linked from anywhere that I know of. Shouldn't we do at least one of the following?

a) post something to g.d.o to solicit concerns

b) post something to the development mailing list

c) twitter stuff (ugh)

?

dww’s picture

and/or:

d) at least make some noise about this in #drupal and #drupal-contribute in IRC?

webchick’s picture

Ok, fine. :P

http://twitter.com/DrupalGitGremln/status/29010644332
http://lists.drupal.org/pipermail/development/2010-October/036536.html
Melissa's working on a post on g.d.o.
I don't have availability to make a big stink about it in IRC today, but hopefully that'll take care of itself.

berdir’s picture

Sounds fine to me.

The "Active development on HEAD" doesn't work anymore once you have active development for Drupal 6 and 7, for example and it gets really confusing which branch is now which version.

Also agreed on automatic renaming of master to version with all these weird version names out there... :)

gerhard killesreiter’s picture

simplicity++

eliza411’s picture

sirkitree’s picture

I would even go so far at to say that release nodes should only ever pick up tags and never branches. But not really a point worth arguing over. The main issue is getting rid of the 'HEAD' concept and I'm all for that.

So for this, I could still have a 'development' release node pointing to whatever branch (ex: 6.x-2.x) which could and most likely will be a moving target, and then a point release will still be a tag (ex: 6.x-1.0), correct? If so, definitely +1.

sirkitree’s picture

Re-reading the title, we're saying that a release could not be pointed to 'master'. But in Git, 'master' is just another branch. So if we're allowing a release node to be pointed to any branch, then master will be included, no? Maybe I'm not quite understanding the difference between a 'development' release node and a release node?

I would think it would be much simpler to just have 'release' nodes and allow them to point to any branch or tag.

webchick’s picture

The proposal is to only allow release nodes to be pointed at branches that follow specific naming conventions:

e.g.:

-7.x-1.x
-7.x-1.0
-7.x-1.0-rc2

etc.

There would be no way to point a release node at the "master" branch. Developers could still develop against the "master" branch (and any other branch they like - "foo-new-features", etc.) but tarballs would not be generated for them.

See http://groups.drupal.org/node/85269 for more details on the branch/tag naming stuff.

webchick’s picture

Incidentally, the only project I can think of where this would legitimately screw people up is Drush, which intentionally points its main supported release node at HEAD. (soon to be master)

I think we need to have some kind of workaround for them, since this is truly version-agnostic code and committing each fix to 3+ branches is going to be incredibly annoying and error-prone. Hm.

markdorison’s picture

Sounds like a good approach. Though it would be great to be able to say we have *NO* release nodes pointing at master and if left up to maintainers it might be a long time before that would happen.

Crell’s picture

Speaking as a module maintainer: A-frickin'-men! (+1!) HEAD development pisses me off, and I never use HEAD myself for exactly the reason you list.

Git branching makes all of the problems with HEAD go away. Let's use it. It makes life easier for the migration team, developers, and advanced users checking out from a repo directly (or even just trying to grab a copy to make patches).

There's enough time that we could probably advise maintainers to move their release nodes off of HEAD before the switch, too. Not everyone would listen, but it at least would probably get a few people to solve the issue themselves before it becomes a problem.

Crell’s picture

@webchick: Well, you wouldn't commit to 3 branches. You'd commit to one, and then do a fast-forward merge for the others so that they all point at the same place. Agreed, though, that Drush is probably a legitimate edge case.

webchick’s picture

Talked over The Drush Problem™ with Sam in #drupal-vcs and he pointed out that one way to solve this would be to create a separate class of project nodes (maybe "Scripts"?) for this kind of version-agnostic not-actually-a-module-but-called-a-module-anyway stuff like Drush (cvs-release-notes.php would also fall under this category, and would be actually findable were it a project).

dww, any sense to how much extra work that would be?

deviantintegral’s picture

This sounds like a great idea. I would suggest emailing the maintainers of all projects with HEAD releases asking them to migrate their code over.

We might also want someone to go through and fix up all of the "Abandoned Projects" owned modules and clean them up as well. That way, they are following best practices if any new maintainers take them over.

webchick’s picture

I tried to issue this query on d.o, but it sat there an uncomfortably long period of time, I think due to lack of indexes, so I killed it: (sorry if I broke something :\)

select count(*) from project_release_nodes rn INNER JOIN project_usage_week_release pu where rn.tag = 'HEAD' and pu.count > 0;

But IMO whatever nids come up in that search, those are the only projects we actually have to worry about. From cursorily browsing project_release_nodes, the vast majority of these seem like exceptionally old projects that no one gives a crap about anymore. (The unfortunate fact that all -dev releases have a last updated date of July 11, 2010 makes it a little hard to ascertain exactly).

jbrauer’s picture

++++1

My only thought is whether there is really a need for the legacy support. While it doesn't seem to add a ton of additional work at some point, sooner or later, eventually, we'll want to have these go away totally. Given the suggested handling for non-core-version-specific projects (drush) is there really any reason we shouldn't just unpublish all these nodes and even notify maintainers in advance that they're about to go away?

Crell’s picture

Unpublishing a release node means a big red "OMG this module is unsupported, run in terror and hide your children!" message in the admin of any site running it. Depending on the module in question that could be, um, a lot of very angry site admins. :-) (Yes they're using dev releases, but many modules don't bother with real releases for various legitimate or moronic reasons.)

If we can coax module maintainers into fixing it themselves, though, that's the best option. Abandoned modules we can just try to script and if those break, oh well, they are abandoned.

dww’s picture

Correction to #15 from webchick:

Once we're on Git, people will be able to make any branches and tags they want in their canonical d.o-hosted Git repos.

However, if you want a release node (and all the benefits that entails -- a tarball packaged, an option in your issue queue for that version, ability to include it in a d.o-packaged drupal distribution, etc, etc) you must either create a release tag (for a point release, a slice in time) e.g. 7.x-1.0-beta2 or 7.x-2.3 or whatever, OR you create a release branch for a development snapshot tarball that is auto-regenerated every 12 hours, which would look like 7.x-1.x or 6.x-2.x etc. So the restriction will be on what branches and tags are available for release nodes, not on the branches and tags you can have in your repo. But please remember, even in Git, branch != tag.

All of this is just like the current situation in CVS, except our CVS repo isn't configured to let you create any other kinds of branches or tags, and in CVS, there are limitations on the characters that can be used in a branch or tag name, so we can't make our tags look like our version strings.

This proposal just says: If you want a -dev snapshot release node, you need to point it to a branch with a real name. You can no longer point it to a "wildcard" branch name and then manually configure the version information for the release on the release node itself. If you want a 7.x-2.x-dev release, make a 7.x-2.x branch and point a release node at that. You can't work on the 7.x-2.x series in 'master' or 'HEAD' and expect a release node to update itself for you...

Re: #20: And having a separate project type for scripts: Yes. #322626: META: Package and version non-modules for download That's not necessarily going to fix the version string thing since you can't (currently) do per-project-type settings for things like the version string format. That'll all be fixed in the 7.x-2.x branch of Project once we do the deep port to Field API, and allow any node type to act as a "Project". But, short of the proper solution, we should be able to hack something into project_release based on the existing taxonomy-based project type stuff. Lord knows the Project* codebase is already full of special-cases for this vocab...

Re: #22: The query lacks a condition on the JOIN. ;) We also need a WHERE clause for which week you care about. ;)

mysql> SELECT COUNT(*) FROM project_release_nodes rn INNER JOIN project_usage_week_release pu ON rn.nid = pu.nid WHERE rn.tag = 'HEAD' AND pu.count > 0 AND pu.timestamp = 1286668800;
+----------+
| count(*) |
+----------+
|     1260 | 
+----------+

(Note, if you limit to releases used by 50 or more sites, the number drops off quickly to just 221).

Yeah, -1 to unpublishing HEAD release nodes after the migration. I'd much rather just have a bit of special-case code to let folks move them to better branches.

johnalbin’s picture

As one of the few who actually listened to and understood the reasoning behind developing in HEAD, all of my projects have -dev releases pointing at HEAD. I'm one of the biggest advocates of this functionality in Project* when working with CVS.

But in Git, "master" branch has no special significance in Git; its just the default name of the default branch. So none of the Git mirrors of any of my projects have a master branch; they simply use branches named 7.x-1.x, etc., since well-named branches are more important that seemingly-magic ones. http://github.com/JohnAlbin

+1 to this proposal.

adrian’s picture

the aegir project will continue not being able to use drupal.org if this goes through.

we're in the drush hole.

webchick’s picture

I talked to dww about the different-branch/tag-validation-for-different-types-of-projects thing, but it's going to be a lot of work, and not something we can have in place without pushing launch off quite a bit. :\

So, question for Adrian: Since our branch naming conventions are now simply "N.x-N.x" could Drush, Aegir, etc. get by with "1.x-1.x", "2.x-1.x", and so on? You wouldn't come up in a filtered module search for "Drupal 7 modules", I suppose, but then again you're /not/ a Drupal 7 module.

rfay’s picture

So does this issue mean we're going to ditch the ability for a release node to follow *any* branch? Or just that it means we're going to lose the ability to follow the magic "master" branch?

Those are two very different things.

@adrian: If we retain the ability to follow a specified branch, will aegir be OK?

I think if we lose the ability to follow a specified branch (as we do now with dev) then I would retract my +1.

webchick’s picture

Hm? No, definitely not. Release nodes will still be able to point to branches. But the branches they're allowed to point to must follow a specific naming convention: "7.x-3.x", etc.

You can also create branches named "booger" or "bananapants" for experimental work or whatever you want, but can't point release nodes to them. We need this consistency for Update Status, testbot, and other things.

The proposal here is simply to remove "master" (analogous to HEAD in CVS) from the list of branches you can point release nodes to, in favour of consistency and lack of special case handling.

dww’s picture

@adrian re: #27: "the aegir project will continue not being able to use drupal.org if this goes through. we're in the drush hole."

Can you please explain this with enough technical detail that I could actually do something about it? ;) Not that I closely follow aegir, but last I heard, it's a distribution/install profile, a custom module, (a set of other modules?), and a theme. I was under the impression there are different branches of Aegir for different versions of core. I don't see why you need a development snapshot release node pointing to a 'HEAD' or 'master' branch for aegir to work. Seems like most of the problems aegir faces which are why you don't host it here have to do with distribution packaging, not with the ability to have a -dev snapshot automatically rebuilt from 'HEAD'. Please clarify. Thanks!

@rfay re: #29: "So does this issue mean we're going to ditch the ability for a release node to follow *any* branch? Or just that it means we're going to lose the ability to follow the magic "master" branch?"

This proposal is only about preventing auto-regenerating -dev release nodes from pointing to 'master' once we move to Git

chx’s picture

pish, pish, dont waste time and effort supporting too much -dev release nodes. Anyone who runs those can use a version control system anyways. So totally +100 to this.

rfay’s picture

So one answer to all this is:

1. We require the n.x-n.x branch naming.
2. We allow branch releases (release nodes that follow branches)
3. The first digit is only by *convention* (for modules and themes) the drupal release.

Using this, a project like aegir or drush, would use 1.x-1.x or something like that.

Doesn't this work?

berdir’s picture

Just had the same idea that rfay had, what about making a special case for projects that are version agnostic. Instead of 1.x-1.x, my suggestion would be "x.x-1.x" for the following reasons:

- There is no need to use two version numbers if the first one is *not* drupal core release IMHO
- You can only either use "x.x" or a valid core version (5.x, 6.x, 7.x, ...)

Chris Johnson’s picture

I'm in the simplicity++ camp.

I am in favor of dropping support for special HEAD/master releases as proposed.

For the 3388 outstanding such cases, I suggest a migration path (even if a manual, maintainer "do this, this and this" recipe), and spamming the maintainers of those modules as far in advance of the code change implementation as possible.

And of course, solving the Drush and Aegir situation cleanly -- although I have no good suggestions at this point on how best to do that.

In general, I'm in favor of:
1. less complex code
2. less complex repo management such that more people can better understand the best way to manage their modules, themes, etc.
3. less stress and work for Derek! :-)

webchick’s picture

#34 is interesting. Derek, is this possible?

dww’s picture

If we're going to special-case "x.x-1.x" support, we might as well just special-case "1.x" support. I.e. If the thing really isn't bound to a version of core, don't include the first "N.x-" in the version string at all.

marvil07’s picture

Just to mention that #37 sounds reasonable, but IMHO it is more error-prone than #34(do it accidentally), unless we show a big red light on the form choosing, so the user can be enough warned about what he is doing.

moshe weitzman’s picture

Sounds reasonable to me. drush/aegir are extreme edge cases and we should only handle them if it is easy. Its not that terrible if drush/aegir move off of d.o. for VCS.

dww’s picture

No one has to move off d.o over this. You can still have a 'master' branch if you want. You just can't have a -dev tarball for it. You can still make official releases. Can someone please explain why this proposal would prevent drush or aegir from using d.o for Git, issues, releases, etc.

berdir’s picture

Not sure if "x.x-1.x-dev" or just "1.x-dev" is better, I guess the second one is easier to accidentally misuse?

I don't get #40, I think drush/aegir have the same problem for dev and point releases as they are both core version agnostic?

dww’s picture

I sure wish Moshe or Adrian would reply here. So far, there's been 0 useful content in here on how this proposal negatively impacts drush/aegir. Seems mostly like either misplaced grievances about distribution packaging or misunderstanding of what this proposal is about. I understand drush isn't a drupal module that requires a certain version of core, but that's more or less unrelated to this. Absolute worst case is that we special-case it (just like the current HEAD release node for drush) and hack that release node's version info.

Meanwhile, here's another good example of the kind of confusion people face that this proposal would eliminate:

#959334: add help on version numbers to project release creation page

joachim’s picture

The main reason for not bothering with making a named branch and stick to HEAD is that you have to go round the houses with CVS and branch THEN re-check out all over again. With a git checkout you can branch and switch much more easily, so forcing people to make a branch is a very minor imposition.

+1 from me.

dww’s picture

(OT from the proposal, but just to clarify):

@joachim: That's not true. You can use cvs up -r branch_name to move a given checkout from one branch to another. You don't need to re-checkout anything...

Anyway, glad you support the proposal. I think we're all in agreement that HEAD release nodes suck...

webchick’s picture

Sent an e-mail to Moshe and Adrian asking them to chime in with more details.

moshe weitzman’s picture

Like I said, go ahead. I don't object. adrian's comment has no substance and shouldn’t delay anything either IMO.

eliza411’s picture

Moshe, the go-ahead signal from you is clear. Thank you for that!

I think the Git team also needs to understand your take on drush's specific requirements so they can make an informed decision about addressing those requirements (or not) rather than writing drush off as an edge case and not knowing where the proposal falls short.

anarcat’s picture

I can substantiate some things here, but I feel I will be rehashing what was already said. Nevertheless, I can make a clear wrap up, after reading the whole issue.

1. Drush and Aegir (provision, to be more precise) are Drupal version agnostic. In order to function properly, Drush is currently forced to use 7.x as a supported version, but that's actually false: drush supports multiple drupal core version. Same for Provision.
2. Having an exception for scripts (#322626: META: Package and version non-modules for download) or just allow non-core branded branches (x.x-1.x or 1.x instead of the traditionnal 6.x-1.x) would solve the problem for both Aegir and Drush

Regarding (1), I feel the problem is that we are using the branch name to *also* mean "what drupal version is this compatible with". I understand it makes things very explicit for people, but maybe it's not necessary... I don't want to diverge massively towards a potential consensus here (x.x-1.x or scripts seem unchallenged so far) but I feel that maybe we need to rethink the whole thing here. I always had the feeling that embeding the drupal core version in the branch name was odd: I'm going to create a new branch for my D7 port anyways: there will therefore be no name clashes, so why bother?

In otherwords, let's say I'm running mymodule-1.x on D6, and I start porting work on D7. I will create a new branch, called mymodule-2.x and code there. I will port changes between branches and all. If I have major new features or architectural changes, I will just make mymodule-3.x, which I will *not* port to D6 (unless I am insane and masochist). (Replace "mymodule" with "views" here to see more clearly what we're talking about here.)

Would it make sense to drop the x.x prefix for *all projects*? (Not just scripts?)

Otherwise, if we allow projects to have branches that are not mapped to a drupal core release (either as separate project space or with an exception), I'm perfectly okay with this. In fact, I believe that if drush can manage to survive on CVS with that crappy naming convention right now, I don't see why we wouldn't be able to do the same thing on git...

We're really talking about a *new* feature here, that has nothing to do with ditching master, which is "allow releases not mapped to Drupal core releases".

Of course, if we're going to re-engineer the code, might as well try to get that into the design...

In short: no objection here.

webchick’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for chiming in on behalf of the Aegir team, anarcat! :D

The "7.x" prefix isn't really there for convenience/protection of developers, but more to protect our end users. It makes it very explicit at a visual glance what code is for what version of Drupal in the 99% case where the project is a module or theme and Drupal version of course matters very much.

But it's also convenient for technical users who like to deploy modules/themes from Git directly, or even just work on patches from their local Git checkout. If I do git branch -r and get back mymodule-3.x, mymodule-2.x, etc. I need to git checkout to each one individually to know which one(s) apply to my version of Drupal, else I have to go back to the project page and click on each release node individually to figure this out. If I see 7.x-something and 6.x-something, it's extremely clear.

So given those things, and also given that the discussion at http://groups.drupal.org/node/50988 about branch/tag naming conventions reached pretty overwhelming consensus already and we've documented the existing naming conventions, I really don't think we need to re-open that discussion again, especially if what we've outlined here works.

So I'm going to go ahead and mark this back to RTBC, assuming that anarcat can speak on behalf of adrian on these matters, and that given his feelings, it sounds like Drush/Aegir can still exist on d.o as long as we have the ability to do "Drupal-branch-neutral" naming conventions in some form.

sdboyer’s picture

Status: Reviewed & tested by the community » Fixed

Sounds like we can safely move forward with dww's proposed changes, then, assuming that we allow those alternate branch constructions.

Reopen if it's a problem.

Status: Fixed » Closed (fixed)
Issue tags: -git phase 2, -git sprint 3

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