Skip to content

Commit

Permalink
fix: Change authors to be a list of strings
Browse files Browse the repository at this point in the history
  • Loading branch information
josephgregoryii committed Oct 16, 2024
1 parent e2a8020 commit 0e28386
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 62 deletions.
5 changes: 3 additions & 2 deletions utils/lib/Quickstart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ class Quickstart {
*/
public transformForArtifact(): ArtifactQuickstartConfig {
const {
authors,
description,
title,
slug,
Expand All @@ -223,13 +222,13 @@ class Quickstart {
dataSourceIds,
id,
level,
authors = [],
dashboards = [],
alertPolicies = [],
} = this.config;

const metadata = {
quickstartUuid: id,
authors: authors && authors.map((author) => ({ name: author })),
description: description && description.trim(),
displayName: title && title.trim(),
slug: slug && slug.trim(),
Expand All @@ -252,8 +251,10 @@ class Quickstart {
dataSourceIds: dataSourceIds,
alertConditions: alertPolicies,
dashboards,
authors,
};


return metadata;
}

Expand Down
75 changes: 16 additions & 59 deletions utils/schema/artifact.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,7 @@
"authors": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
}
}
"type": "string"
}
},
"sourceUrl": {
Expand All @@ -90,21 +85,12 @@
"type": "string"
}
},
"required": [
"displayName",
"description",
"url"
],
"required": ["displayName", "description", "url"],
"additionalProperties": false
}
},
"supportLevel": {
"enum": [
"new_relic",
"community",
"verified",
"enterprise"
]
"enum": ["new_relic", "community", "verified", "enterprise"]
},
"iconUrl": {
"type": "string"
Expand Down Expand Up @@ -168,9 +154,7 @@
"$ref": "#/definitions/installDirective"
}
},
"required": [
"primary"
],
"required": ["primary"],
"additionalProperties": false
},
"keywords": {
Expand All @@ -189,11 +173,7 @@
"type": "string"
}
},
"required": [
"id",
"displayName",
"install"
],
"required": ["id", "displayName", "install"],
"additionalProperties": false
},
"installDirective": {
Expand All @@ -206,9 +186,7 @@
"type": "string"
}
},
"required": [
"url"
],
"required": ["url"],
"additionalProperties": false
},
{
Expand All @@ -224,10 +202,7 @@
"type": "boolean"
}
},
"required": [
"nerdletId",
"requiresAccount"
],
"required": ["nerdletId", "requiresAccount"],
"additionalProperties": false
}
]
Expand All @@ -238,21 +213,15 @@
"type": "object",
"properties": {
"type": {
"enum": [
"baseline",
"static"
],
"enum": ["baseline", "static"],
"type": "string",
"nullable": true
},
"displayName": {
"type": "string"
},
"description": {
"type": [
"string",
"null"
]
"type": ["string", "null"]
},
"rawConfiguration": {
"type": "string"
Expand All @@ -269,16 +238,11 @@
"type": "string"
}
},
"required": [
"url"
]
"required": ["url"]
}
}
},
"required": [
"displayName",
"rawConfiguration"
],
"required": ["displayName", "rawConfiguration"],
"additionalProperties": false
}
},
Expand All @@ -289,10 +253,7 @@
"type": "string"
},
"description": {
"type": [
"string",
"null"
]
"type": ["string", "null"]
},
"rawConfiguration": {
"type": "string"
Expand All @@ -309,16 +270,11 @@
"type": "string"
}
},
"required": [
"url"
]
"required": ["url"]
}
}
},
"required": [
"displayName",
"rawConfiguration"
],
"required": ["displayName", "rawConfiguration"],
"additionalProperties": false
},
"dataSourceIds": {
Expand Down Expand Up @@ -660,4 +616,5 @@
]
}
}
}
}

2 changes: 1 addition & 1 deletion utils/types/Artifact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export interface ArtifactQuickstartConfig {
alertConditions?: string[];
dashboards?: string[];
dataSourceIds?: string[];
authors: Array<{ name: string }>;
authors: string[];
};

/* -- Dashboard -- */
Expand Down

0 comments on commit 0e28386

Please sign in to comment.