[p4dti-discussion] Will setting "closed_state = NONE" stop P4DTI from closing bugs?

Nick Barnes nb at ravenbrook.com
Tue Jan 3 07:50:10 GMT 2006


At 2005-12-23 15:50:36+0000, "Jay Glanville" writes:
> Hello all.
>  
> Sorry for the rather cryptic question, but I always have problems making
> succinct subjects.
>  
> Here's the situation: we're currently using P4DTI to synchronize between
> Bugzilla and P4.  Works great (Kudos to Ravenbrook)!  However, we want
> to change once piece of behaviour.  It's when you submit a changelist
> with jobs attached, that the job's status gets set to "closed".  Of
> course, P4DTI picks up this change and resolves the bug.  But we want to
> force the developers to resolve the bug explicitly.  (If they resolve it
> explicitly, then they might remember to fill in the rest of the fields
> that are asked of them.)
> 
> My though was that if we set the P4DTI configuration option
> "closed_state" to NONE, then when the job was closed, P4DTI wouldn't try
> to change the bug's status.  My fear is that when P4DTI tries to
> synchronize information in the other direction (BZ -> P4), and the bug
> was RESOLVED, would it properly set the job's status?

That is exactly the problem.

    closed_state = None

is equivalent to

    closed_state = 'CLOSED'

and is not what you want.

I don't think there is a way of achieving exactly what you want,
unless you are prepared to abuse the meaning of one of the Bugzilla
bug_status codes (e.g. REOPENED).  The P4DTI will try to replicate the
Bugzilla status in Perforce, and vice versa, so requires a one-to-one
correspondence between Bugzilla status and Perforce status.  The
closed_state configuration setting just lets you specify one line in
that correspondence: which Bugzilla status maps to the Perforce status
'closed' (which is special because fix commands use it by default).

The correspondence tables are constructed by the make_state_pairs
function in configure_bugzilla.py.  If you want some special behaviour
which is not currently possible, that's the function to change.  It's
fairly straight-forward.  Here are some typical correspondence tables
(Bugzilla bug_status on the left, Perforce job status on the right):

closed_state = None or closed_state = 'CLOSED':

    UNCONFIRMED  unconfirmed
    NEW          bugzilla_new
    ASSIGNED     assigned
    RESOLVED     resolved
    REOPENED     reopened
    VERIFIED     verified
    CLOSED       closed

closed_state = 'RESOLVED':

    UNCONFIRMED  unconfirmed
    NEW          bugzilla_new
    ASSIGNED     assigned
    RESOLVED     closed
    REOPENED     reopened
    VERIFIED     verified
    CLOSED       bugzilla_closed

closed_state = 'ASSIGNED':

    UNCONFIRMED  unconfirmed
    NEW          bugzilla_new
    ASSIGNED     closed
    RESOLVED     resolved
    REOPENED     reopened
    VERIFIED     verified
    CLOSED       bugzilla_closed

closed_state = 'REOPENED':

    UNCONFIRMED  unconfirmed
    NEW          bugzilla_new
    ASSIGNED     assigned
    RESOLVED     resolved
    REOPENED     closed
    VERIFIED     verified
    CLOSED       bugzilla_closed

closed_state = 'NONE' or closed_state = 'SPONG':

    Error P4DTI-301X on startup.

I hope this helps.  Happy New Year!

Nick Barnes
P4DTI Project
Ravenbrook Limited





More information about the P4DTI-discussion mailing list