Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 203647 - inclusion of bug statistics cause site page to be empty
Summary: inclusion of bug statistics cause site page to be empty
Status: RESOLVED WONTFIX
Alias: None
Product: Community
Classification: Eclipse Foundation
Component: Website (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows Vista
: P4 normal (vote)
Target Milestone: ---   Edit
Assignee: Portal Bugzilla Dummy Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-17 16:11 EDT by Mik Kersten CLA
Modified: 2010-05-20 22:48 EDT (History)
0 users

See Also:


Attachments
PHP for Mylyn bugs page (10.24 KB, text/plain)
2007-11-23 14:05 EST, Mik Kersten CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mik Kersten CLA 2007-09-17 16:11:17 EDT
Mylyn has been using the following to list stats:

    require_once($_SERVER['DOCUMENT_ROOT']."/eclipse.org-common/system/app.class.php");   
    require_once($_SERVER['DOCUMENT_ROOT']."/eclipse.org-common/system/nav.class.php");   
	require_once($_SERVER['DOCUMENT_ROOT']."/eclipse.org-common/system/menu.class.php");  
	require_once($_SERVER['DOCUMENT_ROOT']."/projects/common/bug.class.php");
	require_once($_SERVER['DOCUMENT_ROOT']."/projects/common/project-info.class.php");    
	require_once($_SERVER['DOCUMENT_ROOT']."/projects/common/project_bugs.class.php");
	
    $votesBugs = new ProjectBugs("tools.mylyn");
	$votesEnhancements = new ProjectBugs("tools.mylyn", 2);
	
Something has changed, probalby in the past week or two, where including this in the bugs page has been causing the page to be completely empty.
Comment 1 Bjorn Freeman-Benson CLA 2007-09-17 21:10:24 EDT
Mik, can you tell me which APIs you were using from ProjectBugs? As we are moving from an XML-based project meta-data to a database-based project meta-data, we removed the previous classes (sorry, I didn't know anybody was using them). I will recreate the APIs that you were/are using but base them on the new database-based project meta-data - just let me know which APIs they were.
Comment 2 Mik Kersten CLA 2007-09-17 22:56:07 EDT
Thanks Bjorn.  We were using the following in combination with the stuff in the Description of this bug.

<div id="rightcolumn"> 
	<font size=1>
	<?= $votesBugs->getAsSideHTML("Top Voted Bugs") ?>
	<?= $votesEnhancements->getAsSideHTML("Top Voted Enhancements") ?>
	</font>
</div>

This is the last recommendation I saw on getting the vote rankings (from you, quite a while back), and I still find that to be a very useful feature.  Feel free to give us an API you want for getting them, as long as you provide a snippet :)
Comment 3 Bjorn Freeman-Benson CLA 2007-09-21 20:06:06 EDT
(In reply to comment #2)
Mik, I believe I restored and updated the necessary files to resurrect this API but you didn't tell me which page of yours was not working/should now be working. Could you provide the URL so that I can test my restoration?  Thanks.
Comment 4 Mik Kersten CLA 2007-11-23 14:05:15 EST
Sorry for the slow reply on this.  

I tried again and it is still breaking as per the Description of this bug.  The URL of the page is: http://www.eclipse.org/mylyn/bugs/  I'll attach the full PHP that used to work, but causes the web page to be blank now.
Comment 5 Mik Kersten CLA 2007-11-23 14:05:33 EST
Created attachment 83666 [details]
PHP for Mylyn bugs page
Comment 6 Mik Kersten CLA 2007-11-23 14:06:33 EST
Note that I have commented this out of our current page, so when you go to http://www.eclipse.org/mylyn/bugs/ the page will not be blank, but will be missing the bug stats.
Comment 7 Mik Kersten CLA 2008-01-23 14:27:42 EST
Bjorn: any news on this?  It would be great to get those bug stats back.
Comment 8 Bjorn Freeman-Benson CLA 2008-02-05 03:16:50 EST
I looked at this a bit and decided that the old code was just too awful to try to resurrect. Could you remind me what it was supposed to do and we'll build some new code that does that. Good, clean code. Healthy and non-awful.
Comment 9 Mik Kersten CLA 2008-02-12 11:30:00 EST
Healthy code sounds good :)

All that Mylyn wants, and that I hope other projects would want too, is a listing of the top-ten voted enhancements and top-ten voted bugs (i.e. reports not marked enhancement).  In other words, what we get from https://bugs.eclipse.org/bugs/ but per-project.  It could be nice to have on the common project pages too, but this request is about supporting embedding into our own pages via a bit of PHP.
Comment 10 Denis Roy CLA 2009-03-19 14:18:26 EDT
> All that Mylyn wants, and that I hope other projects would want too, is a
> listing of the top-ten voted enhancements and top-ten voted bugs

Here are the queries I use on the bugzilla home page to show similar results.  Keep in mind that the bugzilla home page is static html that is generated by a script every hour to save on the database queries.

Note that each query takes about .2 to .7 seconds to run, and could perhaps be optimized to eliminate a file sort on the votes table.


# top 10 bugs in last 6 months
SELECT VOT.bug_id, sum(VOT.vote_count) as Total, BUG.short_desc, PRD.name
FROM votes AS VOT
INNER JOIN bugs AS BUG on BUG.bug_id = VOT.bug_id
INNER JOIN products AS PRD on PRD.id = BUG.product_id
WHERE BUG.bug_status NOT IN ('VERIFIED', 'CLOSED')
AND BUG.resolution NOT IN ('DUPLICATE', 'FIXED', 'INVALID', 'WONTFIX', 'WORKSFORME')
AND BUG.bug_severity <> 'enhancement'
AND BUG.creation_ts > DATE_SUB(CURDATE(), INTERVAL 6 MONTH)
GROUP BY BUG.bug_id
ORDER BY Total DESC
LIMIT 10

===========================================================
# top 10 enhancements in last 6 months
SELECT VOT.bug_id, sum(VOT.vote_count) as Total, BUG.short_desc, PRD.name
FROM votes AS VOT
INNER JOIN bugs AS BUG on BUG.bug_id = VOT.bug_id
INNER JOIN products AS PRD on PRD.id = BUG.product_id
WHERE BUG.bug_status NOT IN ('VERIFIED', 'CLOSED')
AND BUG.resolution NOT IN ('DUPLICATE', 'FIXED', 'INVALID', 'WONTFIX', 'WORKSFORME')
AND BUG.bug_severity = 'enhancement'
AND BUG.creation_ts > DATE_SUB(CURDATE(), INTERVAL 6 MONTH)
GROUP BY BUG.bug_id
ORDER BY Total DESC
LIMIT 10

===========================================================
# top 10 helpwanted in last 6 months
SELECT VOT.bug_id, sum(VOT.vote_count) as Total, BUG.short_desc, PRD.name
FROM votes AS VOT
INNER JOIN bugs AS BUG on BUG.bug_id = VOT.bug_id
INNER JOIN products AS PRD on PRD.id = BUG.product_id
WHERE BUG.bug_status NOT IN ('VERIFIED', 'CLOSED')
AND BUG.resolution NOT IN ('DUPLICATE', 'FIXED', 'INVALID', 'WONTFIX', 'WORKSFORME')
AND BUG.keywords LIKE '%helpwanted%'
GROUP BY BUG.bug_id
ORDER BY Total DESC
LIMIT 10
Comment 11 Denis Roy CLA 2010-05-20 22:48:00 EDT
We won't be re-enabling this.