resolvers: support nesting and exec server #185169
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds support for nesting remote authorities via passing through
ExecServers.
wsl+Ubuntu@tunnel+my-pc
is parsed intothe chain
tunnel+my-pc
->wsl+Ubuntu
tunnel
prefixed is resolved. We expect theresolver to implement the new
resolveExecServer
method.wsl+Ubuntu
is the last resolver, so theresolve()
method is called and the exec server is passed in itsRemoteAuthorityResolverContext
Currently the ExecServer is typed as
unknown
in the API. Maybe wewant to make it real API in the future, but I don't want to do this
until it's generalized beyond a single consumer (WSL).
This also has adds utility method
getRemoteExecServer
to get an execserver for a given remote. This is used by WSL to probe information
about a tunneled machine even when WSL isn't opened (e.g. to get the
list of distros to shop.)
The new
@
handling should not break remotes. WSL doesn't use@
inits remotes, SSH and containers both hex-encode information contained
in authorities. Codespaces does put the codespace name in the remote
authority, but it doesn't seem like it's possible to get
@
in thosenames, since they're generated either randomly when opening a template
or from a repo name (where @ is not allowed).
cc @alexdima
Refs #184171