Skip to content

Feedback Issue: Multi-repo workspace configuration #8623

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

Closed
jldec opened this issue Mar 6, 2022 · 21 comments
Closed

Feedback Issue: Multi-repo workspace configuration #8623

jldec opened this issue Mar 6, 2022 · 21 comments
Labels
feedback-issue meta: stale This issue/PR is stale and will be closed soon team: webapp Issue belongs to the WebApp team

Comments

@jldec
Copy link
Contributor

jldec commented Mar 6, 2022

Objective

The aim of this issue is to gather feedback on the Beta feature: Multi-repo workspace configuration.
Please add your feedback in comments below -- any feedback is welcome!

More information

@jldec jldec added the team: webapp Issue belongs to the WebApp team label Mar 6, 2022
@mikenikles
Copy link
Contributor

I wanted to use this feature to open all template-* repositories in a single workspace so we can apply changes across all repos with minimal effort. See PR gitpod-io/template-all#2.

I encountered various issues:

  • API rate limit exceeded #8952
  • The GitHub Pull Requests & Issues extension repeatedly asks me to grant permissions
  • The browser crashes after a few minutes

What was the maximum number of repositories multi-repo workspaces were tested with? I'd like to add a disclaimer to the docs to warn people not to exceed that number.

@axonasif
Copy link
Member

axonasif commented Apr 5, 2022

It would be nice to have a property for the sub-repo dir to be opened with a new VSCODE instance with the new dir as its root. Same thing as running code dir command.

An example use case(there are more): https://discord.com/channels/816244985187008514/960820692876681256/960836288171360256

@ibrah3m
Copy link

ibrah3m commented Apr 10, 2022

I recommend providing an option to make us able to pass/get the main configuration from
environment-variables like the example below
mainConfiguration: $MY_VAR // should already exist or be passed by the URL

@axonasif
Copy link
Member

You can pass env vars via URL: https://www.gitpod.io/docs/environment-variables#provide-env-vars-via-url
However, I guess this parameter does not support env vars now.

@ThePaulMcBride
Copy link

When working on local VSCode the workspaceLocation option doesn't seem to do anything. I have to navigate to the file described and then it prompts me to reload the workspace.

@axonasif
Copy link
Member

Hey @ThePaulMcBride, can you please describe more of what you're trying to do?

@ThePaulMcBride
Copy link

In this article it says you can add a workspaceLocation line to the gitpod.yaml file so that both repos are opened in the IDE. This works when working in the browser IDE but when working with my local VSCode this doesn't work and only the main repo shows up. I can still right click in the file explorer sidebar and add it manually, so not the end of the world.

@tysonrm
Copy link

tysonrm commented May 27, 2022

Can this be nested?

@scasei
Copy link

scasei commented May 29, 2022

Additional repositories are cloned as shallow copies [1] with git clone --depth=1 [2]
If you need it deeper you can call git fetch --depth 10000 in the repo on init task or something.
I propose to update docs [3] about that fact or to load entire history as default.

[1] https://www.git-scm.com/docs/shallow
[2]

args := []string{"--depth=1", "--no-single-branch", c.RemoteURI}

[3] https://www.gitpod.io/docs/multi-repo-workspaces

@sebastianjung
Copy link

making vscode workspace files work with this would be great. Otherweise having both folder in the workspace by opening the parent folder would be an option too. For me at least.

@spearki
Copy link

spearki commented Aug 25, 2022

@jldec Something we found surprising (which someone has also raised in discord), is that if you add an additionalRespository to a repo but don't have a mainRepository backlink from the additional repo, then prebuilds stop being used if there is a newer commit in that repo than the prebuild.

We would potentially have a lot of additionalRepository repos, and we don't really want all of them to be triggering prebuilds, so we didn't plan on adding a mainRepository link to them. But at the same time, we don't want that to break the use of prebuilds entirely.

@gierschv
Copy link

This features work great, we have 5 additional repositories in one of our workspaces.

Similar to @ThePaulMcBride feedback, I was wondering if that would be possible to opt-in for some of them to automatically add them to the VSCode workspace next to the main repository?

Kind of equivalent to this UI feature:

Screenshot 2022-08-31 at 12 38 26

Thanks!

@axonasif
Copy link
Member

Hey @gierschv, we're doing it on this gitpod repo itself.

To make this work, you have to create a .code-workspace file and define the folders you would like to be loaded.

"folders": [

Next, you have to tell gitpod to use that .code-workspace file like so:

workspaceLocation: gitpod/gitpod-ws.code-workspace


More info on docs:

@gierschv
Copy link

Hey @gierschv, we're doing it on this gitpod repo itself.

To make this work, you have to create a .code-workspace file and define the folders you would like to be loaded.

"folders": [

Next, you have to tell gitpod to use that .code-workspace file like so:

workspaceLocation: gitpod/gitpod-ws.code-workspace

More info on docs:

Awesome! I didn't know you could put a .code-workspace config here. From the docs it sounds like you can only pass the path of the folder you want to use as workspace root. It works perfectly :)

@david-bakin
Copy link

I'd like to point you to this comment - #9209 (comment) - where I suggest considering the use case where you want to use Gitpod to work on repos where you have no access to that repo to add a .gitpod.yml and it will never happen.

What I'd particularly like is environment variable expansion within .gitpod.yml expecially in the additionalRepository: attribute. Then I could have a "main repository" that used a per-user or per-project env var or frequentely an env-var-embedded-in-url to launch my desired repo as an "additional repository" but with all the configuration I want. Even prebuilds. And there would be two ways to use this:

  1. Have a project specific repo all prepared with a custom dockerfile and a .gitpod.yml for working with that desired repo and make it public and anyone could immediately use it with their own fork (!!!) merely by using the env var to point to their fork of that repo. (This is what I'm trying to do with https://gitlab.com/bakins-bits/gitpod-setup-for-bitcoin-core-dev/ but without this capability that repo still needs to be cloned by everyone intending to work with Bitcoin Core.)

  2. Have a sort of "generic" setup repo that would work with any repo you'd like to work with that went beyond basic dotfile support - you could have a custom container that you always used (perhaps with additional tools), also a custom .gitpod.yml of course - this would apply if you frequently did similar work but in different repos. Even if you could put a .gitpod.yml in those repos you worked in you might, maybe, want to have a single configuration setup rather than copy it into each such repo and maintain it.

@shyim
Copy link

shyim commented Oct 11, 2022

I would like to use this feature to clone my repository inside another repository.

For the context: My repository is an extension for another. So I have to install first the other repository and clone my repository inside a specific folder.

For this I would like to install inside an additionalRepository my repository. I did that currently all using init section and moving files, but this breaks with image caching of prebuilds

@axonasif
Copy link
Member

axonasif commented Jan 6, 2023

@stale
Copy link

stale bot commented Apr 7, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the meta: stale This issue/PR is stale and will be closed soon label Apr 7, 2023
@stale stale bot closed this as completed Jun 11, 2023
@github-project-automation github-project-automation bot moved this to In Validation in 🍎 WebApp Team Jun 11, 2023
@sgurlt
Copy link

sgurlt commented Oct 4, 2023

This is currently a nice feature, but it is lacking an integration into prebuilds.
Within my prebuild init steps I want to be able to interact with my additional repositories.
Sadly, I have learned the hard way, that the additional repositories are not existent during the prebuild phase.

Additionally, to that, I want to be able to select additional repositories that trigger a prebuild of my main repository, when a commit is pushed to a given branch of those.

@svenefftinge
Copy link
Member

This should work. Can you share the repositories (configurations) you are using it with?

@axonasif
Copy link
Member

axonasif commented Oct 5, 2023

@sgurlt also created a thread on our discord server, we're discussing there 👋

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feedback-issue meta: stale This issue/PR is stale and will be closed soon team: webapp Issue belongs to the WebApp team
Projects
Status: In Validation
Development

No branches or pull requests