Skip to content

Commit

Permalink
Fix name requirements and add test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
fmeum committed Aug 1, 2024
1 parent 411de90 commit c40fa76
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 5 deletions.
8 changes: 3 additions & 5 deletions PURL-TYPES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,14 @@ bazel

- The default repository ("registry") is ``https://bcr.bazel.build``, the
Bazel Central Registry (BCR).
- The ``name`` is the module name. It is case sensitive, but a single registry
will never contain two different module names that compare equal
case-insensitively.
- 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.
alternative registry, with any trailing forward slashes removed.
- The optional ``subpath`` can name a particular Bazel target in the module via
a label with the leading double slash (``//``) removed and canonicalized by
omitting the target name if it is equal to the name of the containing package.
omitting the target name if it is equal to the name of the containing package.
- Examples::

pkg:bazel/rules_java@7.8.0
Expand Down
84 changes: 84 additions & 0 deletions test-suite-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -550,5 +550,89 @@
"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 target",
"purl": "pkg:bazel/rules_java@7.8.0#//toolchains:singlejar",
"canonical_purl": "pkg:bazel/rules_java@7.8.0#toolchains:singlejar",
"type": "bazel",
"namespace": null,
"name": "rules_java",
"version": "7.8.0",
"qualifiers": null,
"subpath": "toolchains:singlejar",
"is_invalid": false
},
{
"description": "bazel module with target in short-hand form",
"purl": "pkg:bazel/rules_go@0.48.0#//go: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
},
{
"description": "bazel module with top-level target",
"purl": "pkg:bazel/rules_go@0.48.0#//:stdlib",
"canonical_purl": "pkg:bazel/rules_go@0.48.0#:stdlib",
"type": "bazel",
"namespace": null,
"name": "rules_go",
"version": "0.48.0",
"qualifiers": null,
"subpath": ":stdlib",
"is_invalid": false
}
]

0 comments on commit c40fa76

Please sign in to comment.