← Back to team overview

launchpad-dev team mailing list archive

Re: Automatically setting the bug task status from the branch scanner

 

On 12 April 2010 09:56, Tim Penhey <tim.penhey@xxxxxxxxxxxxx> 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 <tim.penhey@xxxxxxxxxxxxx> 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.

-- 
Graham Binns | PGP Key: EC66FA7D



Follow ups

References