from project_release_query_releases_by_branch():

  // Within releases of the same version_extra_weight (e.g. rc1 vs. rc2) just
  // sort alphabetically, so that rc2 shows up first in the query.
  $order_bys[] = 'r.version_extra DESC';

this doesn't work in all cases, unfortunately -- as beta10 ends up being less than beta9... :(

the views handlers look like they suffer from this same bug.

nobody makes that many extra releases, you say? unfortunately that's not the case...

http://drupal.org/node/647814

this looks like a particularly bad problem with three possible solutions:

  1. leave it, because it won't affect many people -- they shouldn't be making double-digit extra releases anyways ;)
  2. do PHP stuff on the version extra string
  3. move the entire sorting process to the version_extra_weight field, and make the version_extra field just for display.

#1 is probably a bit irresponsible ;)
#2 defeats the purpose of moving making the version_extra_weight field in the first place :(
#3 three will involve a fairly major refactor, plus a db update that could be tricky. :(

no fun at all. option 3 or something like it is probably what should happen i think.

Comments

hunmonk’s picture

Title: version_extra can just be string sorted, because beta10 < beta9 » version_extra can't just be string sorted
dww’s picture

Assigned: Unassigned » dww
Priority: Normal » Critical
Issue tags: +packaged install profiles

Yup, that's a bug alright. Fairly nasty one, in fact. I'm on it. I'll ponder and research a bit. One quick idea:

4. Add a version_extra_delta field (or something -- "version_extra_iteration", "version_extra_number"?), and if version extra contains a number, we stick it in there when the release node is created. Then we sort on version_extra_weight and version_extra_delta.

But yeah, we need to fix this...

dww’s picture

Well, if we do #4 from comment #2 (this is why I like to order options in issues with letters, not numbers, btw), project_release_update_N() going to be pretty nasty:

mysql> select count(*) from project_release_nodes;
+----------+
| count(*) |
+----------+
|    30215 | 
+----------+
1 row in set (0.02 sec)

mysql> select count(*) from project_release_nodes WHERE version_extra IS NOT NULL;
+----------+
| count(*) |
+----------+
|    15310 | 
+----------+
1 row in set (0.04 sec)

We're going to have to load each of those 15310 records from {prn} into RAM, do a little preg_match() on version_extra, then issue separate UPDATE queries for each one. Definitely going to want batch API for this...

I don't really know of a better way to solve this than #4 at this point, and I got Earl to look and he agrees. I think I'll just start coding that and see how nasty it gets. I'm slightly worried about assuming a specific format of version_extra, but, i guess if the regexp is something like .*(\d+).* it should be pretty safe. if there's a number in there, use it. I guess the actual regexp could be another non-UI setting in settings.php if someone really needed a different one on their own project_release install for some reason. ;)

dmitrig01’s picture

sort by nid or created time :P

pasqualle’s picture

same problem with imagecache-2.0-beta10

also what happens with feedapi 1.8 vs 1.9-beta3. As I know before the views integration the 1.9-beta3 was the recommended now the 1.8 is..

this change will affect the sort in the usage statistics table also, right?

kmonty’s picture

subscribe

kmonty’s picture

Also, is there a way that we can downgrade to the previous packaging code? Managing the issue queue is becoming a major hassle because everyone is using outdated software

pasqualle’s picture

Don't panic! the packaging and the update status works correctly, so the users will see a nice red error message when they are using the wrong version. This is just a small UI bug on d.o, nothing more..

dww’s picture

Re: #6: "same problem with imagecache-2.0-beta10"

That's exactly the release mentioned in the original report. ;)

Re: #6: "also what happens with feedapi 1.8 vs 1.9-beta3. As I know before the views integration the 1.9-beta3 was the recommended now the 1.8 is.."

That's a feature, not a bug. See #647428: Show latest prerelease (if different from recommended release) with dev releases

Re: #8: "Also, is there a way that we can downgrade to the previous packaging code?"

It's not a packaging thing at all. It's strictly the UI on d.o project pages in this edge case. Anyway, this is near the top of my list for today, hopefully I'll have something working and deployed this afternoon.

Cheers,
-Derek

rfay’s picture

Subscribing. Amazon module has this problem.

kmonty’s picture

Bump. This bug really needs to be fixed. There is really no way to revert to the old 'simple UI' code until the latest version is patched?

pasqualle’s picture

There is always a way to revert, but in this case that would be more work than fixing this issue..

rfay’s picture

Yes, this is important. I did an RC1 release as a workaround, but this is an overall bad situation to be in.

dww’s picture

Assigned: dww » Unassigned

I've had a ton of fires to deal with the last month, and haven't been able to get back to this. Yes, it's a bummer, but it's not like children are dying because of this bug. The code is all sitting there in CVS if anyone really wants to fix it. ;) I've already explained what the most likely solution to fixing this would be -- it's not like I'm the only person on Earth capable of understanding this and solving it.

That said, I might have a chance to get to this at some point over the next week, although I desperately need a vacation and a break, so I'm not going to make any promises...

Cheers,
-Derek

dww’s picture

Issue tags: +6.x-1.0 blocker

tagging -- we can't ship 6.x-1.0 without fixing this

bdragon’s picture

Assigned: Unassigned » bdragon

Taking a shot at this.

bdragon’s picture

Status: Active » Needs review
StatusFileSize
new5.54 KB

OK, done and seemingly working.

One thing I am unsure of is whether we should continue to do $order_bys[] = 'r.version_extra DESC'; in project_release_query_releases_by_branch().

In this patch, it is left out. I can re-test later with it in, but I don't have time at the moment to do that, so I'm submitting the patch "as tested" instead of doing another run locally.

If it were to be in, I guess the correct order would be to have it after the $order_bys[] = 'r.version_extra_delta DESC';.

Lastly, here is what the code came up with for deltas.

+---------------+---------------------+                                                                                                              
| version_extra | version_extra_delta |                                                                                                              
+---------------+---------------------+                                                                                                              
| 1             |                   1 |                                                                                                              
| 10            |                  10 |                                                                                                              
| 11            |                  11 |                                                                                                              
| 12            |                  12 |                                                                                                              
| 13            |                  13 |                                                                                                              
| 14            |                  14 |                                                                                                              
| 15            |                  15 |                                                                                                              
| 16            |                  16 |                                                                                                              
| 17            |                  17 |                                                                                                              
| 18            |                  18 |                                                                                                              
| 19            |                  19 |                                                                                                              
| 1beta2        |                   1 |                                                                                                              
| 2             |                   2 |                                                                                                              
| 2rc1          |                   2 |                                                                                                              
| 3             |                   3 |                                                                                                              
| 4             |                   4 |                                                                                                              
| 5             |                   5 |                                                                                                              
| 51            |                  51 |                                                                                                              
| 6             |                   6 |                                                                                                              
| 7             |                   7 |                                                                                                              
| 8             |                   8 |                                                                                                              
| 9             |                   9 |                                                                                                              
| 91            |                  91 |                                                                                                              
| 92            |                  92 |                                                                                                              
| 93            |                  93 |                                                                                                              
| 94            |                  94 |                                                                                                              
| 95            |                  95 |                                                                                                              
| 96            |                  96 |                                                                                                              
| 97            |                  97 |                                                                                                              
| alpha1        |                   1 |                                                                                                              
| alpha10       |                  10 |                                                                                                              
| alpha11       |                  11 |                                                                                                              
| alpha12       |                  12 |                                                                                                              
| alpha13       |                  13 |                                                                                                              
| alpha14       |                  14 |                                                                                                              
| alpha15       |                  15 |                                                                                                              
| alpha16       |                  16 |                                                                                                              
| alpha17       |                  17 |                                                                                                              
| alpha18       |                  18 |                                                                                                              
| alpha19       |                  19 |                                                                                                              
| alpha2        |                   2 |                                                                                                              
| alpha20       |                  20 |                                                                                                              
| alpha21       |                  21 |                                                                                                              
| alpha22       |                  22 |                                                                                                              
| alpha23       |                  23 |                                                                                                              
| alpha24       |                  24 |                                                                                                              
| alpha25       |                  25 |                                                                                                              
| alpha26       |                  26 |                                                                                                              
| alpha27       |                  27 |                                                                                                              
| alpha28       |                  28 |                                                                                                              
| alpha3        |                   3 |                                                                                                              
| alpha4        |                   4 |                                                                                                              
| alpha5        |                   5 |                                                                                                              
| alpha6        |                   6 |                                                                                                              
| alpha6b       |                   6 |                                                                                                              
| alpha6c       |                   6 |                                                                                                              
| alpha7        |                   7 |                                                                                                              
| alpha7b       |                   7 |                                                                                                              
| alpha7c       |                   7 |                                                                                                              
| alpha7d       |                   7 |                                                                                                              
| alpha7e       |                   7 |                                                                                                              
| alpha8        |                   8 |                                                                                                              
| alpha9        |                   9 |                                                                                                              
| alphpa5       |                   5 |                                                                                                              
| beta1         |                   1 |                                                                                                              
| beta10        |                  10 |                                                                                                              
| beta11        |                  11 |                                                                                                              
| beta12        |                  12 |                                                                                                              
| beta13        |                  13 |                                                                                                              
| beta14        |                  14 |                                                                                                              
| beta15        |                  15 |                                                                                                              
| beta16        |                  16 |                                                                                                              
| beta17        |                  17 |                                                                                                              
| beta18        |                  18 |                                                                                                              
| beta19        |                  19 |                                                                                                              
| beta2         |                   2 |                                                                                                              
| beta20        |                  20 |                                                                                                              
| beta21        |                  21 |                                                                                                              
| beta22        |                  22 |                                                                                                              
| beta23        |                  23 |                                                                                                              
| beta24        |                  24 |                                                                                                              
| beta25        |                  25 |                                                                                                              
| beta26        |                  26 |                                                                                                              
| beta27        |                  27 |                                                                                                              
| beta28        |                  28 |                                                                                                              
| beta29        |                  29 |                                                                                                              
| beta2a        |                   2 |                                                                                                              
| beta3         |                   3 |                                                                                                              
| beta30        |                  30 |                                                                                                              
| beta31        |                  31 |                                                                                                              
| beta32        |                  32 |                                                                                                              
| beta33        |                  33 |                                                                                                              
| beta34        |                  34 |                                                                                                              
| beta35        |                  35 |                                                                                                              
| beta36        |                  36 |                                                                                                              
| beta4         |                   4 |                                                                                                              
| beta4a        |                   4 |                                                                                                              
| beta4b        |                   4 |                                                                                                              
| beta5         |                   5 |                                                                                                              
| beta6         |                   6 |                                                                                                              
| beta7         |                   7 |                                                                                                              
| beta8         |                   8 |                                                                                                              
| beta9         |                   9 |                                                                                                              
| dev0001       |                   1 |                                                                                                              
| dev1          |                   1 |                                                                                                              
| dev2          |                   2 |                                                                                                              
| og54          |                  54 |                                                                                                              
| og61          |                  61 |                                                                                                              
| og72          |                  72 |                                                                                                              
| rc1           |                   1 |                                                                                                              
| rc10          |                  10 |                                                                                                              
| rc11          |                  11 |                                                                                                              
| rc12          |                  12 |                                                                                                              
| rc13          |                  13 |                                                                                                              
| rc14          |                  14 |                                                                                                              
| rc15          |                  15 |                                                                                                              
| rc1a          |                   1 |                                                                                                              
| rc2           |                   2 |                                                                                                              
| rc2patch1     |                   2 |                                                                                                              
| rc3           |                   3 |                                                                                                              
| rc4           |                   4 |                                                                                                              
| rc5           |                   5 |                                                                                                              
| rc6           |                   6 |                                                                                                              
| rc7           |                   7 |                                                                                                              
| rc8           |                   8 |                                                                                                              
| rc9           |                   9 |                                                                                                              
| soc07final    |                   7 |                                                                                                              
| test1         |                   1 |                                                                                                              
| test2         |                   2 |                                                                                                              
| test3         |                   3 |                                                                                                              
| unstable1     |                   1 |                                                                                                              
| unstable2     |                   2 |                                                                                                              
| unstable3     |                   3 |                                                                                                              
| unstable4     |                   4 |                                                                                                              
| unstable5     |                   5 |                                                                                                              
| unstable6     |                   6 |                                                                                                              
| unstable7     |                   7 |                                                                                                              
+---------------+---------------------+                                                                                                              
137 rows in set (0.08 sec)

Thoughts?

bdragon’s picture

Whoops, my comment broke something. Probably the query result I posted at the end.
-----

OK, done and seemingly working.

One thing I am unsure of is whether we should continue to do $order_bys[] = 'r.version_extra DESC'; in project_release_query_releases_by_branch().

In this patch, it is left out. I can re-test later with it in, but I don't have time at the moment to do that, so I'm submitting the patch "as tested" instead of doing another run locally.

If it were to be in, I guess the correct order would be to have it after the $order_bys[] = 'r.version_extra_delta DESC';.

dww’s picture

Status: Needs review » Postponed
StatusFileSize
new3.33 KB
new6.42 KB

Temporarily blocked on #699528: project_release_compute_update_status() can't move a release from not secure to current. Here's an updated patch that cleans up + clarifies some comments, and also restores the ORDER BY as suggested by bdragon in #19. Attaching the interdiff from #18, too.

dww’s picture

Status: Postponed » Fixed

Now that #699528: project_release_compute_update_status() can't move a release from not secure to current is done, re-tested on d6.p.d.o, committed to HEAD, merged into d.o SVN, deployed on d.o, and ran the db update (with a little drupalorg_form_alter() hack to disable add/edit on project and release nodes while it ran -- silly to take the whole site offline for this). Things are looking sane now:

http://drupal.org/project/imagecache
http://drupal.org/project/feeds
http://drupal.org/node/647814

Yay! Thanks again bdragon for getting this most of the way there...

dww’s picture

Status: Fixed » Closed (fixed)
Issue tags: -6.x-1.0 blocker, -packaged install profiles

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