add label event, debugging for mass rebuild filtering

This commit is contained in:
Graham Christensen 2017-11-12 14:46:31 -05:00
parent 06dff2fe72
commit aa8840159b
No known key found for this signature in database
GPG key ID: ACA1C1D120C83D5C
2 changed files with 12 additions and 1 deletions

View file

@ -33,6 +33,7 @@ function outrunner($msg) {
} }
function runner($msg) { function runner($msg) {
echo "Msg Sha: " . md5($msg->body) . "\n";
$in = json_decode($msg->body); $in = json_decode($msg->body);
try { try {
@ -92,7 +93,7 @@ function runner($msg) {
$msg->delivery_info['channel']->basic_ack($msg->delivery_info['delivery_tag']); $msg->delivery_info['channel']->basic_ack($msg->delivery_info['delivery_tag']);
return true; return true;
} else { } else {
echo "so-called interesting event: " . $in->action . "\n"; echo "so-called interesting event on #" . $in->number . ": " . $in->action . "\n";
} }
$forward = [ $forward = [

View file

@ -64,6 +64,10 @@ class EventClassifier {
return "project_column"; return "project_column";
} }
if (self::isLabelEvent($payload)) {
return "label";
}
throw new EventClassifierUnknownException(); throw new EventClassifierUnknownException();
} }
@ -169,6 +173,12 @@ class EventClassifier {
return isset($payload->project_column); return isset($payload->project_column);
} }
public static function isLabelEvent($payload) {
return isset($payload->label)
&& isset($payload->action)
&& in_array($payload->action,
['created', 'edited', 'deleted']);
}
} }