-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Reconciling the schemas - Determining my path toward compatibility shifts I need to be able to use another machine for this as well, so I'll be committing incomplete changes.
- Loading branch information
1 parent
f0ab64e
commit f9c130f
Showing
7 changed files
with
256 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
tags | ||
node_modules/* | ||
coverage | ||
.nova |
212 changes: 212 additions & 0 deletions
212
__tests__/data/datadog-service-catalog-schema-v2.1.json
This file contains 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,212 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "https://github.com/DataDog/schema/tree/main/service-catalog/v2.1/schema.json", | ||
"title": "Service Definition Schema v2.1", | ||
"description": "A service definition for providing additional service metadata and integrations v2.1", | ||
"type": "object", | ||
"properties": { | ||
"schema-version": { | ||
"description": "Schema version being used", | ||
"examples": ["v2.1"], | ||
"type": "string", | ||
"default": "v2.1", | ||
"enum": ["v2.1"] | ||
}, | ||
"dd-service": { | ||
"description": "Unique identifier of the service. Must be unique across all services, and is used to match with a service in Datadog", | ||
"examples": ["my-service"], | ||
"type": "string" | ||
}, | ||
"team": { | ||
"description": "Team that owns the service. It is used to locate a team defined in Datadog Teams if it exists", | ||
"examples": ["my-team"], | ||
"type": "string" | ||
}, | ||
"application": { | ||
"description": "Identifier for a group of related services serving a product feature, which the service is a part of", | ||
"examples": ["my-app"], | ||
"type": "string" | ||
}, | ||
"description": { | ||
"description": "A short description of the service", | ||
"examples": ["My app description"], | ||
"type": "string" | ||
}, | ||
"tier": { | ||
"description": "Importance of the service", | ||
"examples": ["1", "High"], | ||
"type": "string" | ||
}, | ||
"lifecycle": { | ||
"description": "The current life cycle phase of the service.", | ||
"examples": ["sandbox", "staging", "production", "deprecated"], | ||
"type": "string" | ||
}, | ||
"contacts": { | ||
"description": "A list of contacts related to the services. ", | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/$defs/contact" | ||
} | ||
}, | ||
"links": { | ||
"description": "A list of links related to the services. ", | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/$defs/link" | ||
} | ||
}, | ||
"tags": { | ||
"description": "A set of custom tags", | ||
"examples": [["my:tag"]], | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"integrations": { | ||
"description": "Third party integrations that Datadog supports", | ||
"type": "object", | ||
"properties": { | ||
"pagerduty": { | ||
"description": "Pagerduty integration for the service", | ||
"type": "object", | ||
"properties": { | ||
"service-url": { | ||
"description": "Pagerduty Service URL", | ||
"examples": [ | ||
"https://my-org.pagerduty.com/service-directory/PMyService" | ||
], | ||
"type": "string", | ||
"pattern": "^(https?://)?[a-zA-Z\\d_\\-.]+\\.pagerduty\\.com/service-directory/(P[a-zA-Z\\d_\\-]+)/?$" | ||
} | ||
}, | ||
"required": ["service-url"], | ||
"additionalProperties": false | ||
}, | ||
"opsgenie": { | ||
"description": "Opsgenie integration for the service", | ||
"type": "object", | ||
"properties": { | ||
"service-url": { | ||
"description": "Opsgenie Service URL", | ||
"examples": [ | ||
"https://www.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000" | ||
], | ||
"type": "string", | ||
"pattern": "^(https?://)?[a-zA-Z\\d_\\-.]+\\.opsgenie\\.com/service/([a-zA-Z\\d_\\-]+)/?$" | ||
}, | ||
"region": { | ||
"description": "Opsgenie Instance Region", | ||
"type": "string", | ||
"examples": ["US", "EU"], | ||
"enum": ["US", "EU"] | ||
} | ||
}, | ||
"required": ["service-url"], | ||
"additionalProperties": false | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
"extensions": { | ||
"description": "Custom extensions", | ||
"type": "object", | ||
"additionalProperties": true | ||
} | ||
}, | ||
"additionalProperties": false, | ||
"required": ["schema-version", "dd-service"], | ||
"$defs": { | ||
"link": { | ||
"additionalProperties": false, | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"description": "Link name", | ||
"examples": ["Runbook", "Dashboard"], | ||
"type": "string" | ||
}, | ||
"type": { | ||
"description": "Link type", | ||
"examples": ["runbook", "doc"], | ||
"type": "string", | ||
"enum": ["doc", "runbook", "repo", "dashboard", "other"] | ||
}, | ||
"url": { | ||
"description": "Link url", | ||
"examples": ["https://my-runbook"], | ||
"type": "string", | ||
"format": "uri" | ||
}, | ||
"provider": { | ||
"description": "Link provider", | ||
"examples": ["Github", "Confluence"], | ||
"type": "string" | ||
} | ||
}, | ||
"required": ["name", "type", "url"] | ||
}, | ||
"contact": { | ||
"additionalProperties": false, | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"description": "Contact name", | ||
"examples": ["Oncall Slack", "Team Email"], | ||
"type": "string", | ||
"minLength": 2 | ||
}, | ||
"type": { | ||
"description": "Contact type", | ||
"examples": ["email", "slack", "microsoft-teams"], | ||
"type": "string", | ||
"enum": ["email", "slack", "microsoft-teams"] | ||
}, | ||
"contact": { | ||
"description": "Contact value", | ||
"examples": [ | ||
"contact@datadoghq.com", | ||
"https://my-org.slack.com/archives/my-channel" | ||
], | ||
"type": "string" | ||
} | ||
}, | ||
"allOf": [ | ||
{ | ||
"if": { | ||
"properties": { | ||
"type": { | ||
"const": "email" | ||
} | ||
} | ||
}, | ||
"then": { | ||
"properties": { | ||
"contact": { | ||
"format": "email" | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"if": { | ||
"properties": { | ||
"type": { | ||
"const": "slack" | ||
} | ||
} | ||
}, | ||
"then": { | ||
"properties": { | ||
"contact": { | ||
"pattern": "https://[a-zA-Z0-9_\\-]+.slack\\.com/archives/[a-zA-Z0-9_\\-]+" | ||
} | ||
} | ||
} | ||
} | ||
], | ||
"required": ["type", "contact"] | ||
} | ||
} | ||
} |
File renamed without changes.
This file contains 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
This file contains 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
This file contains 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
This file contains 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,12 @@ | ||
const VersionDifferences = { | ||
v2: { | ||
uniqueFields: ['docs', 'repos'], | ||
requiredFields: [], | ||
}, | ||
'v2.1': { | ||
uniqueFields: ['application', 'description', 'tier', 'lifecycle'], | ||
requiredFields: [], | ||
}, | ||
} | ||
|
||
Object.freeze(VersionDifferences) |