Page MenuHomePhabricator

Create command line script to create new diffusion repositories
Closed, ResolvedPublic

Description

I want to be able to import new repositories without using the Phabricator webinterface. Either by making a command-line option or a conduit call (not sure which is more reasonable). I'm willing to program this task myself.

Obviously want as much advice/guidance as possible. But it looks to me like the general idea is to

(1) Create something like PhabricatorRepositoryManagementImportWorkflow.php in https://secure.phabricator.com/diffusion/P/browse/master/src/applications/repository/management/

(2) Have the workflow call PhabricatorRepository::initializeNewRepository
In a way similar to is done in https://secure.phabricator.com/diffusion/P/browse/master/src/applications/diffusion/controller/DiffusionRepositoryCreateController.php

Event Timeline

ygreif raised the priority of this task from to Needs Triage.
ygreif updated the task description. (Show Details)
ygreif added a subscriber: ygreif.

https://secure.phabricator.com/conduit/method/repository.create/ is the conduit call to create a new remote-tracking repository (There used to be a separate Repository "application", hence the name).

You can use something like this to import a new repo:

echo '{"name": "new repo name", 
       "callsign": "REPO", 
       "uri":"uri://remote/", 
       "vcs":"git" 
}' | arc call-conduit 'repository.create'

Great, thanks. Checking it out.

Thanks, that works. Our project also need a conduit call for creating a new credentialPHID. I looked through the conduit calls and don't see it. Am I missing the option? Or can it be added?

chad claimed this task.