tilt-dev / tilt

Define your dev environment as code. For microservice apps on Kubernetes.
https://tilt.dev/
Apache License 2.0
7.69k stars 303 forks source link

Feature Request: Support Gitlab subgroups within an extension repo's URL #6352

Open BradleyChatha opened 7 months ago

BradleyChatha commented 7 months ago

Describe the Feature You Want

Gitlab supports the ability to nest groups within other groups, for example:

gitlab.com
  - /company
    - /devops
      - /tilt-extensions

It'd be awesome if Tilt could support such structures, e.g.

# Tiltfile
v1alpha1.extension_repo(name="company", url="https://gitlab.com/company/devops/tilt-extensions", ref="main")

As a side note I'd be happy to look into implementing this myself, and I'll probably have a go at it sometime soon.

Current Behavior

Currently when using the above Starlark snippet, Tilt will try to perform the following command:

git clone -- https://gitlab.com/company/devops /Users/___/Library/Application Support/tilt-dev/tilt_modules/gitlab.com/company/devops

Which shows that Tilt is only caring about the first two parts of the URL's path (company/devops), snipping off everything after.

Why Do You Want This?

We'd like to make use of custom extensions but we'd rather not break our current organisation of repositories just to get around a limitation in Tilt.

nicks commented 6 months ago

thanks for reporting! i think gitlab support was an external contribution, implemented here - https://github.com/tilt-dev/go-get/pull/13

my vague understanding is that MOST VCS providers need some custom handling, but i'm not sure what other tools (e.g., Golang, Terraform) do for gitlab subgroups

BradleyChatha commented 6 months ago

Thanks for pointing me in a direction I can dig deeper in to. I'll definitely give this a look at at some point, when it becomes a bit higher priority for us.

For reference, Gitlab URLs have a /-/ within their path to signal the split between "describing arbitrary nested subgroups" and "actual API path".

e.g.

https://gitlab.com/company/subgroup-1/subgroup-2/code-repo/-/tree/main

So I believe it's safe to assume that if no "/-/" is found, then the entire URL path can be used as the repo path.