1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-22 21:40:55 +01:00

Synchronize Asana task and subtask states accurately

Summary:
Ref T2852.

The parent task is open unless the revision is in the states "closed" or "abandoned". If it's in "needs review", it remains open. This last bit is slightly unlike Differential, but consistent with the Google Doc and generally seems like a better fit. There's no way to put the task in a "Waiting on Others" state in Asana like we can in Differential.

The subtasks are closed unless the revision is in the state "needs review". This is generally consistent with Differential.

Test Plan:
Made a series of changes to a revision and synchronized it repeatedly:

  - requested changes
  - commandeered
  - requested review
  - abandoned

Verified task and subtasks synchronized states correctly in Asana.

{F47554}

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2852

Differential Revision: https://secure.phabricator.com/D6304
This commit is contained in:
epriestley 2013-06-25 16:34:59 -07:00
parent 302da70e72
commit c99ebe8402

View file

@ -69,10 +69,21 @@ final class DoorkeeperFeedWorkerAsana extends FeedPushWorker {
$reviewer_phids = $revision->getReviewers();
$cc_phids = $revision->getCCPHIDs();
switch ($revision->getStatus()) {
case ArcanistDifferentialRevisionStatus::NEEDS_REVIEW:
$active_phids = $reviewer_phids;
$passive_phids = array();
break;
default:
$active_phids = array();
$passive_phids = $reviewer_phids;
break;
}
return array(
$author_phid,
$reviewer_phids,
array(),
$active_phids,
$passive_phids,
$cc_phids);
}
@ -90,9 +101,20 @@ final class DoorkeeperFeedWorkerAsana extends FeedPushWorker {
$notes = implode("\n\n", $notes);
switch ($revision->getStatus()) {
case ArcanistDifferentialRevisionStatus::CLOSED:
case ArcanistDifferentialRevisionStatus::ABANDONED:
$is_completed = true;
break;
default:
$is_completed = false;
break;
}
return array(
'name' => $name,
'notes' => $notes,
'completed' => $is_completed,
);
}