Working on project_release_find_latest_releases(), it occurs to me that we're building a fairly elaborate query here, and we're making quite a few assumptions about how releases should be ordered on each site. I'm tempted to try replacing this with a view, providing a default view for this, and in cases where a site needs project_release_find_latest_releases() to behave differently, it can just edit the default and tweak the order by settings all they want. This might be insane, and "won't fix" might be the best status here, but I wanted to at least get some input before I experiment with this. Since I'm going to need basically the same query for some other stuff related to packaged install profiles, it'd be good to either move this to an internal view, or at least refactor the query building stuff into a shared helper, so I'm tagging this for the "packaged install profiles" work.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 642094-3.project_release_query_releases_by_branch.patch | 4.25 KB | dww |
| #1 | 642094-1.project_release_find_latest_releases_query_builder.txt | 2.62 KB | dww |
Comments
Comment #1
dwwFor comparison, here's the query builder function I'd either have to add to project_release, or replace with an internal view...
Comment #2
dwwAfter further discussion with Earl, we don't want to embed a view for this. I think we just need a better solution for sorting releases with version_extra defined (see #642096-3: Provide a better mechanism for sorting releases with version_extra defined: introduce version_extra_weight for more). However, we do want to split this out from project_release_find_latest_releases() into a shared helper (along the lines of what I attached at #1) so it can be reused by #642114: Compute and maintain the update status for every release node and perhaps other spots where we do something similar.
Comment #3
dwwThe query we build in here is going to change via #642096: Provide a better mechanism for sorting releases with version_extra defined: introduce version_extra_weight, but I'd like to start just with the helper function using the existing query.
Comment #4
hunmonk commentedlooks good, although i haven't tested it.
Comment #5
dwwCommitted to HEAD. Turning my attention to #642096: Provide a better mechanism for sorting releases with version_extra defined: introduce version_extra_weight now.