[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GNATS & GNATSWEB: ticket dependency
From: |
Yngve Svendsen |
Subject: |
Re: GNATS & GNATSWEB: ticket dependency |
Date: |
Mon, 03 Dec 2001 16:36:49 +0100 |
At 10:24 03.12.2001 +0100, Visintin Sabrina wrote:
I would like first of all to tell you that I like the software very much.
What I could not find is a feature (I'm wondering if it exist, or if it is
foreseen in a future implementation) that we need: dependency between
tickets.
This is indeed a valid request, but no such features are planned currently.
However, GNATS 4 is actually very close to providing this functionality.
GNATS 4 has a config parameter called "on-change", which specifies what
actions are to be taken when the contents of a field change. A typical
application of this is to add audit-trail entries when Responsible or State
changes, or to set the Closed-Date field when a PR is closed.
The following entry in the standard GNATS 4 dbconfig file sets up the State
field:
field "State" {
builtin-name "state"
description "The current state of the PR"
enumerated-in-file {
path "states"
fields { "state" "type" "description" }
key "state"
}
textsearch
on-change {
# Add Audit-Trail entries when this field changes.
add-audit-trail
# Require that a reason be supplied when this field is edited.
require-change-reason
}
#
# Here's an example of how we would set the Closed-Date: field when the
# State: field is changed to "closed".
#
# Note that a \ followed by a newline is ignored, and \n within strings
# is translated to the EOL character.
#
# Only do the edit if the new State's type is "closed".
#
on-change "State[type]==\"closed\"" {
#
# Set the Closed-Date field to the current date. (We can also
# use $OldValue and $NewValue here as well, in addition to any
# of the PR's field values.)
#
set-field "Closed-Date" {
"%s"
"$CurrentDate"
}
}
#
# If the old PR's State: field type is closed...then we want to clear
# the Closed-Date field, because the new PR's state isn't closed anymore.
#
on-change "oldpr:State[type]==\"closed\"" {
#
# Null it out.
#
set-field "Closed-Date" {
""
}
}
}
Look at the on-change sections here. They provide an extremely powerful
machinery, and the only little thing that keeps us from opening other PRs
when a PR is closed is the ability to specify changes to fields in _other_
PRs than the one that's currently being edited. If we had that ability, we
could simply make another on-change section which triggers on State=closed
and oldpr:State=!closed and which uses the contents of a Dependent-PRs
field to set the State of dependent PRs to "open".
I don't think it would take very much work to implement this. Any volunteers?
Yngve Svendsen
GNATS 4 doc guy