Open ericpaulsen opened 21 hours ago
@ericpaulsen I'm trying to reproduce this with envbuilder 1.0 but it seems to work as expected. Could you provide the following additional information:
https://[redacted].git#refs/heads/...
)ENVBUILDER_WORKSPACE_FOLDER
is set and to which valueGIT_
options being used, like GIT_CLONE_SINGLE_BRANCH
?Edit: This was possibly fixed in #188.
I believe it’s a bug in this code:
https://github.com/coder/envbuilder/blob/46c97a46b96f3ca12f9718766b7eb610e0f1e80d/options/defaults.go#L20
I’m able to reproduce by testing the code locally on an input like https://github.com/[org]/[repo]/#refs/heads/[branch]
Specifically this line: https://github.com/coder/envbuilder/blob/46c97a46b96f3ca12f9718766b7eb610e0f1e80d/options/defaults.go#L28
For the URL https://github.com/[org]/[repo]/#refs/heads/[branch]
, this results in name
:
["", "[org]", "[repo]", ""]
and the last argument (""
) is chosen as the repo name instead of the proper name.
The same issue can be noticed by adding an extra /
to any non-branch URL, i.e. https://github.com/[org]/[repo]/
. Also note that it doesn't matter whether .git
is added to the repo identifier or not.
from a prospective customer:
this is blocking their devcontainer use-case with Coder, because their build/service scripts rely on the source path in order to work, so the project not being in
/workspaces/repo-name/
is breaking the services.