public inbox for gnats-devel@sourceware.org
 help / color / mirror / Atom feed
* RE: Subject line processing in Gnats 4.0
@ 2001-11-02  5:49 Dirk Bergstrom
  2001-11-03  1:41 ` Paul Traina
                   ` (2 more replies)
  0 siblings, 3 replies; 34+ messages in thread
From: Dirk Bergstrom @ 2001-11-02  5:49 UTC (permalink / raw)
  To: help-gnats

paul traina writes:
> Negative Dirk,
> I had it behave that way before, and it sucked.  Every time 
> someone sent in anything like "OS/2" it would append it to PR #2.

mr. traina makes a good point (he does that rather often).  i had been wrestling with this, with no great success.  it's why the idea had been sitting in my files for months.  now that my memory has been jogged, i remember a couple of solutions i'd had in mind.  in order of increasing radicalism:

*) accept FW: as well as RE: -- change the subject pattern thusly:

- "(.*re[ \t]*(\\[[0-9]+\\])?:)?[ \t]*([-a-z0-9_+.]*[:/][ \t]*([0-9]+))"
+ "(.*(re|fwd?)[ \t]*(\\[[0-9]+\\])?:)?[ \t]*([-a-z0-9_+.]*[:/][ \t]*([0-9]+))"

this will require adjusting what parenthetical expression is saved out of the match.

*) gnats currently accepts things like "sw-foo: 1234" instead of "sw-foo/1234".  i'm guessing that the former is an antiquated form, since gnats doesn't emit it anymore.  people don't use it, but they *do* use "PR1234".  adjust the regex appropriately:

+ "(.*(re|fwd?)[ \t]*(\\[[0-9]+\\])?:)?[ \t]*(([-a-z0-9_+.]*/)|pr)([0-9]+))"

this will require some futher munging of code, since the stuff that pulls out and uses <category>/<number> will have to learn to contend with PR<number>.  since it really isn't necessary to use category to pull up the PR, it might be best to change the regex to save only the number, and not the category/number pair.  then we could just hack out the additional parsing code.

i think that the first change is the minimum we should do.

--
Dirk Bergstrom               dirk@juniper.net
_____________________________________________
Juniper Networks Inc.,          Computer Geek
Tel: 707.433.0564           Fax: 707.433.0769

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

^ permalink raw reply	[flat|nested] 34+ messages in thread
* RE: Subject line processing in Gnats 4.0
@ 2001-11-06  5:58 Dirk Bergstrom
  2001-11-09 14:17 ` Milan Zamazal
  2001-12-13 15:09 ` Dirk Bergstrom
  0 siblings, 2 replies; 34+ messages in thread
From: Dirk Bergstrom @ 2001-11-06  5:58 UTC (permalink / raw)
  To: Milan Zamazal; +Cc: help-gnats

>     DB> *) accept FW: as well as RE: -- change the subject pattern
>     DB> thusly:
> This is insufficient, since my mail client generates something
> completely different of "FW" on forwarding and some other software
> authors think it's a good idea to replace "Re:" with its "translation"
> to the users' language.

yes yngve pointed this out as well.  I18N rears it's head.  i agree that
it's insufficient.

> - Accept "\<CATEGORY/NUMBER" where CATEGORY is a valid 
> category name and
>   PR NUMBER is present in CATEGORY.

i think this will cause problems -- as yngve pointed out, PRs often
change categories, and someone might reply to a PR that has since
changed.  i think the rule should be: 
	Accept "\<CATEGORY/NUMBER" where CATEGORY is a valid category
	name and NUMBER is a valid PR number (in any category).
let's not worry about deleted categories -- that's probably a very
infrequent occurrence, and it could get ugly to code around...

> - Accept "\<PR[ \t/]*NUMBER" where "PR" must be all capitals 
> and NUMBER
>   corresponds to an existing PR number.

this is good.

> Would it serve the purpose in an acceptable way?

hmmm, we need to make sure that the edge-cases are covered.  for
instance, what happens with this subject "re: sw-foo/1234: Compilation
fails on OS/2"?  what about some strange situation where the false hit
came *before* the category/number pair, like a mailing list post: "FW:
[OS/2 users] Re: sw-foo/1234: bar baz quux"?  yes, these are unlikely,
but it's going to be *very* confusing to the gnats-admin that has to
figure out why nobody can reply to one of their PRs...

other than that, i'm all for the change.

--
Dirk Bergstrom               dirk@juniper.net
_____________________________________________
Juniper Networks Inc.,          Computer Geek
Tel: 707.433.0564           Fax: 707.433.0769

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

^ permalink raw reply	[flat|nested] 34+ messages in thread
* RE: Subject line processing in Gnats 4.0
@ 2001-11-01 15:18 Dirk Bergstrom
  2001-12-12 13:03 ` Dirk Bergstrom
  0 siblings, 1 reply; 34+ messages in thread
From: Dirk Bergstrom @ 2001-11-01 15:18 UTC (permalink / raw)
  To: help-gnats

paul's refile-pr script may be found here:

http://www.otisbean.com/gnats/refile-pr.sh

you give it the number of a PR to append to, and a list of mistakenly created PRs, and it appends the relevant info from each bogus PR to the master PR, deleting each bogus PR in the process.  as written, the script is a bit dangerous -- get your args out of order, and you've put a big hole in your foot -- but it's the right tool for the job.

--
Dirk Bergstrom               dirk@juniper.net
_____________________________________________
Juniper Networks Inc.,          Computer Geek
Tel: 707.433.0564           Fax: 707.433.0769

> -----Original Message-----
> From: Paul Traina 
> Sent: Tuesday, December 11, 2001 9:43 PM
> To: Dirk Bergstrom; Milan Zamazal; Michael Richardson
> Cc: help-gnats@gnu.org
> Subject: Re: Subject line processing in Gnats 4.0
> 
> 
> Negative Dirk,
> I had it behave that way before, and it sucked.  Every time 
> someone sent in
> anything like "OS/2" it would append it to PR #2.
> Instead, I wrote a script called refile_pr (I think it may 
> still be in my
> home directory or under bin/... that solved this problem).
> If it's gone, I can tell you how to recreate it.  WIth gnats 4.0, it's
> trivial, about 5 lines of real code.
> 
> ----- Original Message -----
> From: "Dirk Bergstrom" <dirk@juniper.net>
> To: "Milan Zamazal" <pdm@zamazal.org>; "Michael Richardson"
> <mcr@sandelman.ottawa.on.ca>
> Cc: <help-gnats@gnu.org>
> Sent: Tuesday, December 11, 2001 6:10 PM
> Subject: RE: Subject line processing in Gnats 4.0
> 
> 
> > i've been wrestling with this problem for some time (we've 
> been running
> > 4.0a for over a year...), and i've been meaning to send 
> this to the list
> > for a while:
> >
> > summary:
> > at my company, we have been having some difficulties with gnats'
> > handling of email replies to PRs.  gnats checks the subject 
> of incoming
> > mail, and if it matches a fairly restrictive pattern (must 
> look like a
> > reply), the message is appended to the relevant PR.  if there is no
> > match, a new PR is created.  this often leads to creation 
> of bogus PRs,
> > because the matching expression is too restrictive.  i 
> propose that we
> > remove the restriction, and append *all* messages with 
> subjects matching
> >
> > a PR to that PR.
> >
> > detailed explanation:
> > when a message is filed by queue-pr (via file-pr), gnats scans the
> > subject line for the following regex (line 575 in file-pr.c):
> >
> > "(.*re[ \t]*(\\[[0-9]+\\])?:)?[ \t]*([-a-z0-9_+.]*[:/][ 
> \t]*([0-9]+))"
> >
> > which (sort of) translates to a regex of /.*(re:)? 
> <category>/<pr_num>/.
> > if it
> > finds this pattern, the message is appended to pr_num; if not, gnats
> > creates a new PR, using the subject as synopsis, and body as
> > description.
> >
> > this only works if people using gnats pay close attention 
> to the subject
> >
> > of their emails.  in the real world, however, developers forward
> > messages, they use mailers that insert extra cruft in the 
> subject line
> > (email addresses, names, etc), and sometimes gnats is used 
> in concert
> > with a different bug-tracking system, which inserts it's 
> own tracking
> > number in the subject.  whatever the cause, the result is a 
> bogus PR,
> > which clutters up the system, confuses developers and 
> support staff, and
> >
> > takes time and energy to close/expunge.
> >
> > these subjects do the Right Thing:
> >
> > *) re: compiler/9876: compiled code runs backwards
> > *) serial-port/1234: cannot process frosted flakes
> >
> > but these subjects all do the Wrong Thing (create new PR, instead of
> > appending):
> >
> > *) Re: FW: sw-kern-sanders/16543: kernel panic on gunshot
> > *) PR 12345
> > *) Fw: sw-rip-vnwnkl/10795: The routing subsystem is asleep
> > *) RE: 2001-0821-021: hw-pr0n/16413 FPC shows pictures of 
> naked ladies
> > on reboot
> >
> > (basically, anything in front of the category that's not 
> "re:" bombs.)
> >
> > i believe that the current behavior violates the principle of least
> > surprise -- if i send a message to bugs with a subject "re: fw:
> > sw-foo/1234", i expect that gnats will append it to PR 
> 1234.  opening a
> > new PR is *not* what i intend.
> >
> > solution:
> > it's not clear to me why the regex is so restrictive.  i 
> think it would
> > make more sense for gnats to assume that any message with a 
> parseable PR
> >
> > identifier (<category>/<pr_num>) in the subject should be 
> appended to
> > that PR.  that would allow for all the real-world messages to be
> > processed in a manner that would not surprise the sender.
> >
> > furthermore, i think it should also accept "PR<pr_num>", if 
> it is the
> > first reasonable text in the subject, a regex along the lines of "^[
> > \t]*((re|fw):)?[ \t]*pr([0-9]+)".  i often see bogus PRs with this
> > synopsis, which were clearly intended to be part of <pr_num>, not
> > separate PRs.  however, this would be a more extreme 
> change, and might
> > have unforseen consequences...
> >
> > does anyone see a reason to keep the restrictive regex?
> >
> > --
> > Dirk Bergstrom               dirk@juniper.net
> > _____________________________________________
> > Juniper Networks Inc.,          Computer Geek
> > Tel: 707.433.0564           Fax: 707.433.0769
> >
> > > -----Original Message-----
> > > From: Milan Zamazal [mailto:pdm@zamazal.org]
> > > Sent: Saturday, December 08, 2001 3:23 PM
> > > To: Michael Richardson
> > > Cc: help-gnats@gnu.org
> > > Subject: Re: Subject line processing in Gnats 4.0
> > >
> > >
> > > >>>>> "MR" == Michael Richardson 
> <mcr@sandelman.ottawa.on.ca> writes:
> > >
> > >     MR>   Following the code through, it calls sends SUBM to the
> > >     MR> server... and there is some heuristic in the 
> gnatsd that sees
> > >     MR> the subject line. And this has worked... sometimes.
> > > But I have a
> > >     MR> number of times it hasn't worked, and new PRs 
> were created. I
> > >     MR> can share them if this isn't a known problem.
> > >
> > > The problem is not known to me.  Please provide me with 
> the details.
> > >
> > > Thanks,
> > >
> > > Milan Zamazal
> > >
> > > --
> > > It's amazing how much better you feel once you've given up hope.
> > >                                                 (unknown source)
> > >
> > > _______________________________________________
> > > Help-gnats mailing list
> > > Help-gnats@gnu.org
> > > http://mail.gnu.org/mailman/listinfo/help-gnats
> > >
> >
> > _______________________________________________
> > Help-gnats mailing list
> > Help-gnats@gnu.org
> > http://mail.gnu.org/mailman/listinfo/help-gnats
> >
> >
> 
> 

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

^ permalink raw reply	[flat|nested] 34+ messages in thread
* RE: Subject line processing in Gnats 4.0
@ 2001-11-01  7:16 Dirk Bergstrom
  2001-11-01  7:18 ` Paul Traina
                   ` (2 more replies)
  0 siblings, 3 replies; 34+ messages in thread
From: Dirk Bergstrom @ 2001-11-01  7:16 UTC (permalink / raw)
  To: Milan Zamazal, Michael Richardson; +Cc: help-gnats

i've been wrestling with this problem for some time (we've been running
4.0a for over a year...), and i've been meaning to send this to the list
for a while:

summary:
at my company, we have been having some difficulties with gnats' 
handling of email replies to PRs.  gnats checks the subject of incoming 
mail, and if it matches a fairly restrictive pattern (must look like a 
reply), the message is appended to the relevant PR.  if there is no 
match, a new PR is created.  this often leads to creation of bogus PRs, 
because the matching expression is too restrictive.  i propose that we 
remove the restriction, and append *all* messages with subjects matching

a PR to that PR.

detailed explanation:
when a message is filed by queue-pr (via file-pr), gnats scans the 
subject line for the following regex (line 575 in file-pr.c):

"(.*re[ \t]*(\\[[0-9]+\\])?:)?[ \t]*([-a-z0-9_+.]*[:/][ \t]*([0-9]+))"

which (sort of) translates to a regex of /.*(re:)? <category>/<pr_num>/.
if it 
finds this pattern, the message is appended to pr_num; if not, gnats 
creates a new PR, using the subject as synopsis, and body as
description.

this only works if people using gnats pay close attention to the subject

of their emails.  in the real world, however, developers forward 
messages, they use mailers that insert extra cruft in the subject line 
(email addresses, names, etc), and sometimes gnats is used in concert 
with a different bug-tracking system, which inserts it's own tracking 
number in the subject.  whatever the cause, the result is a bogus PR, 
which clutters up the system, confuses developers and support staff, and

takes time and energy to close/expunge.

these subjects do the Right Thing:

*) re: compiler/9876: compiled code runs backwards
*) serial-port/1234: cannot process frosted flakes

but these subjects all do the Wrong Thing (create new PR, instead of
appending):

*) Re: FW: sw-kern-sanders/16543: kernel panic on gunshot
*) PR 12345
*) Fw: sw-rip-vnwnkl/10795: The routing subsystem is asleep
*) RE: 2001-0821-021: hw-pr0n/16413 FPC shows pictures of naked ladies
on reboot

(basically, anything in front of the category that's not "re:" bombs.)

i believe that the current behavior violates the principle of least 
surprise -- if i send a message to bugs with a subject "re: fw: 
sw-foo/1234", i expect that gnats will append it to PR 1234.  opening a 
new PR is *not* what i intend.

solution:
it's not clear to me why the regex is so restrictive.  i think it would 
make more sense for gnats to assume that any message with a parseable PR

identifier (<category>/<pr_num>) in the subject should be appended to 
that PR.  that would allow for all the real-world messages to be 
processed in a manner that would not surprise the sender.

furthermore, i think it should also accept "PR<pr_num>", if it is the 
first reasonable text in the subject, a regex along the lines of "^[ 
\t]*((re|fw):)?[ \t]*pr([0-9]+)".  i often see bogus PRs with this 
synopsis, which were clearly intended to be part of <pr_num>, not 
separate PRs.  however, this would be a more extreme change, and might
have unforseen consequences...

does anyone see a reason to keep the restrictive regex?

--
Dirk Bergstrom               dirk@juniper.net
_____________________________________________
Juniper Networks Inc.,          Computer Geek
Tel: 707.433.0564           Fax: 707.433.0769

> -----Original Message-----
> From: Milan Zamazal [mailto:pdm@zamazal.org]
> Sent: Saturday, December 08, 2001 3:23 PM
> To: Michael Richardson
> Cc: help-gnats@gnu.org
> Subject: Re: Subject line processing in Gnats 4.0
> 
> 
> >>>>> "MR" == Michael Richardson <mcr@sandelman.ottawa.on.ca> writes:
> 
>     MR>   Following the code through, it calls sends SUBM to the
>     MR> server... and there is some heuristic in the gnatsd that sees
>     MR> the subject line. And this has worked... sometimes. 
> But I have a
>     MR> number of times it hasn't worked, and new PRs were created. I
>     MR> can share them if this isn't a known problem.
> 
> The problem is not known to me.  Please provide me with the details.
> 
> Thanks,
> 
> Milan Zamazal
> 
> -- 
> It's amazing how much better you feel once you've given up hope.
>                                                 (unknown source)
> 
> _______________________________________________
> Help-gnats mailing list
> Help-gnats@gnu.org
> http://mail.gnu.org/mailman/listinfo/help-gnats
> 

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

^ permalink raw reply	[flat|nested] 34+ messages in thread
* Subject line processing in Gnats 4.0
@ 2001-10-28 13:34 Michael Richardson
  2001-10-29 17:36 ` Milan Zamazal
  2001-12-07 14:27 ` Michael Richardson
  0 siblings, 2 replies; 34+ messages in thread
From: Michael Richardson @ 2001-10-28 13:34 UTC (permalink / raw)
  To: help-gnats


  In Gnats 3.0, one can append to a PR by sending email to gnats with the
category/XX PR number in the subject line. This just creates new PRs.

  Following the code through, it calls sends SUBM to the server... and there
is some heuristic in the gnatsd that sees the subject line. And this has
worked... sometimes. But I have a number of times it hasn't worked, and new
PRs were created. I can share them if this isn't a known problem.

]       ON HUMILITY: to err is human. To moo, bovine.           |  firewalls  [
]   Michael Richardson, Sandelman Software Works, Ottawa, ON    |net architect[
] mcr@sandelman.ottawa.on.ca http://www.sandelman.ottawa.on.ca/ |device driver[
] panic("Just another NetBSD/notebook using, kernel hacking, security guy");  [

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

^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2001-12-23 20:36 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-02  5:49 Subject line processing in Gnats 4.0 Dirk Bergstrom
2001-11-03  1:41 ` Paul Traina
2001-12-13  9:50   ` Paul Traina
2001-11-06  5:19 ` Milan Zamazal
2001-12-13 14:39   ` Milan Zamazal
2001-12-12 14:20 ` Dirk Bergstrom
  -- strict thread matches above, loose matches on Subject: below --
2001-11-06  5:58 Dirk Bergstrom
2001-11-09 14:17 ` Milan Zamazal
2001-11-19  0:36   ` Milan Zamazal
2001-12-23 12:36     ` Milan Zamazal
2001-12-15  7:24   ` Milan Zamazal
2001-12-13 15:09 ` Dirk Bergstrom
2001-11-01 15:18 Dirk Bergstrom
2001-12-12 13:03 ` Dirk Bergstrom
2001-11-01  7:16 Dirk Bergstrom
2001-11-01  7:18 ` Paul Traina
2001-11-01 14:36   ` Michael Richardson
2001-12-12 11:55     ` Michael Richardson
2001-12-11 21:45   ` Paul Traina
2001-11-02  5:50 ` Milan Zamazal
2001-11-02  5:57   ` Michael Richardson
2001-12-12 15:43     ` Michael Richardson
2001-11-04  0:17   ` Yngve Svendsen
2001-12-13 12:30     ` Yngve Svendsen
2001-11-06  7:43   ` Chad C. Walstrom
2001-11-10  8:07     ` Milan Zamazal
2001-12-15  7:24       ` Milan Zamazal
2001-12-13 21:36     ` Chad C. Walstrom
2001-12-12 15:06   ` Milan Zamazal
2001-12-11 18:12 ` Dirk Bergstrom
2001-10-28 13:34 Michael Richardson
2001-10-29 17:36 ` Milan Zamazal
2001-12-09  6:33   ` Milan Zamazal
2001-12-07 14:27 ` Michael Richardson

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).