1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-12-23 14:00:55 +01:00

Don't fail lint builds for "advice"; make lint/unit upload failures louder

Summary:
Ref T8670. Ref T8657.

  - When lint only has advice (no warnings/errors), consider it a "passing" build.
  - Be a little louder about `sendmessage` calls failing because this stuff is not totally broken and that makes T8670-related things easier to catch/fix.

Test Plan: Created this revision.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T8657, T8670

Differential Revision: https://secure.phabricator.com/D13436
This commit is contained in:
epriestley 2015-06-25 10:05:54 -07:00
parent 5466451b76
commit 29839e8c72

View file

@ -2734,12 +2734,24 @@ EOTEXT
$lint[$key] = $this->getModernLintDictionary($message);
}
// Consider this target to have failed if there are any unresolved
// errors or warnings.
$type = 'pass';
foreach ($lint as $message) {
switch (idx($message, 'severity')) {
case ArcanistLintSeverity::SEVERITY_WARNING:
case ArcanistLintSeverity::SEVERITY_ERROR:
$type = 'fail';
break;
}
}
$futures[] = $this->getConduit()->callMethod(
'harbormaster.sendmessage',
array(
'buildTargetPHID' => $lint_target,
'lint' => array_values($lint),
'type' => $lint ? 'fail' : 'pass',
'type' => $type,
));
}
@ -2775,6 +2787,9 @@ EOTEXT
}
return true;
} catch (Exception $ex) {
// TODO: Eventually, we should expect these to succeed if we get this
// far, but just log errors for now.
phlog($ex);
return false;
}
}