One of the big frustrations we had during the migration was a nice, abstract way of showing interaction URIs - that is, URIs for interacting with the repository via a backend client app, not for webviewer URIs. Seems to me that we ought to be able to provide plugins that, while obviously being backend-specific in the URIs they generate and the underlying data they pull from, still conform to the same client-facing interface in terms of actually providing these links.
It should work something like this: an outer plugin class which takes care of grabbing settings & raw data necessary to actually figure out what all the URIs looks like. This class then produces one VersioncontrolProtocolInteractionURI object per protocol (e.g. one for git://, one for ssh://, etc.). That object's interface is responsible for reporting (at least) three things:
- A copy/pasteable raw URI
- The human-readable name of the protocol
- Whether the URI is rw or ro, & anon or authed for each (probably best expressed via bitmask)
Client code can then construct their interfaces using this information however they'd like, and can do it in a way that actually ought to work cross-vcs.
Comments
Comment #1
marvil07 commentedI think I understand the problem here, but I am not really sure this is a good idea.
Version Control API know how to retrieve repository information, but that does not mean it should know all the services around that repository.
So, I guess we can add the information, but we can not really make sure services are real, and we will be depending on each of the services configuration(i.e. real http url based on a repository path data member can change if service change configuration).
Comment #2
sdboyer commentedthe purpose of keeping track of this information isn't so that vcapi can utilize it internally. it's so that it can report it to end-users. to that end, i think recording this information is absolutely within the mandate of vcapi. currently we do it on drupal.org via hardcoded strings in a secondary module. it's not good.
Comment #3
sdboyer commentedtagging vc-next during triage