http://drupal.org/node/83339 is converting project releases into real nodes. we want the cvs.module to take advantage of this to:
- alter the project_release node form to add a cvs tag selector (instead of manually inputting the version numbers, you just select the tag and we figure out the version number for you)
- alter the project_project node form to provide some additional project-wide settings related to cvs integration
this issue depends on storing the cvs tag/branch info in the {cvs_tags} table. see http://drupal.org/node/83332 (which is basically RTBC). so, the patch in here will only really work if you apply the patch in there (and have data in your {cvs_tags} table).
there are still some //TODO items in this patch, but i wanted to create the issue and post what i have as a backup of what i've done so far, and on the off chance that anyone else is ever going to look at this and review/help. ;) it's already basically working, but it's a little rough around the edges, and i have some cool ideas for enhancements. so, this is starting off as "needs work", but hopefully will move to "needs review" fairly soon...
-derek
Comment | File | Size | Author |
---|---|---|---|
#27 | cvs_release_node.patch_18.txt | 26.79 KB | dww |
#23 | cvs_release_node.patch_17.txt | 26.95 KB | dww |
#22 | cvs_release_node.patch_16.txt | 27.13 KB | dww |
#21 | cvs_release_node.patch_15.txt | 26.69 KB | dww |
#20 | cvs_release_node.patch_14.txt | 26.7 KB | dww |
Comments
Comment #1
dwwnew patch with the following changes:
--
as the delimiter between the core API part of branch/tag names, instead of the dreaded_
major.patch
to make core.Comment #2
dwwnew patch:
cvs_get_version_from_tag()
:TODO:
Comment #3
dwwi took a 1st stab at 2-page form for first selecting the tag, then everything else, when adding a release. that failed. then i got a lot of help from eaton and chx, and i got closer, but it's still broken. however, i'm putting a patch here so others (namely merlinofchaos) can play with this and try to help me get it working...
Comment #4
dwwyay! fixed the 2-page form badness (thanks to chx, with additional help from merlin and eaton)
new patch:
cvs_project_release_form_validate()
function we're not using at allTODO:
Comment #5
dwwnew patch:
project_release_db_save()
if we've got a non-numeric value for version_patch, just unset it and leave it as a NULL in the DB (e.g. for "4.7.x-dev" core releases).Comment #6
dwwnew patch that handles the TRUNK special case. if you select 'TRUNK' as the tag on page 1, you go to another page to fill in the version info before you get to the final page to actually submit. sounds simple, but it's a big diff in the code. ;)
TODO:
Comment #7
dwwnew patch:
Comment #8
dwwComment #9
dwwnew patch with massively improved UI for drupal.org (all in cvs_local.inc, so it's not polluting the regular case for non-d.o sites). a few general features:
now, for the d.o-specific goodness:
i'll post 3 screenshots in the next 3 followups so y'all can see the new UI in action... ;)
Comment #10
dwwpage 1: select the tag
Comment #11
dwwpage 2: (optional) if the tag you selected was 'HEAD', you have to fill in version info manually
Comment #12
dwwpage 3: once you've properly filled in page 2, or if you selected a tag with the release info already in it on page 1, you land on the final page, that you can actually preview/submit. the "version string" field is read-only, and the "CVS tag" only has 1 option, so you can't change those at this point. all you can do is fill in the description, and specify any other optional junk you can do on a node form.
Comment #13
webchickWow. This is looking really nice!! The 3-page form is much more intuitive, imo.
No further comments at this time. :) Rock it, dww!!
Comment #14
dwwthanks for the encouragement, webchick. ;)
however, after further testing, this "Drupal core compatibility" selector is still a little buggy. :(
TODO:
1) if you choose a tag on page 1 (not HEAD), the core-compat selector shows up on the final page, even though we don't need it. this is serious, since this is the common case...
2) if you select 'HEAD' on page 1, and on page 2 select a compatibility but then delete one of the pre-filled values (e.g. patch-level) and leave it blank, when you get sent back to page 2 to fix the patch-level, the core compatibility selector is gone and you just get the text fields for API major/minor again. this is worth fixing, but it's a pretty obscure case, so it's not as important as #1...
*sigh* it seems my work here is never done...
Comment #15
dwwnew patch with big changes (hopefully for the better). instead of all this hard-coded "API version" crap, i decided to just make that stuff an automatically-created taxonomy. see http://drupal.org/node/83339#comment-144908 for more info.
Comment #16
dwwforgot to mention that the previous patch fixes TODO #2 from comment #14, but TODO #1 is still a problem (though it should be easier to fix now). furthermore, the cvs_local.inc stuff is getting a little confused with tags like "DRUPAL-5--1-0", and it's not recognizing that should go with "5.x"...
Comment #17
dwwnew patch fixes both of the bugs mentioned in the previous comment:
TODO: nothing? i think this one actually needs review. ;) however, it's totally dependent on http://drupal.org/node/83339 which still needs work, so i'm not changing the status just yet...
Comment #18
dwwminor cosmetic changes to the release form UI: once we land on the final page, we group the cvs tag and version string fields into a fieldset that a) floats them together to take less space and b) adds a description about how they can't be modified at this stage. also works when editing an existing release. finally, set the weight of this fieldset to -4, not -10, so that the title (-5) is always at the top.
Comment #19
dwwi realized that i had left some debugging behavior in here. the old version always added an option 'HEAD' under the tag selector, even if you already had a release pointing to HEAD. once i took that out, it revealed the lame usability of trying to add a release on a project without any available tags. so:
Comment #20
dwwupdate to cvs_local_version_is_valid() that takes advantage of the new project_release_exists() method from http://drupal.org/node/83339#comment-145292 to prevent advancing past the version selection page (only shown if you selected HEAD) if you choose values that would lead to 2 releases with the same version identification.
Comment #21
dwwfixed a weird bug for when project admins try to edit a release node that's from a tag, not a branch. previously, we ended up generating an empty array of options for the "CVS tag" field, but now we include any tags that don't have current releases. plus, we always re-include the existing tag as an option for the admin in this case. it's pretty obscure, but it'd sure screw things up on d.o for the project admins. ;)
Comment #22
dwwnew patch:
i emailed chx and eaton about it, but we haven't had a chance to conquer it just yet. but, that's the only thing holding this up...
Comment #23
dwwthe FAPI crap for trying to set defaults for major, patch and extra when we're adding a release from "HEAD" is just not working right, chx/eaton aren't around, and i don't care enough to spend infinite time on this. so, i ripped out the defaults, and just added a site-specific description for the fieldset when you're adding/editing a release pointing at HEAD. that's good enough for now...
so, i think this is hereby ready for review. of course, it depends on the latest patch from http://drupal.org/node/83339 (currently, http://drupal.org/files/issues/release_as_node.patch_27.txt) and all of the above should be applied against a fresh DRUPAL-4-7 checkout.
Comment #24
dwwa few minor TODO items from IRC feedback:
Comment #25
dwwa few more TODO items from IRC and #83339
Comment #26
gregglesOn node/add/project_release/ the dropdown label is "CVS Tag" which seems confusing because the dropdown includes both Tags and Branches.
Other possible words to use could be:
Or something else that I can't imagine. We can either use some term that is neutral from CVS or we could just "and" together the terms.
Also, to make it more clear that the tags/branches have to be created first and not already used by another release node, I think it would be good to say "Available CVS Tags and Branches"
Comment #27
dwwnew, possibly final version of this patch before it's RTBC:
Comment #28
dww1 minor item that needs fixing: we want to number from -1.0 on the default stable branch (e.g. DRUPAL-4-7), not -0.0. this has small implications for cvs_local.inc.
speaking of which, when i commit this to the repo, i'm going to rename cvs_local.inc to cvs_local_drupal_org.inc, so it's not used by default unless someone goes out of their way to move it into place...
Comment #29
dwwjust committed everything from this issue into the DRUPAL-4-7--2 branch of cvslog. new changes will either just be committed directly to that branch, or posted as patches against the end of that branch, not as complete patches against DRUPAL-4-7 anymore...
after a brief discussion on IRC, i decided to commit cvs_local.inc as cvs_local.example.inc, so that it's disabled by default, and sites have to go out of their way to rename it and edit it for their needs if they want to... however, this is trivial to use on d.o -- we just add a symlink in our local workspace and we're done.
Comment #30
dwwjust committed the fix for using 1.0-dev for the version on each stable branch as revision 1.1.2.10 of cvs_local.example.inc on the DRUPAL-4-7--2 branch. for example, if you add a new release pointing to the "DRUPAL-5" branch, it'll assume the version number you want is "5.x-1.0-dev"...
ideally, this would all be reviewed before it goes live on d.o:
Comment #31
dwwwhoops, sorry, i pasted the wrong cvs checkout command above. should be:
(you need to checkout a copy from DRUPAL-4-7--2 to get the cvs_local.example.inc file, too).
Comment #32
chx CreditAttribution: chx commentedAs with project: I read this diff and found no security holes. Whether this is because dww's is a superb careful coder (looks like it...) and there are indeed none or because I am blind remains to be seen.
Comment #33
dwwas with http://drupal.org/node/83339 everything is committed to DRUPAL-4-7--2 branch, and deployed on scratch.drupal.org (http://drupal.org/node/90436). at this point, it looks like this isn't really going to get any more reviews, so i'm marking it fixed. of course, installing on drupal.org is a separate question...
Comment #34
(not verified) CreditAttribution: commented