getting meta-data out of patchwork

Damien Lespiau damien.lespiau at intel.com
Thu Mar 24 01:23:51 AEDT 2016


On Wed, Mar 23, 2016 at 09:01:43AM -0500, Andy Doan wrote:
> On 03/22/2016 10:41 PM, Jeremy Kerr wrote:
> >Hi Stephen,
> >
> >>Is there anyway to get statistics out of patchwork about how long
> >>patches sit around, reject/accept rates, and patch sizes?
> >
> >There's no exposed interface for stats at present, but if it's a
> >once-off on patchwork.ozlabs.org I'm happy to do a query. For more
> >general stuff, we can certainly looking at adding a report to the
> >patchwork UI.
> >
> >Note that we don't (currently) track 'log' data (ie, when updates
> >actually occurred), so there's no way to tell (for example) if a patch
> >was accepted on the day it came in, or three months later.
> 
> We had a similar thing at Linaro. My solution isn't great, but I basically
> keep a "last_state_change" attribute and then use "last_state_change - date"
> to get time-to-acceptance[1]. This doesn't necessarily give a good metric,
> because its not taking into account a patch going through multiple
> revisions. That, however, might be a separate issue to tackle.
> 
> Do you guys think something like a "last_state_change" attribute would be
> worth adding models.Patch?
> 
> 1: https://git.linaro.org/infrastructure/patchwork-tools.git/blob/HEAD:/linaro_metrics/models.py#l203

FWIW, we also needed something similar and chose to have a full log of
state changes:

https://patchwork.freedesktop.org/api/1.0/projects/intel-gfx/events/?name=patch-state-change

This way, we can display the history of series/patches, that's the first
step towards having interesting metrics like the time between submission
and merge (or more generally between two states).

We can also monitor (poll for now) those state changes events: for
instance if we want to have scripts doing something specific when a
patch is reviewed, like auto-merging it into an integration branch.

As for a "last_updated" timestamp, I'd add one at least for the ability
to sort the list of patches by last "updated" first: eg. presenting a
patch someone just commented on at the top of the list (mirroring what
an email client would do if it get a new answer in a thread).

HTH,

-- 
Damien


More information about the Patchwork mailing list