mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-04 11:51:02 +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',
|
'ReleephDAO' => 'applications/releeph/storage/ReleephDAO.php',
|
||||||
'ReleephDefaultFieldSelector' => 'applications/releeph/field/selector/ReleephDefaultFieldSelector.php',
|
'ReleephDefaultFieldSelector' => 'applications/releeph/field/selector/ReleephDefaultFieldSelector.php',
|
||||||
'ReleephDefaultUserView' => 'applications/releeph/view/user/ReleephDefaultUserView.php',
|
'ReleephDefaultUserView' => 'applications/releeph/view/user/ReleephDefaultUserView.php',
|
||||||
|
'ReleephDependsOnFieldSpecification' => 'applications/releeph/field/specification/ReleephDependsOnFieldSpecification.php',
|
||||||
'ReleephDiffChurnFieldSpecification' => 'applications/releeph/field/specification/ReleephDiffChurnFieldSpecification.php',
|
'ReleephDiffChurnFieldSpecification' => 'applications/releeph/field/specification/ReleephDiffChurnFieldSpecification.php',
|
||||||
'ReleephDiffMessageFieldSpecification' => 'applications/releeph/field/specification/ReleephDiffMessageFieldSpecification.php',
|
'ReleephDiffMessageFieldSpecification' => 'applications/releeph/field/specification/ReleephDiffMessageFieldSpecification.php',
|
||||||
'ReleephDiffSizeFieldSpecification' => 'applications/releeph/field/specification/ReleephDiffSizeFieldSpecification.php',
|
'ReleephDiffSizeFieldSpecification' => 'applications/releeph/field/specification/ReleephDiffSizeFieldSpecification.php',
|
||||||
|
@ -5109,6 +5110,7 @@ phutil_register_library_map(array(
|
||||||
'ReleephDAO' => 'PhabricatorLiskDAO',
|
'ReleephDAO' => 'PhabricatorLiskDAO',
|
||||||
'ReleephDefaultFieldSelector' => 'ReleephFieldSelector',
|
'ReleephDefaultFieldSelector' => 'ReleephFieldSelector',
|
||||||
'ReleephDefaultUserView' => 'ReleephUserView',
|
'ReleephDefaultUserView' => 'ReleephUserView',
|
||||||
|
'ReleephDependsOnFieldSpecification' => 'ReleephFieldSpecification',
|
||||||
'ReleephDiffChurnFieldSpecification' => 'ReleephFieldSpecification',
|
'ReleephDiffChurnFieldSpecification' => 'ReleephFieldSpecification',
|
||||||
'ReleephDiffMessageFieldSpecification' => 'ReleephFieldSpecification',
|
'ReleephDiffMessageFieldSpecification' => 'ReleephFieldSpecification',
|
||||||
'ReleephDiffSizeFieldSpecification' => 'ReleephFieldSpecification',
|
'ReleephDiffSizeFieldSpecification' => 'ReleephFieldSpecification',
|
||||||
|
|
|
@ -42,6 +42,7 @@ final class ReleephDefaultFieldSelector extends ReleephFieldSelector {
|
||||||
new ReleephBranchCommitFieldSpecification(),
|
new ReleephBranchCommitFieldSpecification(),
|
||||||
new ReleephDiffSizeFieldSpecification(),
|
new ReleephDiffSizeFieldSpecification(),
|
||||||
new ReleephDiffChurnFieldSpecification(),
|
new ReleephDiffChurnFieldSpecification(),
|
||||||
|
new ReleephDependsOnFieldSpecification(),
|
||||||
new ReleephFacebookTagFieldSpecification(),
|
new ReleephFacebookTagFieldSpecification(),
|
||||||
new ReleephFacebookTasksFieldSpecification(),
|
new ReleephFacebookTasksFieldSpecification(),
|
||||||
);
|
);
|
||||||
|
@ -76,6 +77,7 @@ final class ReleephDefaultFieldSelector extends ReleephFieldSelector {
|
||||||
'ReleephOriginalCommitFieldSpecification',
|
'ReleephOriginalCommitFieldSpecification',
|
||||||
'ReleephDiffSizeFieldSpecification',
|
'ReleephDiffSizeFieldSpecification',
|
||||||
'ReleephDiffChurnFieldSpecification',
|
'ReleephDiffChurnFieldSpecification',
|
||||||
|
'ReleephDependsOnFieldSpecification',
|
||||||
'ReleephFacebookTasksFieldSpecification',
|
'ReleephFacebookTasksFieldSpecification',
|
||||||
)),
|
)),
|
||||||
'right' => self::selectFields($fields, array(
|
'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