Support SCP-like parent URLs with relative submodules
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 56/100
Hướng nghiên cứu
Bắt đầu bằng cách tìm ResolveSubmoduleURL và scpLikeURLRegex hiện có. Đọc cách xử lý đường dẫn tương đối và so sánh với hành vi của transport.NewEndpoint() trong go-git, sau đó bổ sung coverage cho các URL cha dạng SCP và các đường dẫn submodule tương đối. Hoàn thành khi URL được báo cáo được phân giải mà không gặp lỗi hiện tại, đồng thời các trường hợp HTTPS hiện có và các trường hợp có nhiều đường dẫn tương đối vẫn tiếp tục hoạt động.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
When the parent repository uses an SCP-like URL (e.g., [email protected]: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 "[email protected]: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
- Ngôn ngữ chính
- Go
- Star
- 300
- Fork
- 64
- Merge trung bình
- 20 phút
- Pull request đã merge (30 ngày)
- 1
Chuẩn bị môi trường
Chúng tôi chưa kiểm tra các tệp thiết lập môi trường của dự án này. Hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của coder/envbuilder
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
coder/envbuilder#506 ·
-
bug envbuilder needs-investigation
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
coder/envbuilder#495 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
coder/envbuilder#484 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 38/100
coder/envbuilder#483 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
coder/envbuilder#481 · 1 bình luận ·
Tất cả issue của coder/envbuilder
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Remove obsolete ipAllocationPolicy field from containernodepool-subnetworkref test dependencyĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
GoogleCloudPlatform/k8s-config-connector#13462 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
coder/coder#29955 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
microsoft/TypeScript#64453 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
OpenAI-compatible endpoint: response ids have only 999 possible values (chatcmpl-rand.Intn(999))Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày