Add Phrequent workflows to Arcanist
Summary:
Depends on D9906.
This adds `arc start`, `arc stop` and `arc tracking` for tracking tasks, diffs and other objects in Phrequent.
Test Plan: Tested this against a local install.
Reviewers: skyronic, #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: maxhodak, hach-que, aran, epriestley, Korvin
Maniphest Tasks: T3569, T3969
Differential Revision: https://secure.phabricator.com/D7327
2014-07-17 03:58:22 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
2015-02-01 01:58:18 +01:00
|
|
|
* Start time tracking on an object.
|
Add Phrequent workflows to Arcanist
Summary:
Depends on D9906.
This adds `arc start`, `arc stop` and `arc tracking` for tracking tasks, diffs and other objects in Phrequent.
Test Plan: Tested this against a local install.
Reviewers: skyronic, #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: maxhodak, hach-que, aran, epriestley, Korvin
Maniphest Tasks: T3569, T3969
Differential Revision: https://secure.phabricator.com/D7327
2014-07-17 03:58:22 +02:00
|
|
|
*/
|
|
|
|
final class ArcanistStartWorkflow extends ArcanistPhrequentWorkflow {
|
|
|
|
|
|
|
|
public function getWorkflowName() {
|
|
|
|
return 'start';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getCommandSynopses() {
|
|
|
|
return phutil_console_format(<<<EOTEXT
|
|
|
|
**start** __object__
|
|
|
|
EOTEXT
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getCommandHelp() {
|
|
|
|
return phutil_console_format(<<<EOTEXT
|
2015-02-01 01:58:18 +01:00
|
|
|
Start tracking work in Phrequent.
|
Add Phrequent workflows to Arcanist
Summary:
Depends on D9906.
This adds `arc start`, `arc stop` and `arc tracking` for tracking tasks, diffs and other objects in Phrequent.
Test Plan: Tested this against a local install.
Reviewers: skyronic, #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: maxhodak, hach-que, aran, epriestley, Korvin
Maniphest Tasks: T3569, T3969
Differential Revision: https://secure.phabricator.com/D7327
2014-07-17 03:58:22 +02:00
|
|
|
EOTEXT
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function requiresConduit() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function requiresAuthentication() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getArguments() {
|
|
|
|
return array(
|
|
|
|
'*' => 'name',
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function run() {
|
|
|
|
$conduit = $this->getConduit();
|
|
|
|
|
|
|
|
$started_phids = array();
|
|
|
|
$short_name = $this->getArgument('name');
|
2015-02-01 01:58:18 +01:00
|
|
|
|
Add Phrequent workflows to Arcanist
Summary:
Depends on D9906.
This adds `arc start`, `arc stop` and `arc tracking` for tracking tasks, diffs and other objects in Phrequent.
Test Plan: Tested this against a local install.
Reviewers: skyronic, #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: maxhodak, hach-que, aran, epriestley, Korvin
Maniphest Tasks: T3569, T3969
Differential Revision: https://secure.phabricator.com/D7327
2014-07-17 03:58:22 +02:00
|
|
|
foreach ($short_name as $object_name) {
|
|
|
|
$object_lookup = $conduit->callMethodSynchronous(
|
|
|
|
'phid.lookup',
|
|
|
|
array(
|
|
|
|
'names' => array($object_name),
|
|
|
|
));
|
|
|
|
|
|
|
|
if (!array_key_exists($object_name, $object_lookup)) {
|
2015-02-01 01:58:18 +01:00
|
|
|
echo phutil_console_format(
|
|
|
|
"%s\n",
|
|
|
|
pht("No such object '%s' found.", $object_name));
|
Add Phrequent workflows to Arcanist
Summary:
Depends on D9906.
This adds `arc start`, `arc stop` and `arc tracking` for tracking tasks, diffs and other objects in Phrequent.
Test Plan: Tested this against a local install.
Reviewers: skyronic, #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: maxhodak, hach-que, aran, epriestley, Korvin
Maniphest Tasks: T3569, T3969
Differential Revision: https://secure.phabricator.com/D7327
2014-07-17 03:58:22 +02:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
$object_phid = $object_lookup[$object_name]['phid'];
|
|
|
|
|
|
|
|
$started_phids[] = $conduit->callMethodSynchronous(
|
|
|
|
'phrequent.push',
|
|
|
|
array(
|
2014-09-27 02:21:23 +02:00
|
|
|
'objectPHID' => $object_phid,
|
Add Phrequent workflows to Arcanist
Summary:
Depends on D9906.
This adds `arc start`, `arc stop` and `arc tracking` for tracking tasks, diffs and other objects in Phrequent.
Test Plan: Tested this against a local install.
Reviewers: skyronic, #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: maxhodak, hach-que, aran, epriestley, Korvin
Maniphest Tasks: T3569, T3969
Differential Revision: https://secure.phabricator.com/D7327
2014-07-17 03:58:22 +02:00
|
|
|
));
|
|
|
|
}
|
|
|
|
|
|
|
|
$phid_query = $conduit->callMethodSynchronous(
|
|
|
|
'phid.query',
|
|
|
|
array(
|
|
|
|
'phids' => $started_phids,
|
|
|
|
));
|
|
|
|
|
|
|
|
echo phutil_console_format(
|
2015-02-01 01:58:18 +01:00
|
|
|
"%s: %s\n\n",
|
|
|
|
pht('Started'),
|
|
|
|
implode(', ', ipull($phid_query, 'fullName')));
|
2017-02-16 14:54:43 +01:00
|
|
|
$this->printCurrentTracking();
|
Add Phrequent workflows to Arcanist
Summary:
Depends on D9906.
This adds `arc start`, `arc stop` and `arc tracking` for tracking tasks, diffs and other objects in Phrequent.
Test Plan: Tested this against a local install.
Reviewers: skyronic, #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: maxhodak, hach-que, aran, epriestley, Korvin
Maniphest Tasks: T3569, T3969
Differential Revision: https://secure.phabricator.com/D7327
2014-07-17 03:58:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|