public inbox for gnats-devel@sourceware.org
 help / color / mirror / Atom feed
From: Mel Hatzis <mel@wattes.org>
To: "McFarland, Ken" <kmcfarland@starentnetworks.com>
Cc: Jim Prowak <Jim.Prowak@nsc.com>, help-gnats@gnu.org
Subject: Re: restricting close PR
Date: Sat, 19 Feb 2005 05:16:00 -0000	[thread overview]
Message-ID: <4216C73D.5000704@wattes.org> (raw)
In-Reply-To: <8A16DAD84432534FBFC19FD92B50512F0268BBDE@ames.starentnetworks.com>

McFarland, Ken wrote:
> Jim,
>  
> Without making perl change in gnatsweb.pl I don't think thing there is
> support for this today.   However, you could do something like this in your
> dbconfig file.  It's not pretty, but would probably work....but you'll
> need to keep an updated list of people not allowed to close a PR in
> here  (not
> a great solution)  I don't to this exactly, but do change other fields
> based on certain state changes.  I didn't try this, but tweaked mine a
> bit for
> this example.... I think this would work for you to block say user
> kmcfarla from closing a PR.
>  
> fwiw
>  
> field "State" {
>     builtin-name "state"
>     description "The current state of the PR"
>     enumerated-in-file {
>         path "states"
>         fields { "state" "type" "description" }
>         key "state"
>         default "open"
>     }
>     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
>     }
>  
> 
>     #
>     # Change State back to its original setting for the following users
> aren't allowed to Close a PR
>     #
>     on-change "(oldpr:State[type]==\"open\") & (Originator==\"kmcfarla\")" {
>  
>                 set-field "State" {
>                         oldpr:State
>                 }
>     }
> }


Actually, a better way to do this would be to extend the set of metadata
fields in the responsible file with an additional datapoint...call it
the 'allowed-to-close' field. So your responsible file would look
something like:

gnats-admin:GNATS administrator:foo@bar.org:N
foo:Foo User:foo@bar.org:N
bar:Bar User:bar@bar.org:Y
baz:Baz User:baz@bar.org:N
etc.

You'll need to tweak your dbconfig file and update the definition of
the 'Responsible' field along these lines too.

Once you've done this, you can use the following type of on-change
clause:

   on-change "(oldpr:state[type]==\"open\") &\
              (state[type]==\"closed\") &\
              (responsible[allowed-to-close]==\"N\")" {
                  set-field "State" { "%s" "$OldValue" }
              }

Note that I haven't tested this, but it ought to work.
Let me know if you have trouble with it.

--
Mel Hatzis

> 
>     -----Original Message-----
>     *From:* help-gnats-bounces+kmcfarland=starentnetworks.com@gnu.org
>     [mailto:help-gnats-bounces+kmcfarland=starentnetworks.com@gnu.org]*On
>     Behalf Of *Jim Prowak
>     *Sent:* Wednesday, February 16, 2005 9:17 AM
>     *To:* help-gnats@gnu.org
>     *Subject:* restricting close PR
> 
> 
>     With gnats-web, is there a way to restrict the ability to close PRs
>     to a certain user?
> 
>     thanks,
> 
>     Jim
>     --------------------------------------------------------------------------------------------
>     Jim Prowak                                                          
>     Voice(585) 899-4306  
>     National Semiconductor                                      Fax
>     (585) 899-4320    
>     1000 Pittsford-Victor Rd.
>     Pittsford, N.Y. 14534    
>     jim.prowak@nsc.com
>     --------------------------------------------------------------------------------------------
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Help-gnats mailing list
> Help-gnats@gnu.org
> http://lists.gnu.org/mailman/listinfo/help-gnats



_______________________________________________
Help-gnats mailing list
Help-gnats@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnats

  reply	other threads:[~2005-02-19  5:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-16 18:40 McFarland, Ken
2005-02-19  5:16 ` Mel Hatzis [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-02-17 21:32 Jim Prowak
2005-02-16 14:46 Jim Prowak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4216C73D.5000704@wattes.org \
    --to=mel@wattes.org \
    --cc=Jim.Prowak@nsc.com \
    --cc=help-gnats@gnu.org \
    --cc=kmcfarland@starentnetworks.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).