Confusion over cardinaltiy of Codespaces setup for developer teams

206 Views Asked by At

I am currently trying to wrap my head around a development setup based on Codespaces and Docker: https://learn.microsoft.com/en-us/visualstudio/codespaces/how-to/browser#create-an-environment

Requirements/ Situation:

  • 3 developers
  • 2 Projects hosted on Github
  • Project 1 has 2 branches (+master)
  • Project 2 has 1 branch (+master)
  • Developer 1 & 2 are working on Branch 1 of Project 1
  • Developer 2 is working on Branch 2 of Project 1 and Branch 1 of Project 2 (i.e. "the only non-master branch")
  • Developers should be able to develop using VS Codespaces, i.e. with remote compilation and without the need to manually install plugins, configure Node versions etc.
  • There is a company Azure account with a login with "mail@my_company.com":

I attempted to visualize the situation in the following graph: enter image description here

Solution Attempt: The idea is/ was to add Dockerfiles to the GitHub repositories, to align the configuration of each project (i.e. GitHub Repository) across all the developers working on that project. And to then have the developers work on the project via codespaces and commit their changes once done.

  1. So far I was able to use Dockerfiles in VS Code, to automatically set the correct Node version (as an example), when checking out a project from GitHub in VS Code.

  2. I was also able to Create a codespace and collaborate on a workspace, by logging into the codespace account from 2 laptops. The synchronisation worked as expected, as soon as I saved a file on one laptop, I was able to see it in the IDE of the other.

The Issue/ Question A couple of things that I do not understand yet, and prevent me from completing the setup:

  1. Developers currently need the login to the azure account, to connect to the codespaces in VS Code. That means every developer can see and edit everyones files. Great if You want to collaborate, but it seems to make it impossible to separate/ hide projects from developers.
  2. If connect to a Docker container in VS code, the remote compilation becomes impossible
  3. If I connect to codespaces, I loose the dockerfile setup.
  4. If I create a codespace for every branch on GitHub, then developers will meddle with each others code and the source control dies.
  5. If I create a codespace for each checkout of a branch on GitHub, it gets even worse because I loose the possibility of aligning settings between developers.

So no matter which route I take, I loose a critical functionality of each strategy.

What am I missing?

I've spent a lot of time reading through all kinds of Microsoft documentations, but was not able to find a satisfying answer.

1

There are 1 best solutions below

0
On

Thanks for considering Visual Studio Codespaces - I have a few answers for you but I want to make sure you saw our recent announcement that Visual Studio Codespaces is consolidating into GitHub Codespaces and the current service will be retired in February. Moving forward, we encourage you to consider the GitHub offering for your remote development needs.

To your main questions, each developer would need their own login to Azure/VS Codespaces - they would not share a single one. Upon logging in, they would create the codespace on their own when they need it for the specific project they are working on - we do not encourage admins to create a codespace for others since the codespace is tied to a single user account.