mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-10 23:01:04 +01:00
Allow 'repository.create' to set description and autoclose
Summary: These are currently not available via Conduit. Also fix a bug where bad JSON input triggers an error about undefined `$metadata`. Test Plan: Ran 'repository.create' with and without a description and with and without autoclose. Verified the created repositories had the requested attributes. Reviewers: btrahan, vrana Reviewed By: btrahan CC: aran Differential Revision: https://secure.phabricator.com/D2881
This commit is contained in:
parent
6c1c3c3a7a
commit
bbfb686db5
3 changed files with 7 additions and 1 deletions
|
@ -43,6 +43,7 @@ final class PhabricatorConduitAPIController
|
||||||
|
|
||||||
$log = new PhabricatorConduitMethodCallLog();
|
$log = new PhabricatorConduitMethodCallLog();
|
||||||
$log->setMethod($method);
|
$log->setMethod($method);
|
||||||
|
$metadata = array();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,7 @@ abstract class ConduitAPI_repository_Method extends ConduitAPIMethod {
|
||||||
'uri' => PhabricatorEnv::getProductionURI($repository->getURI()),
|
'uri' => PhabricatorEnv::getProductionURI($repository->getURI()),
|
||||||
'remoteURI' => (string)$repository->getPublicRemoteURI(),
|
'remoteURI' => (string)$repository->getPublicRemoteURI(),
|
||||||
'tracking' => $repository->getDetail('tracking-enabled'),
|
'tracking' => $repository->getDetail('tracking-enabled'),
|
||||||
|
'description' => $repository->getDetail('description'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,7 @@ final class ConduitAPI_repository_create_Method
|
||||||
'name' => 'required string',
|
'name' => 'required string',
|
||||||
'vcs' => 'required enum<git, hg, svn>',
|
'vcs' => 'required enum<git, hg, svn>',
|
||||||
'callsign' => 'required string',
|
'callsign' => 'required string',
|
||||||
|
'description' => 'optional string',
|
||||||
'encoding' => 'optional string',
|
'encoding' => 'optional string',
|
||||||
'tracking' => 'optional bool',
|
'tracking' => 'optional bool',
|
||||||
'uri' => 'optional string',
|
'uri' => 'optional string',
|
||||||
|
@ -53,7 +54,8 @@ final class ConduitAPI_repository_create_Method
|
||||||
'closeCommitsFilter' => 'optional list<string>',
|
'closeCommitsFilter' => 'optional list<string>',
|
||||||
'pullFrequency' => 'optional int',
|
'pullFrequency' => 'optional int',
|
||||||
'defaultBranch' => 'optional string',
|
'defaultBranch' => 'optional string',
|
||||||
'heraldEnabled' => 'optional bool',
|
'heraldEnabled' => 'optional bool, default = true',
|
||||||
|
'autocloseEnabled' => 'optional bool, default = true',
|
||||||
'svnUUID' => 'optional string',
|
'svnUUID' => 'optional string',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -107,6 +109,7 @@ final class ConduitAPI_repository_create_Method
|
||||||
|
|
||||||
$details = array(
|
$details = array(
|
||||||
'encoding' => $request->getValue('encoding'),
|
'encoding' => $request->getValue('encoding'),
|
||||||
|
'description' => $request->getValue('description'),
|
||||||
'tracking-enabled' => (bool)$request->getValue('tracking', true),
|
'tracking-enabled' => (bool)$request->getValue('tracking', true),
|
||||||
'remote-uri' => $request->getValue('uri'),
|
'remote-uri' => $request->getValue('uri'),
|
||||||
'local-path' => $request->getValue('localPath'),
|
'local-path' => $request->getValue('localPath'),
|
||||||
|
@ -123,6 +126,7 @@ final class ConduitAPI_repository_create_Method
|
||||||
'ssh-keyfile' => $request->getValue('sshKeyFile'),
|
'ssh-keyfile' => $request->getValue('sshKeyFile'),
|
||||||
'herald-disabled' => !$request->getValue('heraldEnabled', true),
|
'herald-disabled' => !$request->getValue('heraldEnabled', true),
|
||||||
'svn-subpath' => $request->getValue('svnSubpath'),
|
'svn-subpath' => $request->getValue('svnSubpath'),
|
||||||
|
'disable-autoclose' => !$request->getValue('autocloseEnabled', true),
|
||||||
);
|
);
|
||||||
|
|
||||||
foreach ($details as $key => $value) {
|
foreach ($details as $key => $value) {
|
||||||
|
|
Loading…
Reference in a new issue