orbitalci / orbital

Orbital is a self-hosted CI system for solo/small consulting dev teams. Written in Rust.
GNU General Public License v3.0
29 stars 2 forks source link

Client-side git repo parsing needs a more scalable strategy #207

Closed tjtelan closed 4 years ago

tjtelan commented 5 years ago

This has an unfortunate side-effect.

We have 2 repos: example-repo and example-repo.ui

Ocelot is currently tracking example-repo as expected. Then we build example-repo.ui to register. Fine so far.

When we are in example-repo.ui's directory, and we try to ocelot summary...

Flag -acct-repo was not set, detecting account and repository using git commands
Detected <account>/<repo> of level11consulting/example-repo

It looks like we are incorrectly splitting string on the first period. Probably to look for .git. We likely want to work from the back of the string instead if this is the method actually want to use.

Workaround: Always provide the -acct-repo ex. ocelot -acct-repo level11consulting/example-repo <...>

shankj3 commented 5 years ago

I think it's regex, probably just need to update that?

tjtelan commented 5 years ago

https://github.com/level11consulting/ocelot/blob/master/client/commandhelper/gitint.go#L18

This is the line specifically. But all of this can probably be condensed into a single fixed rule. But I don't know that this is the most scalable approach as we look at what it would take to add a new git provider.

Quickly testing, this would have worked for the original issue:

git\@bitbucket.\w+\:([^\/.])\/(.)(.git)