mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-30 01:10:58 +01:00
Add dependencies to releeph
Summary: Add the 'Depends On' field to releeph requests. This will help the release engineers to be aware of the dependencies and make sure pick them altogether. Test Plan: Check sandbox. This field shows up when a revision has some dependencies. Reviewers: JoelB, lifeihuang, epriestley, #blessed_reviewers Reviewed By: epriestley CC: Korvin, epriestley, aran Differential Revision: https://secure.phabricator.com/D7946
This commit is contained in:
parent
6cc5f952a4
commit
60a6ba2b25
3 changed files with 50 additions and 0 deletions
|
@ -2359,6 +2359,7 @@ phutil_register_library_map(array(
|
|||
'ReleephDAO' => 'applications/releeph/storage/ReleephDAO.php',
|
||||
'ReleephDefaultFieldSelector' => 'applications/releeph/field/selector/ReleephDefaultFieldSelector.php',
|
||||
'ReleephDefaultUserView' => 'applications/releeph/view/user/ReleephDefaultUserView.php',
|
||||
'ReleephDependsOnFieldSpecification' => 'applications/releeph/field/specification/ReleephDependsOnFieldSpecification.php',
|
||||
'ReleephDiffChurnFieldSpecification' => 'applications/releeph/field/specification/ReleephDiffChurnFieldSpecification.php',
|
||||
'ReleephDiffMessageFieldSpecification' => 'applications/releeph/field/specification/ReleephDiffMessageFieldSpecification.php',
|
||||
'ReleephDiffSizeFieldSpecification' => 'applications/releeph/field/specification/ReleephDiffSizeFieldSpecification.php',
|
||||
|
@ -5109,6 +5110,7 @@ phutil_register_library_map(array(
|
|||
'ReleephDAO' => 'PhabricatorLiskDAO',
|
||||
'ReleephDefaultFieldSelector' => 'ReleephFieldSelector',
|
||||
'ReleephDefaultUserView' => 'ReleephUserView',
|
||||
'ReleephDependsOnFieldSpecification' => 'ReleephFieldSpecification',
|
||||
'ReleephDiffChurnFieldSpecification' => 'ReleephFieldSpecification',
|
||||
'ReleephDiffMessageFieldSpecification' => 'ReleephFieldSpecification',
|
||||
'ReleephDiffSizeFieldSpecification' => 'ReleephFieldSpecification',
|
||||
|
|
|
@ -42,6 +42,7 @@ final class ReleephDefaultFieldSelector extends ReleephFieldSelector {
|
|||
new ReleephBranchCommitFieldSpecification(),
|
||||
new ReleephDiffSizeFieldSpecification(),
|
||||
new ReleephDiffChurnFieldSpecification(),
|
||||
new ReleephDependsOnFieldSpecification(),
|
||||
new ReleephFacebookTagFieldSpecification(),
|
||||
new ReleephFacebookTasksFieldSpecification(),
|
||||
);
|
||||
|
@ -76,6 +77,7 @@ final class ReleephDefaultFieldSelector extends ReleephFieldSelector {
|
|||
'ReleephOriginalCommitFieldSpecification',
|
||||
'ReleephDiffSizeFieldSpecification',
|
||||
'ReleephDiffChurnFieldSpecification',
|
||||
'ReleephDependsOnFieldSpecification',
|
||||
'ReleephFacebookTasksFieldSpecification',
|
||||
)),
|
||||
'right' => self::selectFields($fields, array(
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
|
||||
final class ReleephDependsOnFieldSpecification
|
||||
extends ReleephFieldSpecification {
|
||||
public function getFieldKey() {
|
||||
return 'dependsOn';
|
||||
}
|
||||
|
||||
public function getName() {
|
||||
return pht('Depends On');
|
||||
}
|
||||
|
||||
public function renderValueForHeaderView() {
|
||||
$revision_phids = $this->getDependentRevisionPHIDs();
|
||||
if (!$revision_phids) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$links = array();
|
||||
$handles = id(new PhabricatorHandleQuery())
|
||||
->setViewer($this->getUser())
|
||||
->withPHIDs($revision_phids)
|
||||
->execute();
|
||||
foreach ($revision_phids as $revision_phid) {
|
||||
$links[] = id(clone $handles[$revision_phid])
|
||||
// Hack to remove the strike-through rendering of diff links
|
||||
->setStatus(null)
|
||||
->renderLink();
|
||||
}
|
||||
|
||||
return phutil_implode_html(phutil_tag('br'), $links);
|
||||
}
|
||||
|
||||
private function getDependentRevisionPHIDs() {
|
||||
$revision = $this
|
||||
->getReleephRequest()
|
||||
->loadDifferentialRevision();
|
||||
if (!$revision) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return PhabricatorEdgeQuery::loadDestinationPHIDs(
|
||||
$revision->getPHID(),
|
||||
PhabricatorEdgeConfig::TYPE_DREV_DEPENDS_ON_DREV);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue