1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 14:00:56 +01:00

Expose "isDraft" and "holdAsDraft" revision properties over Conduit

Summary:
Ref T13195. See PHI861. The "+ Draft" flag is not currently exposed over the API, but seems stable enough to expose.

Also expose the "hold as draft" flag, normally `arc diff --draft`.

Today, you can get "+ Draft" with some other state by:

  - abandoning a draft revision ("Abandoned + Draft"); or
  - using `arc diff --plan-changes` with an older `arc` version ("Changes Planned + Draft").

Test Plan: Called `differential.revision.search` via Conduit and got sensible-looking results for revisions in various states.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13195

Differential Revision: https://secure.phabricator.com/D19648
This commit is contained in:
epriestley 2018-09-07 09:42:16 -07:00
parent a1ce23b9f5
commit 046c1b5b82

View file

@ -1152,6 +1152,20 @@ final class DifferentialRevision extends DifferentialDAO
->setKey('testPlan') ->setKey('testPlan')
->setType('string') ->setType('string')
->setDescription(pht('Revision test plan.')), ->setDescription(pht('Revision test plan.')),
id(new PhabricatorConduitSearchFieldSpecification())
->setKey('isDraft')
->setType('bool')
->setDescription(
pht(
'True if this revision is in any draft state, and thus not '.
'notifying reviewers and subscribers about changes.')),
id(new PhabricatorConduitSearchFieldSpecification())
->setKey('holdAsDraft')
->setType('bool')
->setDescription(
pht(
'True if this revision is being held as a draft. It will not be '.
'automatically submitted for review even if tests pass.')),
); );
} }
@ -1172,6 +1186,8 @@ final class DifferentialRevision extends DifferentialDAO
'diffPHID' => $this->getActiveDiffPHID(), 'diffPHID' => $this->getActiveDiffPHID(),
'summary' => $this->getSummary(), 'summary' => $this->getSummary(),
'testPlan' => $this->getTestPlan(), 'testPlan' => $this->getTestPlan(),
'isDraft' => !$this->getShouldBroadcast(),
'holdAsDraft' => (bool)$this->getHoldAsDraft(),
); );
} }