Skip to content

Commit

Permalink
Merge pull request #2553 from newrelic/campfire/schema/add-data-sourc…
Browse files Browse the repository at this point in the history
…e-ids

campfire/schema/add data source ids
  • Loading branch information
josephgregoryii authored Sep 11, 2024
2 parents 77df649 + 27ef019 commit b413c6f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 9 deletions.
7 changes: 7 additions & 0 deletions .github/actions/build-validate-artifact/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,21 @@ inputs:
output-artifact:
description: 'If provided, the action will output the artifact to the build directory'
required: false

runs:
using: composite
steps:
- name: Add data source ids to schema
shell: bash
run: |
cd utils && yarn add-datasource-ids
- name: Build & Validate Artifact
shell: bash
id: build-validate-artifact
run: |
cd utils && yarn build-validate-quickstart-artifact ${{ inputs.output-artifact && '--output-artifact' || '' }}
- name: Debugging output
shell: bash
if: ${{ runner.debug }}
Expand Down
6 changes: 3 additions & 3 deletions utils/schema/add-datasource-ids.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const CORE_DATASOURCE_IDS_PATH = './core-datasource-ids.json';
const DATASOURCE_BASE_PATH = '../../';

type ArtifactSchema = {
properties: {
definitions: {
dataSourceIds: {
enum: string[];
};
Expand Down Expand Up @@ -50,8 +50,8 @@ const updateSchema = (
): ArtifactSchema => {
return {
...schema,
properties: {
...schema.properties,
definitions: {
...schema.definitions,
dataSourceIds: { enum: ids },
},
};
Expand Down
18 changes: 12 additions & 6 deletions utils/schema/artifact.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"items": { "$ref": "#/definitions/dashboard" }
},
"dataSourceIds": {
"type": "array", "items": { "type": "string" }
"type": "array",
"items": { "$ref": "#/definitions/dataSourceIds" }
}
},
"required": [
Expand All @@ -41,7 +42,8 @@
"summary": { "type": "string" },
"title": { "type": "string" },
"authors": {
"type": "array", "items": { "type": "string" }
"type": "array",
"items": { "type": "string" }
},
"documentation": {
"type": "array",
Expand All @@ -59,17 +61,21 @@
"level": { "enum": ["New Relic", "Community", "Verified"] },
"icon": { "type": "string" },
"keywords": {
"type": "array", "items": { "type": "string" }
"type": "array",
"items": { "type": "string" }
},
"slug": { "type": "string" },
"alertPolicies": {
"type": "array", "items": { "type": "string" }
"type": "array",
"items": { "type": "string" }
},
"dashboards": {
"type": "array", "items": { "type": "string" }
"type": "array",
"items": { "type": "string" }
},
"dataSourceIds": {
"type": "array", "items": { "type": "string" }
"type": "array",
"items": { "$ref": "#/definitions/dataSourceIds" }
}
},
"required": [
Expand Down

0 comments on commit b413c6f

Please sign in to comment.