Creating custom SSH URIs not matching the expected builtin pattern

We have a complicated SCM deployment involving repos hosted in Phabricator being mirrored through a custom sync tool to a remote CI system. The remote CI system organizes repos into groups for permissions purposes, but those groups end up being part of the URI it uses to clone to build workspaces.

This mostly works for us, but one of our teams would like to start using submodules, and would like their .gitmodules file to work when interacting with Phab as well as in CI. They would prefer not to do a build-time update of .gitmodules files.

Looking at the documentation for custom URIs, it seems like we should be able to add an arbitrary path to the repo, with an I/O type of None, and then clone from that URI. But, this is not working; e.g., given a working Phabricator deployment at phab.company.com:

  • A valid builtin URI of ssh://git@phab.company.com/diffusion/123/submodule_project.git works.
  • A custom URI of ssh://git@phab.company.com/some_group/submodule_project.git throws errors about ‘unrecognized repository path’ with examples for the three valid builtin patterns.
  • A custom URI of ssh://git@phab.company.com/diffusion/some_group/submodule_project.git throws errors about there being no repository ‘some_path’.

We don’t support HTTPS URIs in our environment. Likewise, making the group name be the callsign won’t work since it has to be unique.

Is there a way to create custom SSH URIs with arbitrary paths as described above? If not, should the Phab documentation here be updated to be more explicit about where and how this feature can be used?

You can’t configure Phabricator to serve a repository from an arbitrary URI.

Can you point me at which passages in the documentation led you to think this will work? For example, “I/O Type” of “None” is documented as:

Phabricator will not fetch changes from or push changes to this URI. For builtin URIs, it will not let users fetch changes from or push changes to this URI.

It’s hard for me to see how “will not let users fetch changes” led you to believe you’d be able to clone from the URI.

In the section immediately prior to the one you referenced:

Customizing Displayed Clone URIs

If you have an unusual configuration and want the UI to offers users specific clone URIs other than the URIs that Phabricator serves or interacts with, you can add those URIs with the I/O Type set to None and then set their Display Type to Always.

I’m guessing this is really about displaying a customer-facing URI when deploying Phab behind a proxy. It would have helped me today if I could have pointed to the documentation and said “this feature is for proxied deployments not like ours, not inventing custom URIs”. It’s also not clear to me how this feature would ever apply to ssh or git URIs - if I’m right about that, it would be good to make that clear as well.

I don’t quite see how that can be misread – it says “other than the URIs that Phabricator serves or interacts with” already – but I’ll add an explicit reiteration that setting “Display Type” is about display behavior only and won’t cause these URIs to serve I/O.

It’s also not clear to me how this feature would ever apply to ssh or git URIs

There’s no reason SSH/Git URIs can’t be proxied just like HTTP URIs. Proxied SSH URis are common in many Phabricator setups with clustered repositories (including Phacility instances).