GoogleCloudPlatform / GoogleCloudPlatform/cloud-run-button
redirector: Handing of slashes in branch names seems incorrect
- Dominant language
- Go
- Stars
- 553
- Forks
- 98
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
Assessment
This issue has not been assessed yet.