-
Notifications
You must be signed in to change notification settings - Fork 215
Add otp Type
#472
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
Merged
Merged
Add otp Type
#472
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,6 +27,7 @@ | |
| "npm", | ||
| "nuget", | ||
| "oci", | ||
| "otp", | ||
| "pub", | ||
| "pypi", | ||
| "qpkg", | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,120 @@ | ||
| { | ||
| "$schema": "https://packageurl.org/schemas/purl-test.schema-0.1.json", | ||
| "tests": [ | ||
| { | ||
| "description": "Parse test for <class 'type'> PURL", | ||
| "test_group": "base", | ||
| "test_type": "parse", | ||
| "input": "pkg:otp/[email protected]?arch=amd64&platform=linux&repository_url=https:%2F%2Fgithub.com%2Ferlang%2Fotp&vcs_url=git%2Bhttps:%2F%2Fgithub.com%2Ferlang%2Fotp.git#src/asn1ct.erl", | ||
| "expected_output": { | ||
| "type": "otp", | ||
| "namespace": null, | ||
| "name": "asn1", | ||
| "version": "5.4.1", | ||
| "qualifiers": { | ||
| "platform": "linux", | ||
| "arch": "amd64", | ||
| "repository_url": "https://github.com/erlang/otp", | ||
| "vcs_url": "git+https://github.com/erlang/otp.git" | ||
| }, | ||
| "subpath": "src/asn1ct.erl" | ||
| }, | ||
| "expected_failure": false, | ||
| "expected_failure_reason": null | ||
| }, | ||
| { | ||
| "description": "Roundtrip test for <class 'type'> PURL", | ||
| "test_group": "base", | ||
| "test_type": "roundtrip", | ||
| "input": "pkg:otp/[email protected]?arch=amd64&platform=linux&repository_url=https://github.com/erlang/otp&vcs_url=git%2Bhttps://github.com/erlang/otp.git#src/asn1ct.erl", | ||
| "expected_output": "pkg:otp/[email protected]?arch=amd64&platform=linux&repository_url=https:%2F%2Fgithub.com%2Ferlang%2Fotp&vcs_url=git%2Bhttps:%2F%2Fgithub.com%2Ferlang%2Fotp.git#src/asn1ct.erl", | ||
| "expected_failure": false, | ||
maennchen marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "expected_failure_reason": null | ||
| }, | ||
| { | ||
| "description": "Build test for <class 'type'> PURL", | ||
| "test_group": "base", | ||
| "test_type": "build", | ||
| "input": { | ||
| "type": "otp", | ||
| "namespace": null, | ||
| "name": "asn1", | ||
| "version": "5.4.1", | ||
| "qualifiers": { | ||
| "platform": "linux", | ||
| "arch": "amd64", | ||
| "repository_url": "https://github.com/erlang/otp", | ||
| "vcs_url": "git+https://github.com/erlang/otp.git" | ||
| }, | ||
| "subpath": "src/asn1ct.erl" | ||
| }, | ||
| "expected_output": "pkg:otp/[email protected]?arch=amd64&platform=linux&repository_url=https:%2F%2Fgithub.com%2Ferlang%2Fotp&vcs_url=git%2Bhttps:%2F%2Fgithub.com%2Ferlang%2Fotp.git#src/asn1ct.erl", | ||
| "expected_failure": false, | ||
maennchen marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "expected_failure_reason": null | ||
| }, | ||
| { | ||
| "description": "Parse test for <class 'type'> PURL", | ||
| "test_group": "base", | ||
| "test_type": "parse", | ||
| "input": "pkg:otp/[email protected]", | ||
| "expected_output": { | ||
| "type": "otp", | ||
| "namespace": null, | ||
| "name": "hex", | ||
| "version": "2.1.1", | ||
| "qualifiers": null, | ||
| "subpath": null | ||
| }, | ||
| "expected_failure": false, | ||
| "expected_failure_reason": null | ||
| }, | ||
| { | ||
| "description": "Roundtrip test for <class 'type'> PURL", | ||
| "test_group": "base", | ||
maennchen marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "test_type": "roundtrip", | ||
| "input": "pkg:otp/[email protected]", | ||
| "expected_output": "pkg:otp/[email protected]", | ||
| "expected_failure": false, | ||
| "expected_failure_reason": null | ||
| }, | ||
| { | ||
| "description": "Build test for <class 'type'> PURL", | ||
| "test_group": "base", | ||
| "test_type": "build", | ||
| "input": { | ||
| "type": "otp", | ||
| "namespace": null, | ||
| "name": "hex", | ||
| "version": "2.1.1", | ||
| "qualifiers": null, | ||
| "subpath": null | ||
| }, | ||
| "expected_output": "pkg:otp/[email protected]", | ||
| "expected_failure": false, | ||
| "expected_failure_reason": null | ||
| }, | ||
| { | ||
| "description": "Parse test for <class 'type'> PURL", | ||
| "test_group": "base", | ||
| "test_type": "parse", | ||
| "input": "pkg:otp/namespace/[email protected]", | ||
| "expected_failure": true, | ||
| "expected_failure_reason": "Should fail to parse an OTP PURL containing a prohibited namespace component" | ||
| }, | ||
| { | ||
| "description": "Build test for <class 'type'> PURL", | ||
| "test_group": "base", | ||
| "test_type": "build", | ||
| "input": { | ||
| "type": "otp", | ||
| "namespace": "namespace", | ||
| "name": "hex", | ||
| "version": "2.1.1", | ||
| "qualifiers": null, | ||
| "subpath": null | ||
| }, | ||
| "expected_failure": true, | ||
| "expected_failure_reason": "Should fail to build an OTP PURL containing a prohibited namespace component" | ||
| } | ||
| ] | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| <!-- NOTE: Auto-generated from the JSON PURL type definition. | ||
| Do not manually edit this file. Edit the JSON type definition instead. --> | ||
|
|
||
| # PURL Type Definition: otp | ||
|
|
||
| - **Type Name:** BEAM/OTP Application | ||
| - **Description:** BEAM/OTP applications written in Elixir, Erlang, Gleam and other BEAM languages | ||
| - **Schema ID:** `https://packageurl.org/types/otp-definition.json` | ||
|
|
||
| ## PURL Syntax | ||
|
|
||
| The structure of a PURL for this package type is: | ||
|
|
||
| pkg:otp/<name>@<version>?<qualifiers>#<subpath> | ||
|
|
||
| ## Repository Information | ||
|
|
||
| - **Use Repository:** No | ||
|
|
||
| ## Namespace definition | ||
|
|
||
| - **Requirement:** Prohibited | ||
| - **Note:** `The component is unused and MUST be empty` | ||
|
|
||
| ## Name definition | ||
|
|
||
| - **Requirement:** Required | ||
| - **Native Label:** name | ||
| - **Note:** `The OTP application name from the `.app` file; it is case-insensitive and MUST be lower-cased.` | ||
|
|
||
| ## Version definition | ||
|
|
||
| - **Requirement:** Optional | ||
| - **Native Label:** version | ||
| - **Note:** `The OTP application version (the `vsn` attribute).` | ||
|
|
||
| ## Subpath definition | ||
|
|
||
| - **Requirement:** Optional | ||
| - **Native Label:** May be added to reference a specific file or directory inside the OTP application. | ||
|
|
||
| ## Qualifiers Definition | ||
|
|
||
| | Key | Requirement | Native name | Default Value | Description | | ||
| |------|-------------|-------------|---------------|-------------| | ||
| | repository_url | Optional | Repository URL | | The canonical origin of the OTP application source. This qualifier is optional, but it should be included whenever the origin is known, and should point to a trusted source repository. | | ||
| | platform | Optional | platform | | The target operating system for native code (e.g. ``linux``, ``darwin``, ``freebsd``, ``sunos``, ``win32``; case-insensitive). | | ||
| | arch | Optional | arch | | The arch is the qualifiers key for a package architecture. | | ||
|
|
||
| ## Examples | ||
|
|
||
| - `pkg:otp/[email protected]?platform=linux&arch=amd64&repository_url=https:%2F%2Fgithub.com%2Ferlang%2Fotp&vcs_url=git%20https:%2F%2Fgithub.com%2Ferlang%2Fotp.git` | ||
| - `pkg:otp/[email protected]?repository_url=https:%2F%2Fgithub.com%2Ferlang%2Fotp&vcs_url=git%20https:%2F%2Fgithub.com%2Ferlang%2Fotp.git` | ||
| - `pkg:otp/[email protected]?platform=darwin&arch=x86_64&repository_url=https:%2F%2Fgithub.com%2Ferlang%2Fotp&vcs_url=git%20https:%2F%2Fgithub.com%2Ferlang%2Fotp.git` | ||
| - `pkg:otp/[email protected]?repository_url=https:%2F%2Fgithub.com%2Felixir-lang%2Felixir&vcs_url=git%20https:%2F%2Fgithub.com%2Felixir-lang%2Felixir.git` | ||
| - `pkg:otp/[email protected]?repository_url=https:%2F%2Fgithub.com%2Felixir-lang%2Felixir&vcs_url=git%20https:%2F%2Fgithub.com%2Felixir-lang%2Felixir.git` | ||
| - `pkg:otp/[email protected]?repository_url=https:%2F%2Fgithub.com%2Felixir-lang%2Felixir&vcs_url=git%20https:%2F%2Fgithub.com%2Felixir-lang%2Felixir.git` | ||
| - `pkg:otp/[email protected]?repository_url=https:%2F%2Fgithub.com%2Ferlang%2Frebar3&vcs_url=git%20https:%2F%2Fgithub.com%2Ferlang%2Frebar3.git` | ||
| - `pkg:otp/[email protected]?repository_url=https:%2F%2Fgithub.com%2Fhexpm%2Fhex&vcs_url=git%20https:%2F%2Fgithub.com%2Fhexpm%2Fhex.git` | ||
|
|
||
| ## Note | ||
|
|
||
| - If the component was fetched from a Hex repository, prefer a ``hex`` purl | ||
| because Hex provides a global, collision-free namespace that uniquely ties | ||
| the version to the published source. | ||
| - There is no default package repository. When the application can be | ||
| fetched from a known location, add a general qualifier such as | ||
| `repository_url`, `download_url` or `vcs_url`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| { | ||
| "$schema": "https://packageurl.org/schemas/purl-type-definition.schema-1.0.json", | ||
| "$id": "https://packageurl.org/types/otp-definition.json", | ||
| "type": "otp", | ||
| "type_name": "BEAM/OTP Application", | ||
| "description": "BEAM/OTP applications written in Elixir, Erlang, Gleam and other BEAM languages", | ||
| "note": "- If the component was fetched from a Hex repository, prefer a ``hex`` purl\n because Hex provides a global, collision-free namespace that uniquely ties\n the version to the published source.\n- There is no default package repository. When the application can be\n fetched from a known location, add a general qualifier such as\n `repository_url`, `download_url` or `vcs_url`.", | ||
| "repository": { | ||
| "use_repository": false | ||
| }, | ||
| "namespace_definition": { | ||
| "requirement": "prohibited", | ||
| "note": "The component is unused and MUST be empty" | ||
| }, | ||
| "name_definition": { | ||
| "case_sensitive": false, | ||
| "native_name": "name", | ||
| "note": "The OTP application name from the `.app` file; it is case-insensitive and MUST be lower-cased.", | ||
| "requirement": "required" | ||
| }, | ||
| "version_definition": { | ||
| "native_name": "version", | ||
| "note": "The OTP application version (the `vsn` attribute).", | ||
| "requirement": "optional" | ||
| }, | ||
| "subpath_definition": { | ||
| "case_sensitive": false, | ||
| "native_name": "May be added to reference a specific file or directory inside the OTP application.", | ||
| "requirement": "optional" | ||
| }, | ||
| "qualifiers_definition": [ | ||
| { | ||
| "key": "repository_url", | ||
maennchen marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "requirement": "optional", | ||
| "native_name": "Repository URL", | ||
| "description": "The canonical origin of the OTP application source. This qualifier is optional, but it should be included whenever the origin is known, and should point to a trusted source repository." | ||
| }, | ||
| { | ||
| "key": "platform", | ||
| "requirement": "optional", | ||
| "native_name": "platform", | ||
| "description": "The target operating system for native code (e.g. ``linux``, ``darwin``, ``freebsd``, ``sunos``, ``win32``; case-insensitive)." | ||
| }, | ||
| { | ||
| "key": "arch", | ||
| "requirement": "optional", | ||
| "native_name": "arch", | ||
| "description": "The arch is the qualifiers key for a package architecture." | ||
| } | ||
| ], | ||
| "examples": [ | ||
| "pkg:otp/[email protected]?platform=linux&arch=amd64&repository_url=https:%2F%2Fgithub.com%2Ferlang%2Fotp&vcs_url=git%2Bhttps:%2F%2Fgithub.com%2Ferlang%2Fotp.git", | ||
| "pkg:otp/[email protected]?repository_url=https:%2F%2Fgithub.com%2Ferlang%2Fotp&vcs_url=git%2Bhttps:%2F%2Fgithub.com%2Ferlang%2Fotp.git", | ||
| "pkg:otp/[email protected]?platform=darwin&arch=x86_64&repository_url=https:%2F%2Fgithub.com%2Ferlang%2Fotp&vcs_url=git%2Bhttps:%2F%2Fgithub.com%2Ferlang%2Fotp.git", | ||
| "pkg:otp/[email protected]?repository_url=https:%2F%2Fgithub.com%2Felixir-lang%2Felixir&vcs_url=git%2Bhttps:%2F%2Fgithub.com%2Felixir-lang%2Felixir.git", | ||
| "pkg:otp/[email protected]?repository_url=https:%2F%2Fgithub.com%2Felixir-lang%2Felixir&vcs_url=git%2Bhttps:%2F%2Fgithub.com%2Felixir-lang%2Felixir.git", | ||
| "pkg:otp/[email protected]?repository_url=https:%2F%2Fgithub.com%2Felixir-lang%2Felixir&vcs_url=git%2Bhttps:%2F%2Fgithub.com%2Felixir-lang%2Felixir.git", | ||
| "pkg:otp/[email protected]?repository_url=https:%2F%2Fgithub.com%2Ferlang%2Frebar3&vcs_url=git%2Bhttps:%2F%2Fgithub.com%2Ferlang%2Frebar3.git", | ||
| "pkg:otp/[email protected]?repository_url=https:%2F%2Fgithub.com%2Fhexpm%2Fhex&vcs_url=git%2Bhttps:%2F%2Fgithub.com%2Fhexpm%2Fhex.git" | ||
| ] | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.