BUG: no_tickets option in rt-shredder Users misses Cc people

rt-shredder --plugin help-Users
(snip)
no_tickets - boolean

 If true then plugin looks for users who are not watchers (Owners,
 Requestors, Ccs or AdminCcs) of any ticket.

Well, using the following command gets me thousands of results:

rt-shredder --plugin  

“Users=no_tickets;status,any;replace_relations,Nobody;limit,10000” –
sqldump /u/rtweb/shredder-restore-users.sql

Investigating these users, I find that all of them are Ccs of tickets,
but are not Requestors of any tickets. This seems to conflict with
both the documentation for the option, and the expected result.

Jo Rhett
Net Consonance : consonant endings by net philanthropy, open source
and other randomness

So I’ve been chasing this bug around in the code for over an hour, and
all I can say at this point is I REALLY HATE GLOBAL VARIABLES.

There is absolutely no reason for having subroutines modify global
variables, and it makes the code darn hard to debug. If I was to do
the work to make all of these modules strict, would you accept the
patches?On Jun 2, 2009, at 12:25 PM, Jo Rhett wrote:

rt-shredder --plugin help-Users
(snip)
no_tickets - boolean

If true then plugin looks for users who are not watchers (Owners,
Requestors, Ccs or AdminCcs) of any ticket.

Well, using the following command gets me thousands of results:

rt-shredder --plugin
“Users=no_tickets;status,any;replace_relations,Nobody;limit,10000” –
sqldump /u/rtweb/shredder-restore-users.sql

Investigating these users, I find that all of them are Ccs of
tickets, but are not Requestors of any tickets. This seems to
conflict with both the documentation for the option, and the
expected result.


Jo Rhett
Net Consonance : consonant endings by net philanthropy, open source
and other randomness

Jo Rhett
Net Consonance : consonant endings by net philanthropy, open source
and other randomness

I found the bug. It’s a documentation bug mostly – the no_tickets
option is listed as binary, which said to me no value should be
provided. However, if you don’t define a value (like quoted below)
then it doesn’t work.

This code change would allow it to be used either way:

— Users.pm_orig 2009-06-02 12:28:24.000000000 -0700
+++ Users.pm 2009-06-02 14:25:26.000000000 -0700
@@ -165,7 +165,7 @@
);
}

  • if( $self->{‘opt’}{‘no_tickets’} ) {
  • if( exists $self->{‘opt’}{‘no_tickets’} ) {
    return $self->FilterWithoutTickets(
    Shredder => $args{‘Shredder’},
    Objects => $objs,On Jun 2, 2009, at 12:25 PM, Jo Rhett wrote:

rt-shredder --plugin help-Users
(snip)
no_tickets - boolean

If true then plugin looks for users who are not watchers (Owners,
Requestors, Ccs or AdminCcs) of any ticket.

Well, using the following command gets me thousands of results:

rt-shredder --plugin
“Users=no_tickets;status,any;replace_relations,Nobody;limit,10000” –
sqldump /u/rtweb/shredder-restore-users.sql

Investigating these users, I find that all of them are Ccs of
tickets, but are not Requestors of any tickets. This seems to
conflict with both the documentation for the option, and the
expected result.


Jo Rhett
Net Consonance : consonant endings by net philanthropy, open source
and other randomness

Jo Rhett
Net Consonance : consonant endings by net philanthropy, open source
and other randomness

1 Like

Thank you, looks that the bug or wrongly documentation is still existing. Just tried it out and no_tickets deleted my (on a test data) users as owners and watchers (CC)…