I just wrote the queries, so now it "just needs a page around it":
Top 10 issues by followers:
select count(1), concat('</td><td><a href="http://drupal.org/node/', n.nid, '">', n.title, '</a></td></tr>') from flag_content fc inner join node n on fc.content_id = n.nid group by n.nid, n.title order by count(1) desc limit 10;
Top 10 issues by followers who didn't comment:
select count(1), concat('</td><td><a href="http://drupal.org/node/', n.nid, '">', n.title, '</a></td></tr>') from flag_content fc inner join node n on fc.content_id = n.nid left join comments c on fc.content_id = c.nid and fc.uid = c.uid where c.uid is null group by n.nid, n.title order by count(1) desc limit 10;
Top 10 issues by followers who didn't comment based on follows in the last month:
select count(1), concat('</td><td><a href="http://drupal.org/node/', n.nid, '">', n.title, '</a></td></tr>') from flag_content fc inner join node n on fc.content_id = n.nid left join comments c on fc.content_id = c.nid and fc.uid = c.uid where c.uid is null and fc.timestamp > unix_timestamp() - 60*60*24*30 group by n.nid, n.title order by count(1) desc limit 10;
Top 10 open issues for a project (844474 is the node id of the project in this case)
select count(1), concat('<a href="http://drupal.org/node/', n.nid, '">', n.title, '</a>'), pis.name from flag_content fc inner join node n on fc.content_id = n.nid INNER JOIN project_issues pi on n.nid = pi.nid INNER JOIN project_issue_state pis ON pi.sid = pis.sid WHERE pi.pid = 844474 AND pis.default_query = 1 group by n.nid, n.title order by count(1) desc limit 10;
Comments
Comment #1
coltrane+1 subscribe
Comment #2
longwaveIt would be even more awesome to see this data per-project if possible!
Comment #7
HnLn CreditAttribution: HnLn commented+1 for having this visible on the actual issue page, I think it's relevant you can see how many followers an issue has so you know if it's you who screwed up something or if there are a lot of people who face the same problem.
Can maintainers see what issue has the most followers in their queue ?
Comment #8
longwave@HnLn: that sounds more like #1304550: Display count of issue followers when viewing an issue
Comment #9
HnLn CreditAttribution: HnLn commentedcool, tnx, should have checked the issue queue first, my bad.
Comment #10
dww+1 to the concept. It'd be nice to expose this info.
Can't this be done in views instead of hard-coded queries and display pages?
And yes, +1 to having it also available per-project, not just site-wide (although that's going to add another JOIN and a WHERE to the query, which will make it therefore more expensive).
Any thoughts/proposals on a URL structure for where these pages should live?
Thanks,
-Derek
Comment #11
Jim Kirkpatrick CreditAttribution: Jim Kirkpatrick commentedI thinks this is a really important tool which should be added ASAP. Having such important issue metadata hidden except to a privileged few is a real shame.
In an ideal world we'd direct would-be contributors to the most followed issues so the big ones get more attention, and resolved more quickly. This would be an invaluable tool.
This is just a vanilla View based on Flag integration with a little count() action, isn't it? Why do the OP queries need to worry about HTML in the query? Seems hacky, but perhaps I'm showing my ignorance of the internals here...
Comment #12
Jim Kirkpatrick CreditAttribution: Jim Kirkpatrick commentedUpdating title and tag.
Comment #13
gregglesThe original queries are mostly useful for joins, not the columns.
Not as far as I know. The structure, as you probalby noticed, is just Flags so you could definitely create a mockup of the system on your local machine and export views here if it's that the case.
Comment #13.0
gregglesfixing code tags
Comment #13.1
gregglesx
Comment #14
mgiffordThink this is still needed.