@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Remove dead "Service Lock" code from Almanac

Summary:
Depends on D19315. Ref T13120. Ref T12414. See PHI145. See PHI473. I want to move Almanac services to ModularTransactions but ran into this old piece of dead/unused code along the way.

Long ago, Almanac services could be individually "locked", but this didn't really work out very well. It was replaced by "Can Manage Cluster Services" in D15339 and prior changes, but not all of the old "Lock" code got cleaned up.

I don't expect to restore this feature, so clean it up now.

Test Plan:
- Grepped for `AlmanacServiceTransaction::TYPE_LOCK`, `TYPE_LOCK`, etc.
- Grepped for `updateServiceLock()`, no callsites.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13120, T12414

Differential Revision: https://secure.phabricator.com/D19316

-28
-16
src/applications/almanac/management/AlmanacManagementWorkflow.php
··· 26 26 return $services; 27 27 } 28 28 29 - protected function updateServiceLock(AlmanacService $service, $lock) { 30 - $almanac_phid = id(new PhabricatorAlmanacApplication())->getPHID(); 31 - 32 - $xaction = id(new AlmanacServiceTransaction()) 33 - ->setTransactionType(AlmanacServiceTransaction::TYPE_LOCK) 34 - ->setNewValue((int)$lock); 35 - 36 - $editor = id(new AlmanacServiceEditor()) 37 - ->setActor($this->getViewer()) 38 - ->setActingAsPHID($almanac_phid) 39 - ->setContentSource($this->newContentSource()) 40 - ->setContinueOnMissingFields(true); 41 - 42 - $editor->applyTransactions($service, array($xaction)); 43 - } 44 - 45 29 }
-12
src/applications/almanac/storage/AlmanacServiceTransaction.php
··· 4 4 extends AlmanacTransaction { 5 5 6 6 const TYPE_NAME = 'almanac:service:name'; 7 - const TYPE_LOCK = 'almanac:service:lock'; 8 7 9 8 public function getApplicationTransactionType() { 10 9 return AlmanacServicePHIDType::TYPECONST; ··· 28 27 $this->renderHandleLink($author_phid), 29 28 $old, 30 29 $new); 31 - } 32 - break; 33 - case self::TYPE_LOCK: 34 - if ($new) { 35 - return pht( 36 - '%s locked this service.', 37 - $this->renderHandleLink($author_phid)); 38 - } else { 39 - return pht( 40 - '%s unlocked this service.', 41 - $this->renderHandleLink($author_phid)); 42 30 } 43 31 break; 44 32 }