Content deleted Content added
Updating published sources: SourceUploader: * Add some debugging and better error handling. |
Updating published sources: AnomieBOT::API: * Only add 'xxlimit' when fetching tokens if the module has an 'xxlimit' parameter. SourceUploader: * Report more useful "Invalid metadata" errors. DatedCategoryDeleterTest: * New userspace-only task to inves... |
||
Line 482:
my $t=$file; $t=~s{^.*/}{}; $t=~s/\.pm$//;
return '99 Invalid metadata (no "Bot")' unless exists($metadata{'bot'});
return '99 Invalid metadata (no/bad "Task")' unless(exists($metadata{'task'}) && $metadata{'task'} eq $t);
return '99 Invalid metadata (no "BRFA")' unless exists($metadata{'brfa'});
return '99 Invalid metadata (no "Status")' unless exists($metadata{'status'});
return '99 Invalid metadata (no/bad "Created")' unless(exists($metadata{'created'}) && $metadata{'created'}=~/^\d{4}-\d\d-\d\d$/);
if(exists($metadata{'+brfa'})){
return '99 Invalid metadata (no "+Status")' unless exists($metadata{'+status'});
return '99 Invalid metadata (mismatched +BRFA/+Status)' if scalar(@{$metadata{'+status'}}) != scalar(@{$metadata{'+brfa'}});
}
if(exists($metadata{'ondemand'})){
return '99 Invalid metadata (bad "OnDemand")' unless($metadata{'ondemand'} eq 'true' || $metadata{'ondemand'} eq 'false');
}
if(exists($metadata{'shutoff'})){
return '99 Invalid metadata (bad "Shutoff")' unless($metadata{'shutoff'} eq 'true' || $metadata{'shutoff'} eq 'false');
}
if(exists($metadata{'exclusion'})){
return '99 Invalid metadata (bad "Exclusion")' unless($metadata{'exclusion'} eq 'true' || $metadata{'exclusion'} eq 'false');
}
my $status=$metadata{'status'};
Line 504:
AnomieBOT::API::load($file);
my $task='tasks::'.$metadata{'task'};
return '99 Invalid metadata (missing "approved" method)' unless $task->can('approved');
my $botnum=$task->approved;
Line 515:
return "01 Current" if $botnum>0;
return "02 On demand" if(exists($metadata{'ondemand'}) && $metadata{'ondemand'} eq 'true');
return '99 Invalid metadata ("Status: Approved" but not running or OnDemand)';
}
return "03 In trial" if($status=~/^In trial/ && $botnum>0);
return '99 Invalid metadata (Running with a non-running Status)' if $botnum>0;
return "04 In development" if($status eq 'Coding' || $status eq 'On hold');
return "06 Past" if $status=~/^(?:Completed|Inactive) \d{4}-\d{2}-\d{2}$/;
return '99 Invalid metadata (bad "BRFA")' if($metadata{'brfa'} eq 'N/A');
return "05 Awaiting approval" if($status eq 'BRFA');
return "07 Withdrawn" if $status eq 'Withdrawn';
return "08 Rejected" if $status=~/^Rejected \d{4}-\d{2}-\d{2}$/;
return '99 Invalid metadata (no match for Status)';
}
|