mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-25 16:22:42 +01:00
Provide a hook for aborted workflow
Summary: We start Sandcastle push when `arc diff` starts. If `arc diff` throws then HHVM waits for finishing the futures. We need to kill them sooner. Test Plan: Will implement the hook. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D3713
This commit is contained in:
parent
47a036a535
commit
1b51b74135
2 changed files with 24 additions and 14 deletions
|
@ -319,25 +319,27 @@ try {
|
||||||
$config->didRunWorkflow($command, $workflow, $err);
|
$config->didRunWorkflow($command, $workflow, $err);
|
||||||
exit((int)$err);
|
exit((int)$err);
|
||||||
|
|
||||||
} catch (ArcanistUsageException $ex) {
|
} catch (Exception $ex) {
|
||||||
|
$is_usage = ($ex instanceof ArcanistUsageException);
|
||||||
|
if ($is_usage) {
|
||||||
echo phutil_console_format(
|
echo phutil_console_format(
|
||||||
"**Usage Exception:** %s\n",
|
"**Usage Exception:** %s\n",
|
||||||
$ex->getMessage());
|
$ex->getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
$config->didAbortWorkflow($command, $workflow, $ex);
|
||||||
|
|
||||||
if ($config_trace_mode) {
|
if ($config_trace_mode) {
|
||||||
echo "\n";
|
echo "\n";
|
||||||
throw $ex;
|
throw $ex;
|
||||||
}
|
}
|
||||||
|
|
||||||
exit(1);
|
if (!$is_usage) {
|
||||||
} catch (Exception $ex) {
|
|
||||||
if ($config_trace_mode) {
|
|
||||||
throw $ex;
|
|
||||||
}
|
|
||||||
|
|
||||||
echo phutil_console_format(
|
echo phutil_console_format(
|
||||||
"**Exception**\n%s\n%s\n",
|
"**Exception**\n%s\n%s\n",
|
||||||
$ex->getMessage(),
|
$ex->getMessage(),
|
||||||
"(Run with --trace for a full exception trace.)");
|
"(Run with --trace for a full exception trace.)");
|
||||||
|
}
|
||||||
|
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
* - create, replace, or disable workflows by overriding buildWorkflow()
|
* - create, replace, or disable workflows by overriding buildWorkflow()
|
||||||
* and buildAllWorkflows();
|
* and buildAllWorkflows();
|
||||||
* - add additional steps before or after workflows run by overriding
|
* - add additional steps before or after workflows run by overriding
|
||||||
* willRunWorkflow() or didRunWorkflow(); and
|
* willRunWorkflow() or didRunWorkflow() or didAbortWorkflow(); and
|
||||||
* - add new flags to existing workflows by overriding
|
* - add new flags to existing workflows by overriding
|
||||||
* getCustomArgumentsForCommand().
|
* getCustomArgumentsForCommand().
|
||||||
*
|
*
|
||||||
|
@ -93,6 +93,14 @@ class ArcanistConfiguration {
|
||||||
// This is a hook.
|
// This is a hook.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function didAbortWorkflow(
|
||||||
|
$command,
|
||||||
|
ArcanistBaseWorkflow $workflow,
|
||||||
|
Exception $ex) {
|
||||||
|
|
||||||
|
// This is a hook.
|
||||||
|
}
|
||||||
|
|
||||||
public function getCustomArgumentsForCommand($command) {
|
public function getCustomArgumentsForCommand($command) {
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue