Closed Bug 11344 Opened 21 years ago Closed 20 years ago

Patch for mozbot to return sheriff information

Categories

(Webtools Graveyard :: Mozbot, enhancement, P3)

Other
Other
enhancement

Tracking

(Not tracked)

VERIFIED WONTFIX

People

(Reporter: wsargent, Assigned: terry)

Details

Index: mozbot.pl
===================================================================
RCS file: h:\mozilla-src/mozilla/webtools/mozbot/mozbot.pl,v
retrieving revision 1.39
diff -r1.39 mozbot.pl
72a73,74
>                "sheriff" => \&bot_sheriff,
>                "deputize" => \&bot_deputize,
124a127,131
> # read sheriff list (in case mozbot dies)
> my %sheriffs;
> my $sheriff_file = ".sheriffs"
> &fetch_sheriff_conf (\%sheriff_conf);
>
819a827,884
> # write sheriff list
>
> sub store_sheriff_conf
> 	{
> 	my $sheriffs = shift;
> 	my $when = localtime (time) . " by $$";
>
> 	if (open SHERIFFS, ">$sheriff_file")
> 		{
> 		print SHERIFFS <<FIN;
> # mozbot sheriff list file
> #
> # this file is generated. do not edit.
> # generated $when
> #
> # version: 1.0
>
> FIN
>
> 		foreach (sort keys %sheriffs)
> 			{
> 			print SHERIFFS "$_ $sheriffs{$_}\n";
> 			}
> 		close SHERIFFS;
> 		}
> 	else
> 		{
> 		&debug ("&store_sheriff_conf $sheriff_file: $!");
> 		}
> 	}
>
>
> # fetch list of admins
>
> sub fetch_sheriff_conf
> {
>     my $sheriffs = shift;
>
>     if (open SHERIFFS, $sheriff_file)
>     {
>         while (<SHERIFFS>)
>         {
>             chomp;
>             next if ($_ =~ /^#/ or ! $_);
>                      my ($user, $host) = split /\s+/, $_;
>                      $$sheriffs{$user} = $host;
>                  }
>             &debug ("sheriffs: " . keys %$sheriffs);
>         }
> 	else
>         {
>             &debug ("&fetch_sheriff_conf $sheriff_file: $!");
>         }
>
> 	close SHERIFFS;
>     }
> }
>
848,849c913,914
<     if ($output =~ m@<channel>(.*)</channel>@si) {
<         $channelpart = $1;
---
>     if ($output =~ s@<channel>.*</channel>@@si) {
>         $channelpart = $&;
863,864c928,929
<     while ($output =~ m@<item>(.*?)<title>(.+?)</title>(.*?)</item>@sig) {
<         push(@list, $2);
---
>     while ($output =~ m@<title>(.+?)</title>@sig) {
>         push(@list, $1);
1063a1129,1155
> }
>
> sub bot_deputize {
>     my ($nick, $cmd, $rest) = (@_);
>
>     my ($who, $where) = split(' ', $rest);
>     if (! $who or ! $where) {
>         sendmsg($nick, "usage: deputize [ user ] [ host ] " .
>                 "(example: deputize marca netscape.com)");
>         return;
>     }
>     $sheriffs{$who} = $where;
>     &debug ("$nick deputized $who ($where)");
>     &store_sheriff_conf (\%sheriffs);
>     sendmsg($nick, "sheriffs: " . join ' ', (sort keys %sheriffs));
> }
>
> sub bot_sheriff {
>     my ($nick, $cmd, $rest) = (@_);
>
>     my @list;
>     foreach (sort keys %sheriffs) {
>         push(@list, "$_ $sheriffs{$_}");
>     }
>     my $spacer = " ... ";
>     saylongline($nick, join($spacer, @list), $spacer);
>
Status: NEW → ASSIGNED
mozbot is currently running code that returns sheriff information based on the
tinderbox page for each tree (since each tree can have a different sheriff).

mozbot2 has a module based on the mozbot1 code for sheriff reporting.

Should we therefore mark this patch WONTFIX? (i.e., we are not taking this
patch since we have alternative versions that are more automatic?)
Keywords: patch
Marking WONTFIX as the techbots currently have sheriff capability.
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → WONTFIX
Verified
Status: RESOLVED → VERIFIED
QA Contact: mozbot
Product: Webtools → Webtools Graveyard
You need to log in before you can comment on or make changes to this bug.