Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redirector: Handing of slashes in branch names seems incorrect #134

Open
ahmetb opened this issue Jan 16, 2020 · 2 comments
Open

redirector: Handing of slashes in branch names seems incorrect #134

ahmetb opened this issue Jan 16, 2020 · 2 comments

Comments

@ahmetb
Copy link
Contributor

ahmetb commented Jan 16, 2020

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.

@jamesward
Copy link
Contributor

Oh bummer. We could put a note in the docs indicating that branches containing a / aren't supported by the redirector.

@ahmetb
Copy link
Contributor Author

ahmetb commented Jan 16, 2020

I am thinking it's not worth making docs longer, especially ?revision and ?dir overrides are documented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants