diff --git a/.changeset/gorgeous-games-build.md b/.changeset/gorgeous-games-build.md new file mode 100644 index 0000000000..ff050c43f6 --- /dev/null +++ b/.changeset/gorgeous-games-build.md @@ -0,0 +1,6 @@ +--- +'@backstage/plugin-rollbar': patch +'@backstage/plugin-rollbar-backend': patch +--- + +Add config schema for the rollbar & rollbar-backend plugins diff --git a/app-config.yaml b/app-config.yaml index fcc54a1a35..546d00466a 100644 --- a/app-config.yaml +++ b/app-config.yaml @@ -64,11 +64,6 @@ techdocs: sentry: organization: my-company -rollbar: - organization: my-company - accountToken: - $env: ROLLBAR_ACCOUNT_TOKEN - lighthouse: baseUrl: http://localhost:3003 diff --git a/packages/create-app/templates/default-app/packages/backend/package.json.hbs b/packages/create-app/templates/default-app/packages/backend/package.json.hbs index 179d604670..07d1b0be58 100644 --- a/packages/create-app/templates/default-app/packages/backend/package.json.hbs +++ b/packages/create-app/templates/default-app/packages/backend/package.json.hbs @@ -25,7 +25,6 @@ "@backstage/plugin-auth-backend": "^{{version '@backstage/plugin-auth-backend'}}", "@backstage/plugin-catalog-backend": "^{{version '@backstage/plugin-catalog-backend'}}", "@backstage/plugin-proxy-backend": "^{{version '@backstage/plugin-proxy-backend'}}", - "@backstage/plugin-rollbar-backend": "^{{version '@backstage/plugin-rollbar-backend'}}", "@backstage/plugin-scaffolder-backend": "^{{version '@backstage/plugin-scaffolder-backend'}}", "@backstage/plugin-techdocs-backend": "^{{version '@backstage/plugin-techdocs-backend'}}", "@octokit/rest": "^18.0.0", diff --git a/plugins/rollbar-backend/README.md b/plugins/rollbar-backend/README.md index 8f13eb5f26..6cf3b55948 100644 --- a/plugins/rollbar-backend/README.md +++ b/plugins/rollbar-backend/README.md @@ -8,7 +8,6 @@ The following values are read from the configuration file. ```yaml rollbar: - organization: organization-name accountToken: $env: ROLLBAR_ACCOUNT_TOKEN ``` diff --git a/plugins/rollbar-backend/config.d.ts b/plugins/rollbar-backend/config.d.ts new file mode 100644 index 0000000000..473b27a506 --- /dev/null +++ b/plugins/rollbar-backend/config.d.ts @@ -0,0 +1,26 @@ +/* + * Copyright 2020 Spotify AB + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface Config { + /** Configuration options for the rollbar-backend plugin */ + rollbar?: { + /** + * The autentication token for accessing the Rollbar API + * @see https://explorer.docs.rollbar.com/#section/Authentication + */ + accountToken: string; + }; +} diff --git a/plugins/rollbar-backend/package.json b/plugins/rollbar-backend/package.json index 307c37e0da..0f0b8bc366 100644 --- a/plugins/rollbar-backend/package.json +++ b/plugins/rollbar-backend/package.json @@ -42,6 +42,8 @@ "supertest": "^4.0.2" }, "files": [ - "dist" - ] + "dist", + "config.d.ts" + ], + "configSchema": "config.d.ts" } diff --git a/plugins/rollbar/README.md b/plugins/rollbar/README.md index a232462dde..cc862051f7 100644 --- a/plugins/rollbar/README.md +++ b/plugins/rollbar/README.md @@ -54,6 +54,7 @@ const ServiceEntityPage = ({ entity }: { entity: Entity }) => ( # app.config.yaml rollbar: organization: organization-name + # used by rollbar-backend accountToken: $env: ROLLBAR_ACCOUNT_TOKEN ``` diff --git a/plugins/rollbar/config.d.ts b/plugins/rollbar/config.d.ts new file mode 100644 index 0000000000..63526d19b0 --- /dev/null +++ b/plugins/rollbar/config.d.ts @@ -0,0 +1,27 @@ +/* + * Copyright 2020 Spotify AB + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface Config { + /** Configuration options for the rollbar plugin */ + rollbar?: { + /** + * The Rollbar organization name. This can be omitted by using the `rollbar.com/project-slug` annotation. + * @see https://backstage.io/docs/features/software-catalog/well-known-annotations#rollbarcomproject-slug + * @visibility frontend + */ + organization?: string; + }; +} diff --git a/plugins/rollbar/package.json b/plugins/rollbar/package.json index 1177a83eb6..64850c0dee 100644 --- a/plugins/rollbar/package.json +++ b/plugins/rollbar/package.json @@ -51,22 +51,8 @@ "msw": "^0.21.2" }, "files": [ - "dist" + "dist", + "config.d.ts" ], - "configSchema": { - "$schema": "https://backstage.io/schema/config-v1", - "title": "@backstage/rollbar", - "type": "object", - "properties": { - "rollbar": { - "type": "object", - "properties": { - "organization": { - "type": "string", - "visibility": "frontend" - } - } - } - } - } + "configSchema": "config.d.ts" }