Note: This is now a GHOP task: http://code.google.com/p/google-highly-open-participation-drupal/issues/...

When merlin and I were working on the UI for the 5.x-2.* update_status.module's available updates report, we ended up with even better functionality and appearance than the existing release summary table on project nodes. It'd be great if for each version of core supported by a given project, the summary table's entry looked more like what you find at the update_status UI screenshot. In particular:

Recommended version
The latest official release without "extra" from the recommended major version (branch), e.g. 5.x-1.5.
Latest version
The latest official release from the recommended major version (if it's newer than the recommended version), e.g. 5.x-1.6-beta1
Also available
The latest official release from a newer branch that's still compatible with the same version of core, e.g. 5.x-2.1
Development version
(Optional, pending the checkbox on the project node's edit tab) the dev snapshot for the recommended branch.
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

merlinofchaos’s picture

My current belief is that we should have two flags:

1) a 'recommended' version. This isn't actually a flag, it's a field that's coupled with the API version. It's set via a checkbox on the edit release page or a button on the view release page 'make this the recommended version'.

2) An 'also list' which IS a flag on a version, and simply makes it listed on the front page.

This actually significantly reduces the complexity of the queries, I think.

hass’s picture

subscribe

ezyang’s picture

Assigned: Unassigned » ezyang

I need to ask for some clarifications on this task.

Merlin, could you elaborate on what you mean by:

This isn't actually a flag, it's a field that's coupled with the API version.

I don't understand what you mean by coupling it with API version. I would presume that all supported API versions should still be displayed on the releases page. This has the effect of multiplying what we see on the screenshot (update_status has the luxury of only checking one API version). Otherwise, we make users hunt down older APIs in the "All releases" page.

Let's suppose that we will display all supported API versions on the download page. Then, if we make a particular release recommended, there may/should be multiple recommended versions (one for each API version). Conflict resolution when multiple releases on a single API version (the reverse) have the recommended flag set could be punted to validation (which would check to make sure no other version is valid, or even un-mark that version) or simply have the latest version win.

One possibility is a project-wide, recommended branch (as in major.minor) designation. In fact, update_status does not appear to display the patch version! You would still have to specify multiple branches per API version, as a release version can only have one API version assigned to it, so 1.0 might be for 5.x, while 2.0 would be for 6.x.

Here are some of the autodetection SQL queries for retrieving the necessary versions: (pseudo-SQL, I've probably bungled some column names, and left out FROM)

  • Recommended version: SELECT WHERE extra = '' WHERE major_version = '$major' SORT BY minor_version DESC SORT BY patch_version DESC LIMIT 1
  • Latest version: SELECT WHERE major_version = '$major' SORT BY minor_version DESC SORT BY patch_version DESC LIMIT 1
  • Also available: SELECT SORT BY major_version DESC SORT_BY minor_version DESC SORT BY patch_version DESC LIMIT 1

If we do decide to assign "recommended" or "see also" to specific releases, a usability issue manifests: a mass-edit release page (checkboxes for recommended / see also). Otherwise, performing mass-updates because extremely cumbersome, especially if ticking a new version recommended doesn't undo the old one. Fortunately, this may not be necessary due to the above-mentioned conflict resolution.

I still think, however, that the simplest way, code-wise and SQL-wise, is to mark releases as recommended or version (although it would need the form mentioned above for this to work well). Marking branches as recommended feels a little too black-magicky for me, and there's still a question of whether or not a branch is "major.minor" or just "major" (while Drupal fairly solidly uses "major", other projects may have different release patterns, PHP, for example!)

So... if you've read this whole thing, here are the primary concerns:

  • Will multiple API versions still be displayed?
  • Will recommended releases be auto-detected or specified (if specified, via a specific version, major version, or major.minor branch?)
  • Will see also releases be auto-detected or specified (see above)?
  • Will all recommended releases be displayed, or will there be some sort of conflict resolution?
  • Should we implement a mass-edit page?
  • And one last thing: Should we rename "see also" to "Cutting-edge release" or the like? (See also is terribly ambiguous)

Work cannot continue without satisfactory answers for these questions. Thank you!

dww’s picture

Thanks for your interest. Let me attempt to answer some of this:

Q: Will multiple API versions still be displayed?
A: Yes. There are multiple versions of core (API versions), and we always want to show releases for any of the currently visible ones (just like now). The point of this issue is that we want to display multiple releases for each API version

Q: Will recommended releases be auto-detected or specified?
A: I think the intention is that the maintainer specifies the recommended branch (just like now), and the rest is auto-detected.

Q: Will see also releases be auto-detected or specified (see above)?
A: Again, maintainer selects which branches should be "Also available", but the right release for that branch is auto-detected.

Q: Will all recommended releases be displayed, or will there be some sort of conflict resolution?
A: I don't know what you mean. The latest recommended releases should be displayed.

Q: Should we implement a mass-edit page?
A: How I envision this feature, there's no need. Merlin seems to have other ideas. However, a mass-edit page would be a good thing if we end up implementing http://drupal.org/node/196652#comment-645046 -- you should definitely read that thread if you're interesting in this feature.

Q: And one last thing: Should we rename "see also" to "Cutting-edge release" or the like? (See also is terribly ambiguous)
A: It's "Also available", not "See also". It's not necessarily "cutting edge". See http://drupal.org/node/189546 It's just the latest release from a newer branch, that's all.

Also, the question of what makes a branch (major vs. major.minor, etc) is a good one. It's tricky stuff to make this all flexible enough to handle different cases at different sites, but not so complicated it's completely impossible to work with or maintain. :(

ezyang’s picture

Thanks! That clears things up. There is one more question:

Would the admin have to specify multiple recommended branches? This would be if the latest version 2.0 works with the 6.x API, but only 1.3 works with 5.x. If recommended was set only for "2.0", there wouldn't be any recommended branch for 5.x, so multiple recommendations would be necessary. (And that says nothing about what to do if no recommendation is made, perhaps just not include the recommendation field?).

I think the way to handle branches is to be flexible, and let the user use major or major.minor. The selection field would look something like:

  • 1
    • 1.0
    • 1.1
    • 1.2
    • 1.3
  • 2
    • 2.0
    • 2.1

Asking them whether or not major.minor or major is a branch seems needlessly complex. Of course, there would need to be conflict resolution if both 2.1 and 2 are specified as recommended.

dww’s picture

See http://groups.drupal.org/node/7440 for a proposal for a complete solution to all of this.

In terms of "branches", it should just be a release series, which is uniquely identified by everything except patch level and extra. I think that's the cleanest approach. Anyway, see that post for more.

ezyang’s picture

So... should I leave this to you? I ask this because I decided to pick this up as part of Google's Highly Open Participation contest. As it stands, it sounds like fixing this bug directly would cause more harm than good. I'd be more than happy to help out, but I'm not exactly sure how. Please advise. :-)

ezyang’s picture

Assigned: ezyang » Unassigned

Unassigning self.

dww’s picture

Title: Make release summary table UI look more like update(_status)? report » GHOP #55: Make release summary table UI look more like update(_status)? report

See http://drupal.org/node/203313 specifically about the project maintainer UI for this. Let's leave this issue to just focus on the public-facing UI for how things look in the project download table, etc.

dww’s picture

Bump. This should be active again, and it's definitely still open as a GHOP task if someone wants to take it. http://drupal.org/node/203313 is almost entirely done (there's just 1 tiny edge case in the jQuery sugar that we added to the UI). basically, what we need now is someone to start with the latest patch from #203313 and fix the project download table UI stuff to support the new goodness (multiple supported versions, specific branches where -dev snapshots should be printed or not, etc).

aclight’s picture

I've made a note about this on the official GHOP task tracker. Hopefully we'll get someone to work on this soon!

aclight’s picture

One thing we might want to think about here is that we have a task submitted to the project to rip out our specialized file handling for project_release nodes and instead use core file upload handling. One benefit is that this could potentially allow us to have multiple files associated with one release node. For example, a windows, mac-intel, and mac-ppc version of a release (obviously such a use case would not apply to d.o, but this would be really useful on other sites).

I just brought up the issue at http://drupal.org/node/179471#comment-697699 of how the download table might change to accommodate multiple files in a release. Though there is not a need to worry about this much now, we might keep this in mind when redesigning the release table here, as there may be decisions we can make now that make work easier in the future, if we do decide to go this way.

cwgordon7’s picture

Assigned: Unassigned » cwgordon7
Status: Active » Needs review
FileSize
11.3 KB
7.27 KB

Patch attached! This is so awesome! A screenshot is attached, too, in case you want to see what it looks like :D.

webernet’s picture

One comment about the screenshot -- You're marking the 1.x and 3.x official releases as "May be outdated" and "May be unstable". That's not necessarily true. All three branches may be stable, but provide different features or be substantially different "under the hood".

The maintainer recommends one branch as the "Most stable/supported" release and the others are simply "Also available".

Also - How does the patch deal with different core compatibility -- separate tables?

cwgordon7’s picture

That as why I put it as "may be outdated" and "may be unstable" rather than "outdated" and "unstable." If you have a better idea, go ahead; it's just simple text, it can be altered quite easily, or even removed if deemed unnecessary/confusing/misleading.

dww’s picture

Status: Needs review » Needs work

This is starting to look good, thanks!

Instead of the current hard-coded logic and wording for the phrases, I'd rather the text was controlled by the project maintainer in some of the following ways:
- The settings (supported/recommended) on the admin UI
- The corresponding strings from the update_status UI
- The "Release type" terms on the -dev release node for each branch (e.g. if anything other than "Bug fixes" is present, print it).
- (Maybe) small text field on release nodes?

I'm also curious how this will look with multiple versions of core and where/how -dev releases will be displayed. You should probably read http://drupal.org/node/200543 if you haven't already, for some other aspects to consider while re-working this UI.

cwgordon7’s picture

I'm confused about what you mean here. The text on the page is determined by the settings (supported/recommended): Only supported versions are shown, and only the recommended one is highlighted in green. If it's the actual text you want to change, that's simple enough; but chances are that anything I do won't fit in with your picture of what the ui should look like.

"The corresponding strings from the update_status UI"... what does that even mean? Why would it be a good thing to show that?

If you could respond quickly, that would be helpful and extremely appreciated, as I have only about 12 hours left to finish this and claim a final task. Thanks!

-cwgordon7

dww’s picture

Ok, sorry I wasn't clear...

- I saw that the colors are determined by the settings on the project maintainer UI, that's good. My main concern is the text of the little icon captions, such as "May be unstable", "May be outdated", etc. I particularly don't like hard-coding logic that produces captions like "May be outdated" -- we have no way to know what the maintainer's plans are unless they specify this somewhere. Therefore, I think we want to add something to the project maintainer UI to give people more control/customization over those captions.

- By "The corresponding strings from the update_status UI" I mean, the labels for each release series in the update_status UI. See the update status screenshot I linked to in the original issue post. For example:
"Recommended version:"
"Also available:"
"Latest version:"
"Security update:"
...
I just mean it'd be nice to be consistent here. Instead of the project UI saying "Maybe unstable", and the update_status UI saying "Also available", and the release node saying "New features", I'd rather a little more agreement. ;)

So, a few ways this could work, open to other suggestions:
- The captions exactly match the logic and wording used in update_status. E.g. Recommended in green, all other supported versions are listed with "Also available", etc. If the most current release for any branch is in fact a security update, it might be nice to somehow indicate that, too.

- Add a little drop-down on the project maintainer UI to select some site-admin-defined options (kind of like issue status values). At first, this could just be hard-coded, with something like the following choices:
-- "Unstable new development"
-- "Stable" or "Supported"
-- "Nearing end-of-life"
-- ... ?

- There's another text field on the project maintainer UI for these captions. We just print out the check_plain()'ed version of whatever they write. We should probably validate this field to be no more than 30 characters or something, so that people don't go crazy writing little essays in there which make the table look nuts.

- We just use the "Release type" terms on the corresponding -dev snapshot release node that represents a given branch of development. If that node has "New features", we add that text (or perhaps "Includes new features") as the caption. This is perhaps non-intuitive for project maintainers to understand that the -dev release node is supposed to represent the current state of each of their branches, so if we go this route, we'd need to make that more clear in other parts of the UI.

Does that all make more sense? I'm not 100% fixed on exactly which of these we want, so I encourage you to be creative and come up with something that you think would work nicely, given my concerns above. It could either be one of these options, or your own new solution entirely.

Thanks!
-Derek

aclight’s picture

- There's another text field on the project maintainer UI for these captions. We just print out the check_plain()'ed version of whatever they write. We should probably validate this field to be no more than 30 characters or something, so that people don't go crazy writing little essays in there which make the table look nuts.

I'm all for allowing project maintainers a small space to indicate something like this.

cwgordon7’s picture

For now, following discussion with dww in irc, in order to keep this task in scope, I'm only addressing the table ui issues. There is a new patch attached.

Note: I'll likely continue to work on this even after this particular part is finished.

cwgordon7’s picture

Status: Needs work » Needs review
FileSize
7.23 KB

New patch

webchick’s picture

The current incarnation of this (at http://project.drupal.org/project/signup) looks much improved over the first version. I think there are still more ways it can be improved, but for the purposes of the GHOP task credit, I'm satisfied. Marking the Google task complete. Will leave this CNR.

dww’s picture

Status: Needs review » Needs work

Ok, I agree the basic functionality here is working, and that's an improvement over what's checked in right now. However, there are still a few things I'd do differently with this patch, and a few things I noticed that don't seem to work correctly that definitely need to be fixed.

Bugs:

- The "Show snapshot release" checkbox seems to have no effect at all.
- On the project browsing pages (e.g. http://project.drupal.org/project/Modules/category/61) if you don't filter by core, you end up seeing all the same releases as you see on the project node itself. You're supposed to only see the recommended versions for each version of core.
- On the project browsing pages (e.g. http://project.drupal.org/project/Modules/category/61) if you filter by 5.x core, signup module is displaying the link to 5.x-1.0, even though I have 5.x-2.2 as the recommended version.

Almost all of this can be fixed by doing things differently in the patch:
- You're overloading the 'recommended' table type.
- Instead, I'd basically keep 'recommended' the same, so we can use that for the project browsing pages -- only display a single table, with a row for each version of core that details the currently recommended release.
- Add a new 'supported' table type, which is basically what your patch has already implemented, which we use when viewing the project node itself.
- Fix the 'snapshot' table view to correctly honor the new schema for {project_release_supported_versions}, so that it includes all of the currently selected "Show snapshot releases" versions from the maintainer UI.
- Fix the place that's trying to add the 'snapshot' table to release nodes to invoke it if there are *any* versions that have 'snapshot' == 1 in {prsv}.

The one other tricky part is the case in project.module in the project browsing pages when you filter by a version of core. That's one of the most convoluted and evil parts of the project* codebase, and a prime candidate for being ripped out for views support. So, I'm not sure if it's worth it for you to fix that spot or not. However, it might not be *that* hard. Let me know what you think about this, and we can discuss if we should just forget it until we've got views support, if I should fix it, or if you should. ;)

Make sense?

Thanks for working on this, it's really going to be great when it's all deployed on d.o!

aclight’s picture

Another bug:

If I look at the Schecule module on http://project.drupal.org/project/Modules/category/61 when I'm logged in but haven't selected a version to filter by, I get two releases shown:
HEAD (developer release with red X)
4.7.x-1.0 (supported release with yellow triangle)

However, if I click on the title and view the project's node, I get only one release:
4.7.x-1.0 (recommended release with green check)

So why is the same release supported in one place and recommended in another?

Also, is there any way to test out the changes to the project edit --> releases settings on p.d.o? On d.o I have access to edit all projects since I'm a site maintainer, but apparently those privs don't carry over onto p.d.o, and I have no projects of my own yet to look at.

Hm....I just looked at the projects overview page (same as link above) again and there are no more download tables at all. Strange.

dww’s picture

@aclight: thanks for the close look. I just made you a site maintainer @ p.d.o -- knock yourself out. ;)

aclight’s picture

@dww: Thanks for the privs.

@all: I might have found another bug, or maybe I'm not completely understanding how things are supposed to work here.

If I look at the releases settings for the project module at http://project.drupal.org/node/3281/edit/releases , and make the settings shown in the first screenshot, I get the release table at http://project.drupal.org/project/project (the project's summary page) shown in the second screenshot.

Why does the release table have options for 6.x when there are no releases for project module for 6.x? And why does it show two possible major versions?

And, this might be a separate discussion to have, but it seems like it would make more sense for the releases in the download table to be sorted opposite of how they are now being sorted. Shouldn't releases for 6.x come above those for 5.x? That's how it currently works on d.o.

dww’s picture

@aclight: you happened to choose a project that I was debugging http://drupal.org/node/203313 with. ;) The 6.x stuff is all bogus that I manually inserted into the DB, so there are no real releases with files associated, which is why they don't show up. ;) Sorry for the confusion. We might want to consider re-syncing the p.d.o DB from d.o... For now, please just mess with another project in your testing.

I agree on the ordering. Really, the download table should look pretty similar to the maintainer's UI...

cwgordon7’s picture

Status: Needs work » Needs review
FileSize
7.65 KB

I think this new patch should fix most, if not all, of the problems. Let me know.

-cwgordon7

dww’s picture

Status: Needs review » Needs work

Without going through the trouble to apply and test this, I can tell you just from a quick skim of the patch that it can't possibly have solved all the problems. Either you didn't read my detailed feedback in #23, or if you did, you neither followed my advice nor addressed those problems yourself in some other way. I don't want to waste anyone's time by repeating myself. ;)

In addition, this patch has a few other flaws I didn't mention above:

A) Code style issues (e.g. how arrays are indented, there are tabs, etc)
B) The $added_majors code is sort of a hack.
C) Given everything you're using it for, $icon is a confusingly named variable.

Please re-read #23, and give this another shot. Thanks.

cwgordon7’s picture

This may not be stable. I think I've worked out most of the bugs, but I could be wrong. Here's at least a half-finished patch.

aclight’s picture

@dww: I was going to take a crack at reviewing/fixing this, but cwgordon7 said you told him you were going to rewrite parts of it. I don't want to duplicate work, so let me know if you've already rewritten this.

dww’s picture

Sorry, I got totally swamped with too many things and didn't have a chance to finish this. Here's the in-progress and untested version that still needs work but is slightly closer to usable.

aclight’s picture

Status: Needs work » Needs review
FileSize
8.6 KB

This patch fixes a problem in project_release_table().

Instead of:

  $orderby[] = 'r.version_major';
  $orderby[] = 'r.version_minor';
  $orderby[] = 'r.version_patch';
  $orderby[] = 'r.file_date';

  if ($orderby) {
    $order_by = ' ORDER BY '. implode(' DESC, ', $orderby);
  }

we actually want:

  $orderby[] = 'r.version_major DESC';
  $orderby[] = 'r.version_minor DESC';
  $orderby[] = 'r.version_patch DESC';
  $orderby[] = 'r.file_date DESC';

  if ($orderby) {
    $order_by = ' ORDER BY '. implode(', ', $orderby);
  }

The former way works except that the last element of the $orderby array, in this case r.file_date, does not get the DESC appended and so therefore is ordered in the wrong direction.

I'm setting this to CNR for now.

aclight’s picture

Status: Needs review » Needs work

There are still some bugs here:

A.) If you click the "Show snapshot releases" box for a API version of a project with no snapshot releases, no releases (not even official) will be displayed in the download table.

B.) I'm still not getting a separate snapshot table like I think we want. I only get an Official releases table, even for a project with development snapshot releases. This is true even if I check the "Show snapshot releases" for an API version.

C.) For some of my releases/projects, I only see certain releases in the table if I check the "Show snapshot releases" box, even if the release itself is an official release and not a snapshot release.

D.) For some projects, I'm not able to get any releases to show up in the download table, regardless of the settings I make in the Release administration page.

I am clearing the cache using the devel clear caches link, so I don't believe any of these problems are due to caching.

dww’s picture

Assigned: cwgordon7 » dww
Priority: Normal » Critical
Status: Needs work » Needs review
FileSize
14.55 KB

Yeah, as I said many times above, this patch was far from done, and no one ever implemented the changes I explained in #23. I can't stand it anymore, since this patch is too important and holding up too many other things, so I just did it myself. This is almost entirely a complete rewrite of the patch, though I lifted a little bit of the code from the previous efforts.

This needs a little more testing (e.g. on p.d.o) and the .css changes might need a little tweaking, but this should be pretty darn close now. ;)

dww’s picture

I fought bluebeach and garland css bugs for a while, fixed some other visual junk that was from the original cwgordon07 effort, and some other minor cleanup. I think this is now basically RTBC. This patch is now installed on p.d.o, for example: http://project.drupal.org/project/signup.

Any final objections or reviews before I commit and finally deploy all of this (and the related backend changes) on d.o?

dww’s picture

A few final changes: 1 important debugging comment that was removed (which disabled caching, tee hee), and some minor typos and formatting in comments, etc.

aclight’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me. Tested on p.d.o and works as expected.

drewish’s picture

Status: Reviewed & tested by the community » Needs review

i really like it. the only thing i'd suggest is giving a little thought to the "Currently recommended:" coloring on the edit/releases page. you're using yellow to denote changed but it's the same shade as the warning text in the downloads table. i'd either leave it white or have it match the colors in the download table, e.g. selecting a branch with only a -dev release gives you a red background.

dww’s picture

Status: Needs review » Fixed

I don't really have much energy to argue about the color thing. I think it's nice to reuse the core JS "yellow means you changed it" on a page that doesn't use colors at all for anything else, than worry about the fact that the results of this page of settings changes a table that uses yellow.

Anyway, y'all cross posted, and this was RTBC. I committed to HEAD and we deployed on drupal.org. Yay, now both #203313: Add a way for maintainers to indicate multiple supported branches and #203438: Edit links included in cached copy of project release download table are fixed (along with a bunch of others that were marked duplicate).

dww’s picture

Assigned: dww » Unassigned
Category: task » bug
Priority: Critical » Normal
Status: Fixed » Active
Issue tags: +GHOP

The project download table doesn't use exactly the same logic as update_status to figure out what's recommended. In particular, this is a problem for releases with "extra" such as "-rc1" or "-beta". This is broken in both project_release_table() and project_release_get_current_recommended(). It'd be nice to unify those two functions, too, but that's might be outside the scope of this issue.

dww’s picture

Assigned: Unassigned » dww
Status: Active » Fixed

Status: Fixed » Closed (fixed)
Issue tags: -GHOP

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