bazelbuild/bazel-central-registry

Repository metadata validation should accept Github archives rehosted on mirror.bazel.build

jmillikin opened this issue · 0 comments

What happened?

When upstream doesn't provide stable source archives, a snapshot archive hosted on mirror.bazel.build can be used instead. However, the validation scripts get grumpy about this because they expect source URLs to start with "https://github.com/" if the module contains a github: repository in its metadata.

Example validation error:

BcrValidationResult.FAILED: The source URL of ninja@1.12.1 (https://mirror.bazel.build/github.com/ninja-build/ninja/archive/refs/tags/v1.12.1.tar.gz) doesn't match any of the module's source repositories ['github:ninja-build/ninja'].

Relevant code from tools/add_module.py:

source_repository = ""
if module.url.startswith("https://github.com/"):
    parts = module.url.split("/")
    source_repository = "github:" + parts[3] + "/" + parts[4]

Version

n/a

How to reproduce

No response

Any other information?

No response