Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

propose bazel type for Bazel modules #317

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions PURL-TYPES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,28 @@ apk
pkg:apk/alpine/curl@7.83.0-r0?arch=x86
pkg:apk/alpine/apk@2.12.9-r3?arch=x86

bazel
-----
``bazel`` for Bazel modules:

- The default repository ("registry") is ``https://bcr.bazel.build``, the
fmeum marked this conversation as resolved.
Show resolved Hide resolved
Bazel Central Registry (BCR).
- The ``name`` is the module name. It must be lowercased.
- The ``version`` is the module version in `Bazel's relaxed semver format
<https://bazel.build/external/module#version_format>`_.
- The optional ``repository_url`` can be used to specify the URL of an
alternative registry.
- The optional ``subpath`` can refer to a particular Bazel package in the
module.
- Examples::

pkg:bazel/rules_java@7.8.0
pkg:bazel/curl@8.8.0.bcr.1
pkg:bazel/curl@8.8.0?repository_url=https://example.org/bazel-registry
pkg:bazel/rules_java@7.8.0
pkg:bazel/rules_java@8.5.0#java/runfiles
pkg:bazel/rules_go@0.48.0#go

bitbucket
---------
``bitbucket`` for Bitbucket-based packages:
Expand Down
72 changes: 72 additions & 0 deletions test-suite-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -622,5 +622,77 @@
"qualifiers": null,
"subpath": null,
"is_invalid": false
},
{
"description": "bazel module with default registry",
"purl": "pkg:bazel/rules_java@7.8.0?registry_url=https://bcr.bazel.build/",
"canonical_purl": "pkg:bazel/rules_java@7.8.0",
"type": "bazel",
"namespace": null,
"name": "rules_java",
"version": "7.8.0",
"qualifiers": null,
"subpath": null,
"is_invalid": false
},
{
"description": "bazel module with custom registry",
"purl": "pkg:bazel/rules_java@7.8.0?registry_url=https://example.org/bazel-registry/",
"canonical_purl": "pkg:bazel/rules_java@7.8.0?registry_url=https://example.org/bazel-registry",
"type": "bazel",
"namespace": null,
"name": "rules_java",
"version": "7.8.0",
"qualifiers": null,
"subpath": null,
"is_invalid": false
},
{
"description": "bazel module with relaxed semver version",
"purl": "pkg:bazel/curl@8.8.0.bcr.1",
"canonical_purl": "pkg:bazel/curl@8.8.0.bcr.1",
"type": "bazel",
"namespace": null,
"name": "curl",
"version": "8.8.0.bcr.1",
"qualifiers": null,
"subpath": null,
"is_invalid": false
},
{
"description": "bazel module names are lowercased",
"purl": "pkg:bazel/Curl@8.8.0.bcr.1",
"canonical_purl": "pkg:bazel/Curl@8.8.0.bcr.1",
"type": "bazel",
"namespace": null,
"name": "curl",
"version": "8.8.0.bcr.1",
"qualifiers": null,
"subpath": null,
"is_invalid": true
},
{
"description": "bazel module with multi-segment package",
"purl": "pkg:bazel/rules_java@8.5.0#java/runfiles",
"canonical_purl": "pkg:bazel/rules_java@8.5.0#java/runfiles",
"type": "bazel",
"namespace": null,
"name": "rules_java",
"version": "8.5.0",
"qualifiers": null,
"subpath": "java/runfiles",
"is_invalid": false
},
{
"description": "bazel module with single-segment package",
"purl": "pkg:bazel/rules_go@0.48.0#go",
"canonical_purl": "pkg:bazel/rules_go@0.48.0#go",
"type": "bazel",
"namespace": null,
"name": "rules_go",
"version": "0.48.0",
"qualifiers": null,
"subpath": "go",
"is_invalid": false
}
]