On 12 April 2010 10:13, William Grant <[email protected]> wrote: > On Mon, 2010-04-12 at 10:08 +0100, Graham Binns wrote: >> On 12 April 2010 09:56, Tim Penhey <[email protected]> wrote: >> > On Mon, 12 Apr 2010 19:11:17 Bjorn Tillenius wrote: >> >> On Mon, Apr 12, 2010 at 08:01:24AM +0100, Graham Binns wrote: >> >> > On 12 April 2010 06:04, Tim Penhey <[email protected]> wrote: >> >> > > Hi Deryck, >> >> > > >> >> > > As discussed before I'm tackling the JFDI approach and I'm going to >> >> > > get >> >> > > the scanner to update the bug-task status [1]. >> >> > > >> >> > > I'd like the bug-task to be set to in-progress when it is linked to >> >> > > the >> >> > > branch, and fix-committed if it is linked to a branch that was marked >> >> > > as merged through a merge proposal. >> >> > > >> >> > > Since the scanner is a script, what do you think the best approach is >> >> > > so that the appropriate subscribers get notified? Â I had a brief look >> >> > > at the bug code but it was not clear to me exactly how to proceed. >> >> > >> >> > The simplest way I can think of, though not a particularly elegant one, >> >> > >> >> > is to do something like this: >> >> > from lp.bugs.adapters.bugchange import BugTaskStatusChange >> >> > change = BugTaskStatusChange( >> >> > >> >> > bug_task=bug_task, when=UTC_NOW, person=current_person, >> >> > what_changed='status', old_value=old_bugtask_status.title, >> >> > new_value=new_bugtask_status.title) >> >> > >> >> > bug_task.bug.addChange(change) >> >> > >> >> > However, I'd be inclined to say "use whatever the API uses," but I don't >> >> > actually know what that is (just from a bit of looking around at pre-8am >> >> > I can't find it, anyway). >> >> >> >> The easiest way is probably to use IBug.setStatus(). It will do the >> >> right thing (including notifying people about changes), even if you pass >> >> in an IProductSeries. >> > >> > Ah ha, but I don't have a person. >> > >> > Should I use a celebrity? >> >> I think so, yes. We have celebrities for the Janitor(s) and for the >> bug watch updater and so on, so it makes sense to have a celebrity for >> the scanner too. > > Soyuz uses ~janitor to close bugs. See > lp.soyuz.scripts.processaccepted.close_bugs_for_sourcepackagerelease. >
The janitor could be used but I'd be inclined to use something else. The use of the janitor suggests that the work is being done as a cleanup operation (so it's appropriate for Soyuz because the janitor is cleaning up after a package release). For the branch scanner, though, the branches are in active development, so I think it's more meaningful to have a branch scanner celebrity. Also, the bikeshed should be blue. -- Graham Binns | PGP Key: EC66FA7D _______________________________________________ Mailing list: https://launchpad.net/~launchpad-dev Post to : [email protected] Unsubscribe : https://launchpad.net/~launchpad-dev More help : https://help.launchpad.net/ListHelp

