Page MenuHomePhabricator

Add git clone url to conduit repository.query
Closed, DuplicatePublic

Description

We are building a custom extension for Phabricator hosted git repos and we could really use the git clone url for each repo.

Right now a repo object looks like this ( source ):

[...]
"5": {
    "id": "5",
    "name": "Phabricator",
    "phid": "PHID-REPO-9a38b7db1b795ae3e348",
    "callsign": "P",
    "monogram": "rP",
    "vcs": "git",
    "uri": "https:\/\/secure.phabricator.com\/diffusion\/P\/",
    "remoteURI": "git:\/\/github.com\/facebook\/phabricator.git",
    "description": null,
    "isActive": true,
    "isHosted": true,
    "isImporting": false
  },
[...]

And a git clone url looks like this ( source ):

ssh://dweller@secure.phabricator.com/diffusion/P/phabricator.git

I suggest to add the git clone url to the repo object. Something like this:

[...]
"5": {
    "id": "5",
    "name": "Phabricator",
    "phid": "PHID-REPO-9a38b7db1b795ae3e348",
    "callsign": "P",
    "monogram": "rP",
    "vcs": "git",
    "uri": "https:\/\/secure.phabricator.com\/diffusion\/P\/",
    "remoteURI": "git:\/\/github.com\/facebook\/phabricator.git",
    "description": null,
    "isActive": true,
    "isHosted": true,
    "isImporting": false,

    "checkout":{
        "ssh": "ssh://dweller@secure.phabricator.com/diffusion/P/phabricator.git",
        "http": "https://secure.phabricator.com/diffusion/P/phabricator.git"
    }

  },
[...]

Event Timeline

gerx03 raised the priority of this task from to Normal.
gerx03 updated the task description. (Show Details)
gerx03 added a project: Conduit.
gerx03 added a subscriber: gerx03.
epriestley renamed this task from Feature request: add git clone url to conduit repository.query to Add git clone url to conduit repository.query.Mar 21 2015, 11:55 AM
epriestley added a project: Diffusion.
eadler added a project: Restricted Project.Jan 9 2016, 1:06 AM
eadler moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.
epriestley edited projects, added Diffusion (v3); removed Diffusion.
epriestley moved this task from Backlog to URI Stuff on the Diffusion (v3) board.
eadler moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.Feb 18 2016, 6:32 PM
eadler moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.Mar 21 2016, 8:27 PM
eadler edited projects, added Restricted Project; removed Restricted Project.

I'm going to merge this into T10366. After D15822, this information is available via diffusion.repository.search by asking for the uris attachment. Note that:

  • The information won't be authoritative until we cut over to using the new URI code. This is likely to happen in the next week.
  • You get a long list of URIs, because repositories may have numerous clone URIs (e.g., different protocols, different identifier variants, and arbitrarily many custom configured clone URIs) and this API returns all associated URIs, including fetch URIs, mirror URIs, and association-only URIs. You get enough information to figure out where you should clone from, but will need to do some work to select the preferred clone URI for your purposes. We might introduce something to select a single "reasonable" URI in the future that tries to pick one of these as valid to make this easier, but this complexity is unavoidable in the general case given the complexity of repository URI management after T10366. The return structure should make more sense once the UI cuts over to the new UI.