-
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.
* Checkpoint. - 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. * Create devcontainer.json Signed-off-by: Michael D. Stemle, Jr. <mike.stemle@washpost.com> * Checkin - Started work on versioning. - Trying to get the Codespaces workflow going * Update devcontainer.json Signed-off-by: Michael D. Stemle, Jr. <mike.stemle@washpost.com> * Container checkin. * Checkpoint. * Got a bunch of field mappings done. * Got integrations and application in. - Also added some safeties * Primary fields are in the mapping now - Got the fields in - Got the tests working - Time to add convenience fields * Some convenience mappings added. * Tidying up some internal constants. * Mappings with versions are working now! - Org rule files are broken still - Documentation still needs to be updated * Tests are passing! - Still need to work on org-rules file functionality - Still need to update documentation * Massive documentation updates. - Added info about schema versions - Added examples showing the differences in schema versions - Still need to think about org rules file more * I think org rules files are done! * Version bump and docs. * Fixing versions in docs. --------- Signed-off-by: Michael D. Stemle, Jr. <mike.stemle@washpost.com>
- Loading branch information
1 parent
f0ab64e
commit 3ad03a5
Showing
26 changed files
with
5,710 additions
and
1,624 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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"image": "mcr.microsoft.com/devcontainers/typescript-node:20-buster", | ||
"features": { | ||
"ghcr.io/devcontainers-contrib/features/prettier:1": { | ||
"version": "latest" | ||
}, | ||
"ghcr.io/devcontainers-contrib/features/jest:2": { "version": "latest" } | ||
}, | ||
"customizations": { | ||
"vscode": { | ||
"extensions": ["Orta.vscode-jest", "esbenp.prettier-vscode"] | ||
} | ||
} | ||
} |
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 |
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
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.
87 changes: 87 additions & 0 deletions
87
__tests__/lib/__snapshots__/fieldMappings-schema.test.js.snap
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,87 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`constants convenienceFields 1`] = ` | ||
[ | ||
"email", | ||
"slack", | ||
"repo", | ||
"opsgenie", | ||
"pagerduty", | ||
"slack-support-channel", | ||
] | ||
`; | ||
|
||
exports[`constants mappings 1`] = ` | ||
{ | ||
"application": { | ||
"v2": [Function], | ||
"v2.1": [Function], | ||
}, | ||
"contacts": { | ||
"v2": [Function], | ||
"v2.1": [Function], | ||
}, | ||
"description": { | ||
"v2": [Function], | ||
"v2.1": [Function], | ||
}, | ||
"docs": { | ||
"v2": [Function], | ||
"v2.1": [Function], | ||
}, | ||
"integrations": { | ||
"v2": [Function], | ||
"v2.1": [Function], | ||
}, | ||
"lifecycle": { | ||
"v2": [Function], | ||
"v2.1": [Function], | ||
}, | ||
"links": { | ||
"v2": [Function], | ||
"v2.1": [Function], | ||
}, | ||
"repos": { | ||
"v2": [Function], | ||
"v2.1": [Function], | ||
}, | ||
"schema-version": { | ||
"v2": [Function], | ||
"v2.1": [Function], | ||
}, | ||
"service-name": { | ||
"v2": [Function], | ||
"v2.1": [Function], | ||
}, | ||
"tags": { | ||
"v2": [Function], | ||
"v2.1": [Function], | ||
}, | ||
"team": { | ||
"v2": [Function], | ||
"v2.1": [Function], | ||
}, | ||
"tier": { | ||
"v2": [Function], | ||
"v2.1": [Function], | ||
}, | ||
} | ||
`; | ||
|
||
exports[`constants schemaFields 1`] = ` | ||
[ | ||
"schema-version", | ||
"service-name", | ||
"team", | ||
"contacts", | ||
"tags", | ||
"links", | ||
"integrations", | ||
"docs", | ||
"repos", | ||
"application", | ||
"description", | ||
"tier", | ||
"lifecycle", | ||
] | ||
`; |
Oops, something went wrong.