Splitting this off from #850142: Integrate VCAPI with project_release node add form since the edit and add code paths and logic are totally different. No sense blocking the node add issue until edit is working. They could even (in theory) be done in parallel, although I'm just going to do this after #850142 is done, since that's much more critical. We'll still need this for launch, but it's a smaller task, and not 100% required for the sprint 8 deadline. It's still my intension to complete this during sprint 8, so I'm tagging accordingly.

Comments

dww’s picture

Status: Active » Needs review
StatusFileSize
new60.38 KB
new38.13 KB
new10.94 KB

This is a start. It's now basically working fine. However, there are some problems in the case where a user has the 'administer projects' permission:

A) Do we even *want* to let admins change any of the low-level details of the release node? Now that we're not allowing HEAD, there's basically no way to mess something up, and no need to fix anything. I guess on a site like d.o there are going to be some legacy release nodes that might need to be repaired. However, given that a somewhat large group of folks has this perm on d.o, and they've been known to mess these things up in the past, I'm inclined to just diable all these form elements and make the "admin" case look like the "regular" case in the attached screenies.

B) If the answer to (A) is "Yes", then there's nothing to validate the new VCAPI label you define (branch or tag), make sure it really exists in the project, update {versioncontrol_release_labels}, etc. If (A) is Yes, we should probably change this UI for admins so that it queries for all available branches + tags, adds the current one, and gives you a drop-down, not a text area. There's a // TODO in the hook_nodeapi() about this, too.

So, if (A) is No, we need work to rip that out. If (A) is Yes, then (B) needs work. However, even though this needs work, I'm setting to needs review to get reviews on the rest of the patch and feedback on these points... ;)

dww’s picture

Status: Needs review » Needs work

Okay, based on some IRC feedback, the overwhelming answer was No on A. As I pointed out "worst case, Real Admins Have A Mysql Prompt(tm)". ;)

Stay tuned for a new patch...

dww’s picture

Status: Needs work » Needs review
StatusFileSize
new10.33 KB

This should do it. Tested locally.

dww’s picture

Here are screenies of regular vs. admin via patch #3. The only diff is admins can edit the title, regular can't. The tag or branch is locked for everyone, and there are no other crazy fields. #3 also included some logic to hide the version field (instead of displaying readonly) if the VCS label matches the version string exactly. So, I'm also including screenies of editing a branch (where on d.o, the version string is a bit different from the branch name).

We could open a separate issue in drupalorg.module about altering this form again to completely hide this whole fieldset if we deem it's unnecessary for our uses. But, I think I want to leave vc_release with at least the logic in here now.

Actually, looking at all 4 cases, I guess we shouldn't let admins edit the version string itself if they can't edit the parts of it. Trivial fix, one sec.

dww’s picture

Status: Needs work » Needs review
StatusFileSize
new41.7 KB
new10.49 KB

Like so. Other screenies remain unchanged.

dww’s picture

Status: Needs review » Fixed

Committed #5 to HEAD. If we want to do a d.o-specific UI review, let's open a (non-critical, non sprint-8) issue about it in the drupalorg queue. ;)

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

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