[wp-hackers] Finding bugs to fix on Trac

Mark Jaquith mark.wordpress at txfx.net
Sun Feb 25 13:16:12 GMT 2007


On Feb 22, 2007, at 6:20 PM, Jennifer Hodgdon wrote:

> Right now, 4 of the top 10 tickets in the list have something that  
> looks like a patch file attached to them; farther down in the list,  
> I clicked on 5 random items and 3 had patches attached. Hence my  
> conclusion that the keywords are not being used by everyone to mark  
> that tickets have been patched (I am probably guilty).
>
> My thought was that, given that we have a couple of WordPress  
> developers on the list, presumably someone could write a quick SQL  
> join query and make a new report that checks to find Trac items  
> that actually do not have patch files attached, since presumably  
> the attachments are stored in a database table... ?? I would try it  
> myself, but I don't apparently have permission to create reports  
> (even for my own use). The so-called "Custom Query" page does not  
> have this capability either. Might be interesting to add it...

Hi Jennifer,

First of all, thanks for your interest and enthusiasm!  We can always  
use more ticket-hunters.

Per your suggestion, I've updated the "Needs Patch" Trac report to do  
a join on the attachment table and only return items that either:

- don't have an attachment, OR
- are marked "needs-patch"

I think my original reasoning behind not doing this was that the  
following wouldn't show up on the report:

- tickets with outdated patches
- tickets with insufficient patches
- tickets with non-patch attachments

But we can get around that by marking those tickets with "needs-patch"

So, heads up to Lloyd and other ticket maintainers: if a ticket has  
an attachment that isn't an attachment or is an outdated patch or an  
insufficient patch, mark the ticket as "needs-patch"  This shouldn't  
affect your liberal use of the "has-patch" or "commit" tags.

For posterity, or if we decide to go back, here are the Trac report  
queries:

Old:

> SELECT (CASE WHEN keywords LIKE '%%needs-patch%%' THEN 'background:  
> #ffcc66;' ELSE '' END) AS __style__,
>    id AS ticket, summary, t.type AS type, severity,
>    (CASE status WHEN 'assigned' THEN owner||' *' ELSE owner END) AS  
> owner,
>    time AS created,
>    changetime AS _changetime, description AS _description,
>    reporter AS _reporter
>   FROM ticket t, enum p
>   WHERE status IN ('new', 'assigned', 'reopened')
> AND p.name = t.priority AND p.type = 'priority'
> AND t.keywords NOT LIKE '%%has-patch%%'
>   ORDER BY time DESC
>

New:

> SELECT (CASE WHEN keywords LIKE '%%needs-patch%%' THEN 'background:  
> #ffcc66;' ELSE '' END) AS __style__,
> 	t.id AS ticket,
> 	t.summary as summary,
> 	t.type AS type,
> 	t.severity as severity,
> 	(CASE t.status WHEN 'assigned' THEN owner||' *' ELSE owner END) AS  
> owner,
> 	t.time AS created,
> 	changetime AS _changetime,
> 	t.description AS _description,
> 	reporter AS _reporter
> FROM ticket t, enum p
> LEFT JOIN attachment a
> 	ON t.id = a.id
> WHERE 	
> 	(a.id IS NULL || t.keywords NOT LIKE '%%has-patch%%')
> 	AND status IN ('new', 'assigned', 'reopened')
> 	AND p.name = t.priority
> 	AND p.type = 'priority'
> GROUP BY t.id
> ORDER BY t.time DESC

--
Mark Jaquith
http://markjaquith.com/

Covered Web Services
http://coveredwebservices.com/




More information about the wp-hackers mailing list