Page MenuHomePhabricator

D14341.diff
No OneTemporary

D14341.diff

diff --git a/src/applications/drydock/controller/DrydockRepositoryOperationViewController.php b/src/applications/drydock/controller/DrydockRepositoryOperationViewController.php
--- a/src/applications/drydock/controller/DrydockRepositoryOperationViewController.php
+++ b/src/applications/drydock/controller/DrydockRepositoryOperationViewController.php
@@ -83,6 +83,15 @@
pht('Object'),
$viewer->renderHandle($operation->getObjectPHID()));
+ $lease_phid = $operation->getWorkingCopyLeasePHID();
+ if ($lease_phid) {
+ $lease_display = $viewer->renderHandle($lease_phid);
+ } else {
+ $lease_display = phutil_tag('em', array(), pht('None'));
+ }
+
+ $view->addProperty(pht('Working Copy'), $lease_display);
+
return $view;
}
diff --git a/src/applications/drydock/storage/DrydockLease.php b/src/applications/drydock/storage/DrydockLease.php
--- a/src/applications/drydock/storage/DrydockLease.php
+++ b/src/applications/drydock/storage/DrydockLease.php
@@ -429,10 +429,7 @@
$this->scheduleUpdate($expires);
}
- $awaken_ids = $this->getAttribute('internal.awakenTaskIDs');
- if (is_array($awaken_ids) && $awaken_ids) {
- PhabricatorWorker::awakenTaskIDs($awaken_ids);
- }
+ $this->awakenTasks();
}
public function logEvent($type, array $data = array()) {
@@ -454,6 +451,19 @@
return $log->save();
}
+ /**
+ * Awaken yielded tasks after a state change.
+ *
+ * @return this
+ */
+ public function awakenTasks() {
+ $awaken_ids = $this->getAttribute('internal.awakenTaskIDs');
+ if (is_array($awaken_ids) && $awaken_ids) {
+ PhabricatorWorker::awakenTaskIDs($awaken_ids);
+ }
+
+ return $this;
+ }
/* -( PhabricatorPolicyInterface )----------------------------------------- */
diff --git a/src/applications/drydock/storage/DrydockRepositoryOperation.php b/src/applications/drydock/storage/DrydockRepositoryOperation.php
--- a/src/applications/drydock/storage/DrydockRepositoryOperation.php
+++ b/src/applications/drydock/storage/DrydockRepositoryOperation.php
@@ -167,6 +167,15 @@
$this);
}
+ public function setWorkingCopyLeasePHID($lease_phid) {
+ return $this->setProperty('exec.leasePHID', $lease_phid);
+ }
+
+ public function getWorkingCopyLeasePHID() {
+ return $this->getProperty('exec.leasePHID');
+ }
+
+
/* -( PhabricatorPolicyInterface )----------------------------------------- */
diff --git a/src/applications/drydock/worker/DrydockLeaseUpdateWorker.php b/src/applications/drydock/worker/DrydockLeaseUpdateWorker.php
--- a/src/applications/drydock/worker/DrydockLeaseUpdateWorker.php
+++ b/src/applications/drydock/worker/DrydockLeaseUpdateWorker.php
@@ -751,6 +751,15 @@
->setStatus(DrydockLeaseStatus::STATUS_BROKEN)
->save();
+ $lease->logEvent(
+ DrydockLeaseActivationFailureLogType::LOGCONST,
+ array(
+ 'class' => get_class($ex),
+ 'message' => $ex->getMessage(),
+ ));
+
+ $lease->awakenTasks();
+
$this->queueTask(
__CLASS__,
array(
@@ -760,13 +769,6 @@
'objectPHID' => $lease->getPHID(),
));
- $lease->logEvent(
- DrydockLeaseActivationFailureLogType::LOGCONST,
- array(
- 'class' => get_class($ex),
- 'message' => $ex->getMessage(),
- ));
-
throw new PhabricatorWorkerPermanentFailureException(
pht(
'Permanent failure while activating lease ("%s"): %s',
@@ -796,6 +798,8 @@
->save();
$lease->logEvent(DrydockLeaseDestroyedLogType::LOGCONST);
+
+ $lease->awakenTasks();
}
}
diff --git a/src/applications/drydock/worker/DrydockRepositoryOperationUpdateWorker.php b/src/applications/drydock/worker/DrydockRepositoryOperationUpdateWorker.php
--- a/src/applications/drydock/worker/DrydockRepositoryOperationUpdateWorker.php
+++ b/src/applications/drydock/worker/DrydockRepositoryOperationUpdateWorker.php
@@ -127,7 +127,7 @@
}
$operation
- ->setProperty('exec.leasePHID', $lease->getPHID())
+ ->setWorkingCopyLeasePHID($lease->getPHID())
->save();
$lease->queueForActivation();

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 10, 10:21 AM (1 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6716312
Default Alt Text
D14341.diff (4 KB)

Event Timeline