Support SCP-like parent URLs with relative submodules
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 56/100
Research direction
Start by locating ResolveSubmoduleURL and the existing scpLikeURLRegex. Read the relative-path handling and compare it with go-git's transport.NewEndpoint() behavior, then add coverage for SCP-like parent URLs and relative submodule paths. Done means the reported URL resolves without the current error while existing HTTPS and multiple-relative-path cases continue to work.
Written by the indexing model from the issue text.
Description
Problem
When the parent repository uses an SCP-like URL (e.g., git@github.com:org/repo.git) and a submodule is configured with a relative path (e.g., ../other/submodule.git), envbuilder cannot resolve the submodule URL.
Currently this returns an error:
relative submodule URL "../other/submodule.git" cannot be resolved: parent URL "git@github.com:org/repo.git" uses SCP-like syntax which is not supported for relative submodule resolution
Background
Go's net/url.Parse() cannot properly parse SCP-like URLs - they have no scheme and use : as a path separator instead of /.
We've built a custom ResolveSubmoduleURL function to handle relative submodule paths because go-git's native implementation has bugs with:
- HTTPS URLs losing slashes when using
filepath.Dir() - Multiple relative paths (
../../submodule.git) not resolving correctly
Workaround
Users can configure submodules with absolute URLs instead of relative paths.
Proposed Solution
Add SCP-like URL handling to ResolveSubmoduleURL:
- Detect SCP-like parent URLs using the existing
scpLikeURLRegex - Parse into user, host, and path components
- Apply relative path resolution to the path component
- Reconstruct the SCP-like URL
Alternatively, use go-git's transport.NewEndpoint() which can parse SCP-like URLs, but this needs careful testing to ensure it doesn't reintroduce the bugs we worked around.
Related/Blocker
- PR #485: feat: add git submodule support
- Dominant language
- Go
- Stars
- 300
- Forks
- 64
- Avg merge
- 20m
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from coder/envbuilder
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 90/100
coder/envbuilder#506 ·
-
bug envbuilder needs-investigation
Difficulty 4/5 3-5 days Newbie friendliness 35/100
coder/envbuilder#495 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
coder/envbuilder#484 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 38/100
coder/envbuilder#483 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
coder/envbuilder#481 · 1 comment ·
All issues in coder/envbuilder
Similar issues
-
feature-request helm
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gravitational/teleport#69785 ·
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
crossplane/crossplane#7859 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100