bazel-contrib / bazel-contrib/rules_jvm_external
Invalid mirror_urls when repository urls are prefixes of one another
- Dominant language
- Java
- Stars
- 373
- Forks
- 301
- Avg merge
- 7d 17h
- Merged PRs (30d)
- 3
Description
`infer_artifact_path_from_primary_and_repos` generates an invalid mirror url when multiple repositories are configured, where one is the prefix of another. This is probably a rare case, but I happen to be working with a "family" of internal repositories in the style of "foo" "foo-internal", etc. The code here trims the prefix from the url https://github.com/bazelbuild/rules_jvm_external/blob/b0c23d8260a0b3aff27982a0bc2f397919a84aea/coursier.bzl#L393, which ends up adding the repository's suffix as a prefix of the mirror url. So, the final url has an extra path like `internal/com/foo/...`.
Contributor guide
Research direction
Start in coursier.bzl at the infer_artifact_path_from_primary_and_repos implementation linked around line 393. Reproduce the case with repository URLs where one is a prefix of another, such as foo and foo-internal, and inspect the generated mirror URL. Done means the mirror URL no longer gains the repository suffix as an extra path component.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100