-
Notifications
You must be signed in to change notification settings - Fork 27
update(link): Relax link schemas to support domain-level identifiers #292
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
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
92ef1ef
update(links): Relax link schemas to support domain-level identifier
xibz 97ef251
fixup! update(links): Relax link schemas to support domain-level iden…
xibz b2d364c
fixup! fixup! update(links): Relax link schemas to support domain-lev…
xibz ff03821
feat(spec): add providers
xibz 4eab4a0
lint fixes and adding registry
xibz 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 |
|---|---|---|
|
|
@@ -56,6 +56,7 @@ rolledback | |
| runtime | ||
| sbom | ||
| schemaUri | ||
| schemas | ||
| schemauri | ||
| specversion | ||
| src | ||
|
|
||
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,5 @@ | ||
| # CDEvents Provider Registry | ||
|
|
||
| The canonical registry of known `provider` values is [`schemas/registry/providers.json`](schemas/registry/providers.json). SDKs MUST use this list as the default for provider validation. See the [Provider Validation](links.md#provider-validation) section in `links.md` for the full SDK validation requirements. | ||
|
|
||
| To register a provider, open a pull request adding an entry to the `enum` in [`schemas/registry/providers.json`](schemas/registry/providers.json). Provider identifiers MUST be lowercase, start with a letter, and contain only alphanumeric characters and hyphens. Once merged, the value is considered stable and MUST NOT be renamed. |
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,126 @@ | ||
| { | ||
| "description": "Test vectors for domainId URN serialization. Each valid case specifies the logical segments and the expected serialized string. SDKs MUST produce the expected string from the given segments and MUST parse the expected string back to the same segments (round-trip).", | ||
| "valid": [ | ||
| { | ||
| "description": "GitHub PR, no provider-id", | ||
| "segments": { | ||
| "provider": "github", | ||
| "providerId": "", | ||
| "namespace": "xibz", | ||
| "groups": "cdevents-spec", | ||
| "type": "pr", | ||
| "resourceId": "42" | ||
| }, | ||
| "expected": "cdevents:v0:github::xibz:cdevents-spec:pr:42" | ||
| }, | ||
| { | ||
| "description": "GitHub PR with provider-id distinguishing two internal GitHub Enterprise deployments", | ||
| "segments": { | ||
| "provider": "github", | ||
| "providerId": "org-a-github", | ||
| "namespace": "xibz", | ||
| "groups": "cdevents-spec", | ||
| "type": "pr", | ||
| "resourceId": "42" | ||
| }, | ||
| "expected": "cdevents:v0:github:org-a-github:xibz:cdevents-spec:pr:42" | ||
| }, | ||
| { | ||
| "description": "Jira ticket, no provider-id", | ||
| "segments": { | ||
| "provider": "jira", | ||
| "providerId": "", | ||
| "namespace": "xibz", | ||
| "groups": "cdevents-project", | ||
| "type": "issue", | ||
| "resourceId": "PROJ-123" | ||
| }, | ||
| "expected": "cdevents:v0:jira::xibz:cdevents-project:issue:PROJ-123" | ||
| }, | ||
| { | ||
| "description": "GitLab MR with nested groups", | ||
| "segments": { | ||
| "provider": "gitlab", | ||
| "providerId": "", | ||
| "namespace": "my-company", | ||
| "groups": "platform/backend", | ||
| "type": "mr", | ||
| "resourceId": "99" | ||
| }, | ||
| "expected": "cdevents:v0:gitlab::my-company:platform/backend:mr:99" | ||
| }, | ||
| { | ||
| "description": "Datadog alert, no provider-id", | ||
| "segments": { | ||
| "provider": "datadog", | ||
| "providerId": "", | ||
| "namespace": "prod", | ||
| "groups": "api-monitors", | ||
| "type": "alert", | ||
| "resourceId": "98765" | ||
| }, | ||
| "expected": "cdevents:v0:datadog::prod:api-monitors:alert:98765" | ||
| }, | ||
| { | ||
| "description": "Docker artifact using PURL as resource id — provider, provider-id, namespace and groups all empty because registry is unknown", | ||
| "segments": { | ||
| "provider": "", | ||
| "providerId": "", | ||
| "namespace": "", | ||
| "groups": "", | ||
| "type": "artifact", | ||
| "resourceId": "pkg%3Adocker%2Fmyapp%401.0.0" | ||
| }, | ||
| "expected": "cdevents:v0:::::artifact:pkg%3Adocker%2Fmyapp%401.0.0" | ||
| }, | ||
| { | ||
| "description": "All optional segments empty — only type and resource id present; structurally valid", | ||
| "segments": { | ||
| "provider": "", | ||
| "providerId": "", | ||
| "namespace": "", | ||
| "groups": "", | ||
| "type": "pr", | ||
| "resourceId": "42" | ||
| }, | ||
| "expected": "cdevents:v0:::::pr:42" | ||
| } | ||
| ], | ||
| "invalid": [ | ||
| { | ||
| "description": "Missing provider-id segment (only 6 colons)", | ||
| "input": "cdevents:v0:github:xibz:cdevents-spec:pr:42", | ||
| "reason": "Segment count mismatch — provider-id segment omitted rather than left empty" | ||
| }, | ||
| { | ||
| "description": "Empty type", | ||
| "input": "cdevents:v0:github::xibz:cdevents-spec::42", | ||
| "reason": "type is required and must not be empty" | ||
| }, | ||
| { | ||
| "description": "Empty resource id", | ||
| "input": "cdevents:v0:github::xibz:cdevents-spec:pr:", | ||
| "reason": "resource id is required and must not be empty" | ||
| }, | ||
| { | ||
| "description": "Leading slash in groups", | ||
| "input": "cdevents:v0:github::xibz:/cdevents-spec:pr:42", | ||
| "reason": "Leading '/' in groups is invalid" | ||
| }, | ||
| { | ||
| "description": "Trailing slash in groups", | ||
| "input": "cdevents:v0:github::xibz:cdevents-spec/:pr:42", | ||
| "reason": "Trailing '/' in groups is invalid" | ||
| }, | ||
| { | ||
| "description": "Wrong version", | ||
| "input": "cdevents:v1:github::xibz:cdevents-spec:pr:42", | ||
| "reason": "Only v0 is currently defined" | ||
| }, | ||
| { | ||
| "description": "Wrong scheme prefix", | ||
| "input": "CDEvents:v0:github::xibz:cdevents-spec:pr:42", | ||
| "reason": "Scheme must be lowercase 'cdevents'" | ||
| } | ||
| ] | ||
| } |
Oops, something went wrong.
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.