cloud-run-button
cloud-run-button copied to clipboard
redirector: Handing of slashes in branch names seems incorrect
I have just tried deploying from URL:
https://github.com/ahmetb/golang-samples/tree/run/grpc-server-streaming/run/grpc-server-streaming
where the branch name was run/grpc-server-streaming
.
funny enough, there's no way for redirector
to tell whether it is
branch = run
dir = grpc-server-streaming/run/grpc-server-streaming
or
branch = run/grpc-server-streaming
dir =run/grpc-server-streaming
So it naturally did some regex matching and wrongly assumed branch=run
, despite specifying ?dir= correctly.
cloudshell_open --repo_url "https://github.com/ahmetb/golang-samples.git" --dir "run/grpc-server-streaming" --page "editor" --git_branch "run"
[ ✓ ] Cloned git repository https://github.com/ahmetb/golang-samples.git.
Error: failed to checkout revision "run": git checkout failed: exit status 1, output:
error: pathspec 'run' did not match any file(s) known to git.
I don't think we can reliably disambiguate the URL in this case. (GitHub probably does, because it has the data.) Just wanted to note.
Oh bummer. We could put a note in the docs indicating that branches containing a /
aren't supported by the redirector.
I am thinking it's not worth making docs longer, especially ?revision
and ?dir
overrides are documented.