envbuilder
envbuilder copied to clipboard
feat: Add a way to select a specific branch before building the devcontainer
Description
Improve feature parity with github codespaces.
The goal is to add a new coder_parameter called target branch to workspace templates.
It will let the user select a branch from which to build a devcontainer.
Unlike the devcontainer cli, the git clone happen in the enbuilder container.
So I think it is the responsibility of envbuilder to checkout to the target branch before building the container.
PS: The workaround in readme.md does not work on all platforms.
This should already be possible. See https://github.com/coder/envbuilder#git-branch-selection You can preformat your repo url to choose a specific branch.
I already tried with bitbucket datacenter but not luck. I'm not sure if this workaround can work on bitbucket.
Also it is not user friendly, IMO it should be as easy as github codespaces.
When using the devcontainer cli instead of enbuilder it is quite simple, just git checkout before invoking the cli.
Also auto completion of branches would be nice but out of the scope of envbuilder.
The following feature:
Choose a branch using
ENVBUILDER_GIT_URLwith a ref/heads reference. For instance:ENVBUILDER_GIT_URL=https://github.com/coder/envbuilder-starter-devcontainer/#refs/heads/my-feature-branch
only works for https git urls, not ssh. Having an option to choose a branch, and use git clone -b branch_name git_url would be wonderful. At the moment I can't try solutions to some issues without merging those potential fixes to the main branch, which is not possible for me.