From ae903f8e718d89cdff5538bf2d5c93ec7c59c360 Mon Sep 17 00:00:00 2001 From: Tavis Aitken Date: Tue, 27 Apr 2021 11:01:56 -0600 Subject: [PATCH 01/62] Added config schema to the Splunk On Call plugin. Signed-off-by: Tavis Aitken --- .changeset/fresh-vans-nail.md | 5 +++++ plugins/splunk-on-call/package.json | 6 ++++-- plugins/splunk-on-call/schema.d.ts | 26 ++++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 .changeset/fresh-vans-nail.md create mode 100644 plugins/splunk-on-call/schema.d.ts diff --git a/.changeset/fresh-vans-nail.md b/.changeset/fresh-vans-nail.md new file mode 100644 index 0000000000..64af4ee60b --- /dev/null +++ b/.changeset/fresh-vans-nail.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-splunk-on-call': patch +--- + +Added config schema to expose `splunkOnCall.eventsRestEndpoint` config option to the frontend diff --git a/plugins/splunk-on-call/package.json b/plugins/splunk-on-call/package.json index 9e93004bf5..b033b41e75 100644 --- a/plugins/splunk-on-call/package.json +++ b/plugins/splunk-on-call/package.json @@ -59,6 +59,8 @@ "node-fetch": "^2.6.1" }, "files": [ - "dist" - ] + "dist", + "schema.d.ts" + ], + "configSchema": "schema.d.ts" } diff --git a/plugins/splunk-on-call/schema.d.ts b/plugins/splunk-on-call/schema.d.ts new file mode 100644 index 0000000000..b14f2ef110 --- /dev/null +++ b/plugins/splunk-on-call/schema.d.ts @@ -0,0 +1,26 @@ +/* + * Copyright 2021 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 { + /** + * Splunk On Call Plugin specific configs + */ + splunkOnCall: { + /** + * @visibility frontend + */ + eventsRestEndpoint: string; + }; +} From 8650112701671551b34cc553abfaf6db24cf3cd9 Mon Sep 17 00:00:00 2001 From: Johan Haals Date: Thu, 3 Jun 2021 09:49:18 +0200 Subject: [PATCH 02/62] Catalog: Enable new processing engine Signed-off-by: Johan Haals --- packages/backend/src/plugins/catalog.ts | 44 ++-- .../20210302150147_refresh_state.js | 0 .../migrationsv2/20200511113813_init.js | 133 ---------- ...0200520140700_location_update_log_table.js | 43 ---- ...7114117_location_update_log_latest_view.js | 45 ---- .../migrationsv2/20200702153613_entities.js | 236 ------------------ ..._location_update_log_latest_deduplicate.js | 44 ---- ...904_location_update_log_duplication_fix.js | 87 ------- .../20200807120600_entitySearch.js | 41 --- .../20200809202832_add_bootstrap_location.js | 42 ---- .../20200923104503_case_insensitivity.js | 32 --- .../20201005122705_add_entity_full_name.js | 60 ----- .../20201006130744_entity_data_column.js | 66 ----- ...6203131_entity_remove_redundant_columns.js | 50 ---- .../20201007201501_index_entity_search.js | 37 --- .../20201019130742_add_relations_table.js | 54 ---- .../20201123205611_relations_table_uniq.js | 93 ------- .../migrationsv2/20201210185851_fk_index.js | 45 ---- .../20201230103504_update_log_varchar.js | 73 ------ .../20210209121210_locations_fk_index.js | 45 ---- .../src/next/NextCatalogBuilder.ts | 2 +- 21 files changed, 23 insertions(+), 1249 deletions(-) rename plugins/catalog-backend/{migrationsv2 => migrations}/20210302150147_refresh_state.js (100%) delete mode 100644 plugins/catalog-backend/migrationsv2/20200511113813_init.js delete mode 100644 plugins/catalog-backend/migrationsv2/20200520140700_location_update_log_table.js delete mode 100644 plugins/catalog-backend/migrationsv2/20200527114117_location_update_log_latest_view.js delete mode 100644 plugins/catalog-backend/migrationsv2/20200702153613_entities.js delete mode 100644 plugins/catalog-backend/migrationsv2/20200721115244_location_update_log_latest_deduplicate.js delete mode 100644 plugins/catalog-backend/migrationsv2/20200805163904_location_update_log_duplication_fix.js delete mode 100644 plugins/catalog-backend/migrationsv2/20200807120600_entitySearch.js delete mode 100644 plugins/catalog-backend/migrationsv2/20200809202832_add_bootstrap_location.js delete mode 100644 plugins/catalog-backend/migrationsv2/20200923104503_case_insensitivity.js delete mode 100644 plugins/catalog-backend/migrationsv2/20201005122705_add_entity_full_name.js delete mode 100644 plugins/catalog-backend/migrationsv2/20201006130744_entity_data_column.js delete mode 100644 plugins/catalog-backend/migrationsv2/20201006203131_entity_remove_redundant_columns.js delete mode 100644 plugins/catalog-backend/migrationsv2/20201007201501_index_entity_search.js delete mode 100644 plugins/catalog-backend/migrationsv2/20201019130742_add_relations_table.js delete mode 100644 plugins/catalog-backend/migrationsv2/20201123205611_relations_table_uniq.js delete mode 100644 plugins/catalog-backend/migrationsv2/20201210185851_fk_index.js delete mode 100644 plugins/catalog-backend/migrationsv2/20201230103504_update_log_varchar.js delete mode 100644 plugins/catalog-backend/migrationsv2/20210209121210_locations_fk_index.js diff --git a/packages/backend/src/plugins/catalog.ts b/packages/backend/src/plugins/catalog.ts index 63a3e53c81..8474478f9e 100644 --- a/packages/backend/src/plugins/catalog.ts +++ b/packages/backend/src/plugins/catalog.ts @@ -29,49 +29,49 @@ export default async function createPlugin( env: PluginEnvironment, ): Promise { /* - * ** WARNING ** - * DO NOT enable the experimental catalog, it will brick your database migrations. - * This is solely for internal backstage development. + * This environment variable exists as an emergency option during the release + * of the new catalog processing engine. + * If you experience any issues, make sure to report them as this flag + * will be removed in a subsequent release. */ - if (process.env.EXPERIMENTAL_CATALOG === '1') { - const builder = new NextCatalogBuilder(env); + if (process.env.LEGACY_CATALOG === '1') { + const builder = new CatalogBuilder(env); const { entitiesCatalog, + locationsCatalog, + higherOrderOperation, locationAnalyzer, - processingEngine, - locationService, } = await builder.build(); - // TODO(jhaals): run and manage in background. - await processingEngine.start(); + useHotCleanup( + module, + runPeriodically(() => higherOrderOperation.refreshAllLocations(), 100000), + ); - return await createNextRouter({ + return await createRouter({ entitiesCatalog, + locationsCatalog, + higherOrderOperation, locationAnalyzer, - locationService, logger: env.logger, config: env.config, }); } - - const builder = new CatalogBuilder(env); + const builder = new NextCatalogBuilder(env); const { entitiesCatalog, - locationsCatalog, - higherOrderOperation, locationAnalyzer, + processingEngine, + locationService, } = await builder.build(); - useHotCleanup( - module, - runPeriodically(() => higherOrderOperation.refreshAllLocations(), 100000), - ); + // TODO(jhaals): run and manage in background. + await processingEngine.start(); - return await createRouter({ + return await createNextRouter({ entitiesCatalog, - locationsCatalog, - higherOrderOperation, locationAnalyzer, + locationService, logger: env.logger, config: env.config, }); diff --git a/plugins/catalog-backend/migrationsv2/20210302150147_refresh_state.js b/plugins/catalog-backend/migrations/20210302150147_refresh_state.js similarity index 100% rename from plugins/catalog-backend/migrationsv2/20210302150147_refresh_state.js rename to plugins/catalog-backend/migrations/20210302150147_refresh_state.js diff --git a/plugins/catalog-backend/migrationsv2/20200511113813_init.js b/plugins/catalog-backend/migrationsv2/20200511113813_init.js deleted file mode 100644 index 7f3d75e35c..0000000000 --- a/plugins/catalog-backend/migrationsv2/20200511113813_init.js +++ /dev/null @@ -1,133 +0,0 @@ -/* - * 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. - */ - -// @ts-check - -/** - * @param {import('knex').Knex} knex - */ -exports.up = async function up(knex) { - return ( - knex.schema - // - // locations - // - .createTable('locations', table => { - table.comment( - 'Registered locations that shall be contiuously scanned for catalog item updates', - ); - table - .uuid('id') - .primary() - .notNullable() - .comment('Auto-generated ID of the location'); - table.string('type').notNullable().comment('The type of location'); - table - .string('target') - .notNullable() - .comment('The actual target of the location'); - }) - // - // entities - // - .createTable('entities', table => { - table.comment('All entities currently stored in the catalog'); - table.uuid('id').primary().comment('Auto-generated ID of the entity'); - table - .uuid('location_id') - .references('id') - .inTable('locations') - .nullable() - .comment('The location that originated the entity'); - table - .string('etag') - .notNullable() - .comment( - 'An opaque string that changes for each update operation to any part of the entity, including metadata.', - ); - table - .string('generation') - .notNullable() - .unsigned() - .comment( - 'A positive nonzero number that indicates the current generation of data for this entity; the value is incremented each time the spec changes.', - ); - table - .string('api_version') - .notNullable() - .comment('The apiVersion field of the entity'); - table - .string('kind') - .notNullable() - .comment('The kind field of the entity'); - table - .string('name') - .nullable() - .comment('The metadata.name field of the entity'); - table - .string('namespace') - .nullable() - .comment('The metadata.namespace field of the entity'); - table - .string('metadata') - .notNullable() - .comment('The entire metadata JSON blob of the entity'); - table - .string('spec') - .nullable() - .comment('The entire spec JSON blob of the entity'); - }) - .alterTable('entities', table => { - // https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#objectmeta-v1-meta - table.unique(['kind', 'name', 'namespace'], 'entities_unique_name'); - }) - // - // entities_search - // - .createTable('entities_search', table => { - table.comment( - 'Flattened key-values from the entities, used for quick filtering', - ); - table - .uuid('entity_id') - .references('id') - .inTable('entities') - .onDelete('CASCADE') - .comment('The entity that matches this key/value'); - table - .string('key') - .notNullable() - .comment('A key that occurs in the entity'); - table - .string('value') - .nullable() - .comment('The corresponding value to match on'); - }) - ); -}; - -/** - * @param {import('knex').Knex} knex - */ -exports.down = async function down(knex) { - return knex.schema - .dropTable('entities_search') - .alterTable('entities', table => { - table.dropUnique([], 'entities_unique_name'); - }) - .dropTable('entities') - .dropTable('locations'); -}; diff --git a/plugins/catalog-backend/migrationsv2/20200520140700_location_update_log_table.js b/plugins/catalog-backend/migrationsv2/20200520140700_location_update_log_table.js deleted file mode 100644 index d8093fc9b4..0000000000 --- a/plugins/catalog-backend/migrationsv2/20200520140700_location_update_log_table.js +++ /dev/null @@ -1,43 +0,0 @@ -/* - * 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. - */ - -// @ts-check - -/** - * @param {import('knex').Knex} knex - */ -exports.up = async function up(knex) { - return knex.schema.createTable('location_update_log', table => { - table.uuid('id').primary(); - table.enum('status', ['success', 'fail']).notNullable(); - table.dateTime('created_at').defaultTo(knex.fn.now()).notNullable(); - table.string('message'); - table - .uuid('location_id') - .references('id') - .inTable('locations') - .onUpdate('CASCADE') - .onDelete('CASCADE'); - table.string('entity_name').nullable(); - }); -}; - -/** - * @param {import('knex').Knex} knex - */ -exports.down = async function down(knex) { - return knex.schema.dropTableIfExists('location_update_log'); -}; diff --git a/plugins/catalog-backend/migrationsv2/20200527114117_location_update_log_latest_view.js b/plugins/catalog-backend/migrationsv2/20200527114117_location_update_log_latest_view.js deleted file mode 100644 index a0f0f33a65..0000000000 --- a/plugins/catalog-backend/migrationsv2/20200527114117_location_update_log_latest_view.js +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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. - */ - -// @ts-check - -/** - * @param {import('knex').Knex} knex - */ -exports.up = async function up(knex) { - // Get list sorted by created_at timestamp in descending order - // Grouped by location_id - return knex.schema.raw(` - CREATE VIEW location_update_log_latest AS - SELECT t1.* FROM location_update_log t1 - JOIN - ( - SELECT location_id, MAX(created_at) AS MAXDATE - FROM location_update_log - GROUP BY location_id - ) t2 - ON t1.location_id = t2.location_id - AND t1.created_at = t2.MAXDATE - ORDER BY created_at DESC; - `); -}; - -/** - * @param {import('knex').Knex} knex - */ -exports.down = async function down(knex) { - return knex.schema.raw(`DROP VIEW location_update_log_latest;`); -}; diff --git a/plugins/catalog-backend/migrationsv2/20200702153613_entities.js b/plugins/catalog-backend/migrationsv2/20200702153613_entities.js deleted file mode 100644 index 0f1c204f9b..0000000000 --- a/plugins/catalog-backend/migrationsv2/20200702153613_entities.js +++ /dev/null @@ -1,236 +0,0 @@ -/* - * 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. - */ - -// @ts-check - -/** - * @param {import('knex').Knex} knex - */ -exports.up = async function up(knex) { - // SQLite does not support FK and PK - if (knex.client.config.client !== 'sqlite3') { - await knex.schema.alterTable('entities_search', table => { - table.dropForeign(['entity_id']); - }); - await knex.schema.alterTable('entities', table => { - table.dropPrimary('entities_pkey'); - }); - } - await knex.schema.alterTable('entities', table => { - table.dropUnique([], 'entities_unique_name'); - }); - // Setup temporary tables - await knex.schema.renameTable('entities_search', 'tmp_entities_search'); - await knex.schema.renameTable('entities', 'tmp_entities'); - - // - // entities - // - await knex.schema - .createTable('entities', table => { - table.comment('All entities currently stored in the catalog'); - table.uuid('id').primary().comment('Auto-generated ID of the entity'); - table - .uuid('location_id') - .references('id') - .inTable('locations') - .nullable() - .comment('The location that originated the entity'); - table - .string('etag') - .notNullable() - .comment( - 'An opaque string that changes for each update operation to any part of the entity, including metadata.', - ); - table - .string('generation') - .notNullable() - .unsigned() - .comment( - 'A positive nonzero number that indicates the current generation of data for this entity; the value is incremented each time the spec changes.', - ); - table - .string('api_version') - .notNullable() - .comment('The apiVersion field of the entity'); - table - .string('kind') - .notNullable() - .comment('The kind field of the entity'); - table - .string('name') - .nullable() - .comment('The metadata.name field of the entity'); - table - .string('namespace') - .nullable() - .comment('The metadata.namespace field of the entity'); - table - .text('metadata') - .notNullable() - .comment('The entire metadata JSON blob of the entity'); - table - .text('spec') - .nullable() - .comment('The entire spec JSON blob of the entity'); - }) - .alterTable('entities', table => { - // https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#objectmeta-v1-meta - table.unique(['kind', 'name', 'namespace'], 'entities_unique_name'); - }); - - await knex.schema.raw(`INSERT INTO entities SELECT * FROM tmp_entities`); - - // - // entities_search - // - await knex.schema.createTable('entities_search', table => { - table.comment( - 'Flattened key-values from the entities, used for quick filtering', - ); - table - .uuid('entity_id') - .references('id') - .inTable('entities') - .onDelete('CASCADE') - .comment('The entity that matches this key/value'); - table - .string('key') - .notNullable() - .comment('A key that occurs in the entity'); - table - .string('value') - .nullable() - .comment('The corresponding value to match on'); - }); - await knex.schema.raw( - `INSERT INTO entities_search SELECT * FROM tmp_entities_search`, - ); - - // Clean up - await knex.schema.dropTable('tmp_entities'); - return knex.schema.dropTable('tmp_entities_search'); -}; - -/** - * @param {import('knex').Knex} knex - */ -exports.down = async function down(knex) { - // SQLite does not support FK and PK - if (knex.client.config.client !== 'sqlite3') { - await knex.schema.alterTable('entities_search', table => { - table.dropForeign(['entity_id']); - }); - await knex.schema.alterTable('entities', table => { - table.dropPrimary('entities_pkey'); - }); - } - await knex.schema.alterTable('entities', table => { - table.dropUnique([], 'entities_unique_name'); - }); - - // Setup temporary tables - await knex.schema.renameTable('entities_search', 'tmp_entities_search'); - await knex.schema.renameTable('entities', 'tmp_entities'); - - // - // entities - // - await knex.schema - .createTable('entities', table => { - table.comment('All entities currently stored in the catalog'); - table.uuid('id').primary().comment('Auto-generated ID of the entity'); - table - .uuid('location_id') - .references('id') - .inTable('locations') - .nullable() - .comment('The location that originated the entity'); - table - .string('etag') - .notNullable() - .comment( - 'An opaque string that changes for each update operation to any part of the entity, including metadata.', - ); - table - .string('generation') - .notNullable() - .unsigned() - .comment( - 'A positive nonzero number that indicates the current generation of data for this entity; the value is incremented each time the spec changes.', - ); - table - .string('api_version') - .notNullable() - .comment('The apiVersion field of the entity'); - table - .string('kind') - .notNullable() - .comment('The kind field of the entity'); - table - .string('name') - .nullable() - .comment('The metadata.name field of the entity'); - table - .string('namespace') - .nullable() - .comment('The metadata.namespace field of the entity'); - table - .string('metadata') - .notNullable() - .comment('The entire metadata JSON blob of the entity'); - table - .string('spec') - .nullable() - .comment('The entire spec JSON blob of the entity'); - }) - .alterTable('entities', table => { - // https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#objectmeta-v1-meta - table.unique(['kind', 'name', 'namespace'], 'entities_unique_name'); - }); - - await knex.schema.raw(`INSERT INTO entities SELECT * FROM tmp_entities`); - - // - // entities_search - // - await knex.schema.createTable('entities_search', table => { - table.comment( - 'Flattened key-values from the entities, used for quick filtering', - ); - table - .uuid('entity_id') - .references('id') - .inTable('entities') - .onDelete('CASCADE') - .comment('The entity that matches this key/value'); - table - .string('key') - .notNullable() - .comment('A key that occurs in the entity'); - table - .string('value') - .nullable() - .comment('The corresponding value to match on'); - }); - await knex.schema.raw( - `INSERT INTO entities_search SELECT * FROM tmp_entities_search`, - ); - - // Clean up - await knex.schema.dropTable('tmp_entities'); - return knex.schema.dropTable('tmp_entities_search'); -}; diff --git a/plugins/catalog-backend/migrationsv2/20200721115244_location_update_log_latest_deduplicate.js b/plugins/catalog-backend/migrationsv2/20200721115244_location_update_log_latest_deduplicate.js deleted file mode 100644 index 87b41a80fc..0000000000 --- a/plugins/catalog-backend/migrationsv2/20200721115244_location_update_log_latest_deduplicate.js +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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. - */ - -// @ts-check - -/** - * @param {import('knex').Knex} knex - */ -exports.up = function up(knex) { - return knex.schema.raw(`DROP VIEW location_update_log_latest;`).raw(` - CREATE VIEW location_update_log_latest AS - SELECT t1.* FROM location_update_log t1 - JOIN - ( - SELECT location_id, MAX(created_at) AS MAXDATE - FROM location_update_log - GROUP BY location_id - ) t2 - ON t1.location_id = t2.location_id - AND t1.created_at = t2.MAXDATE - GROUP BY t1.location_id, t1.id - ORDER BY created_at DESC; -`); -}; - -/** - * @param {import('knex').Knex} knex - */ -exports.down = function down(knex) { - knex.schema.raw(`DROP VIEW location_update_log_latest;`); -}; diff --git a/plugins/catalog-backend/migrationsv2/20200805163904_location_update_log_duplication_fix.js b/plugins/catalog-backend/migrationsv2/20200805163904_location_update_log_duplication_fix.js deleted file mode 100644 index de2b194cff..0000000000 --- a/plugins/catalog-backend/migrationsv2/20200805163904_location_update_log_duplication_fix.js +++ /dev/null @@ -1,87 +0,0 @@ -/* - * 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. - */ - -// @ts-check - -/** - * @param {import('knex').Knex} knex - */ -exports.up = function up(knex) { - return knex.schema - .raw('DROP VIEW location_update_log_latest;') - .dropTable('location_update_log') - .createTable('location_update_log', table => { - table.bigIncrements('id').primary(); // instead of uuid, so we can MAX it - table.enum('status', ['success', 'fail']).notNullable(); - table.dateTime('created_at').defaultTo(knex.fn.now()).notNullable(); - table.string('message'); - table - .uuid('location_id') - .references('id') - .inTable('locations') - .onUpdate('CASCADE') - .onDelete('CASCADE'); - table.string('entity_name').nullable(); - }).raw(` - CREATE VIEW location_update_log_latest AS - SELECT t1.* FROM location_update_log t1 - JOIN - ( - SELECT location_id, MAX(id) AS MAXID - FROM location_update_log - GROUP BY location_id - ) t2 - ON t1.location_id = t2.location_id - AND t1.id = t2.MAXID - GROUP BY t1.location_id, t1.id - ORDER BY created_at DESC; - `); -}; - -/** - * @param {import('knex').Knex} knex - */ -exports.down = function down(knex) { - return knex.schema - .raw('DROP VIEW location_update_log_latest;') - .dropTable('location_update_log') - .createTable('location_update_log', table => { - table.uuid('id').primary(); - table.enum('status', ['success', 'fail']).notNullable(); - table.dateTime('created_at').defaultTo(knex.fn.now()).notNullable(); - table.string('message'); - table - .uuid('location_id') - .references('id') - .inTable('locations') - .onUpdate('CASCADE') - .onDelete('CASCADE'); - table.string('entity_name').nullable(); - }).raw(` - CREATE VIEW location_update_log_latest AS - SELECT t1.* FROM location_update_log t1 - JOIN - ( - SELECT location_id, MAX(created_at) AS MAXDATE - FROM location_update_log - GROUP BY location_id - ) t2 - ON t1.location_id = t2.location_id - AND t1.created_at = t2.MAXDATE - GROUP BY t1.location_id, t1.id - ORDER BY created_at DESC; - `); -}; diff --git a/plugins/catalog-backend/migrationsv2/20200807120600_entitySearch.js b/plugins/catalog-backend/migrationsv2/20200807120600_entitySearch.js deleted file mode 100644 index 45226e53b4..0000000000 --- a/plugins/catalog-backend/migrationsv2/20200807120600_entitySearch.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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. - */ - -// @ts-check - -/** - * @param {import('knex').Knex} knex - */ -exports.up = async function up(knex) { - // Sqlite does not support alter column. - if (knex.client.config.client !== 'sqlite3') { - await knex.schema.alterTable('entities_search', table => { - table.text('value').nullable().alter(); - }); - } -}; - -/** - * @param {import('knex').Knex} knex - */ -exports.down = async function down(knex) { - // Sqlite does not support alter column. - if (knex.client.config.client !== 'sqlite3') { - await knex.schema.alterTable('entities_search', table => { - table.string('value').nullable().alter(); - }); - } -}; diff --git a/plugins/catalog-backend/migrationsv2/20200809202832_add_bootstrap_location.js b/plugins/catalog-backend/migrationsv2/20200809202832_add_bootstrap_location.js deleted file mode 100644 index a90813fe85..0000000000 --- a/plugins/catalog-backend/migrationsv2/20200809202832_add_bootstrap_location.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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. - */ - -// @ts-check - -/** - * @param {import('knex').Knex} knex - */ -exports.up = async function up(knex) { - // Adds a single 'bootstrap' location that can be used to trigger work in processors. - // This is primarily here to fulfill foreign key constraints. - await knex('locations').insert({ - id: require('uuid').v4(), - type: 'bootstrap', - target: 'bootstrap', - }); -}; - -/** - * @param {import('knex').Knex} knex - */ -exports.down = async function down(knex) { - await knex('locations') - .where({ - type: 'bootstrap', - target: 'bootstrap', - }) - .del(); -}; diff --git a/plugins/catalog-backend/migrationsv2/20200923104503_case_insensitivity.js b/plugins/catalog-backend/migrationsv2/20200923104503_case_insensitivity.js deleted file mode 100644 index ea5ba9e58d..0000000000 --- a/plugins/catalog-backend/migrationsv2/20200923104503_case_insensitivity.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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. - */ - -// @ts-check - -/** - * @param {import('knex').Knex} knex - */ -exports.up = async function up(knex) { - await knex('entities') - .where({ namespace: null }) - .update({ namespace: 'default' }); - await knex('entities_search').update({ - key: knex.raw('LOWER(key)'), - value: knex.raw('LOWER(value)'), - }); -}; - -exports.down = async function down() {}; diff --git a/plugins/catalog-backend/migrationsv2/20201005122705_add_entity_full_name.js b/plugins/catalog-backend/migrationsv2/20201005122705_add_entity_full_name.js deleted file mode 100644 index aae1861658..0000000000 --- a/plugins/catalog-backend/migrationsv2/20201005122705_add_entity_full_name.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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. - */ - -// @ts-check - -/** - * @param {import('knex').Knex} knex - */ -exports.up = async function up(knex) { - await knex.schema.alterTable('entities', table => { - table.text('full_name').nullable(); - }); - - await knex('entities').update({ - full_name: knex.raw( - "LOWER(kind) || ':' || LOWER(COALESCE(namespace, 'default')) || '/' || LOWER(name)", - ), - }); - - // SQLite does not support alter column - if (knex.client.config.client !== 'sqlite3') { - await knex.schema.alterTable('entities', table => { - table.text('full_name').notNullable().alter(); - }); - } - - await knex.schema.alterTable('entities', table => { - // https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#objectmeta-v1-meta - table.unique(['full_name'], 'entities_unique_full_name'); - table.dropUnique([], 'entities_unique_name'); - }); -}; - -/** - * @param {import('knex').Knex} knex - */ -exports.down = async function down(knex) { - await knex.schema.alterTable('entities', table => { - // https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#objectmeta-v1-meta - table.dropUnique([], 'entities_unique_full_name'); - table.unique(['kind', 'namespace', 'name'], 'entities_unique_name'); - }); - - await knex.schema.alterTable('entities_search', table => { - table.dropColumn('full_name'); - }); -}; diff --git a/plugins/catalog-backend/migrationsv2/20201006130744_entity_data_column.js b/plugins/catalog-backend/migrationsv2/20201006130744_entity_data_column.js deleted file mode 100644 index a8964efbf6..0000000000 --- a/plugins/catalog-backend/migrationsv2/20201006130744_entity_data_column.js +++ /dev/null @@ -1,66 +0,0 @@ -/* - * 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. - */ - -// @ts-check - -/** - * @param {import('knex').Knex} knex - */ -exports.up = async function up(knex) { - await knex.schema.alterTable('entities', table => { - table - .text('data') - .nullable() - .comment('The entire JSON data blob of the entity'); - }); - - await knex('entities').update({ - // apiVersion and kind should not contain any JSON unsafe chars, and both - // metadata and spec are already valid serialized JSON - data: knex.raw( - `'{"apiVersion":"' || api_version || '","kind":"' || kind || '","metadata":' || metadata || COALESCE(',"spec":' || spec, '') || '}'`, - ), - }); - - await knex.schema.alterTable('entities', table => { - table.dropColumn('metadata'); - table.dropColumn('spec'); - }); - - // SQLite does not support ALTER COLUMN. - if (knex.client.config.client !== 'sqlite3') { - await knex.schema.alterTable('entities', table => { - table.text('data').notNullable().alter(); - }); - } -}; - -/** - * @param {import('knex').Knex} knex - */ -exports.down = async function down(knex) { - await knex.schema.alterTable('entities', table => { - table - .text('metadata') - .notNullable() - .comment('The entire metadata JSON blob of the entity'); - table - .text('spec') - .nullable() - .comment('The entire spec JSON blob of the entity'); - table.dropColumn('data'); - }); -}; diff --git a/plugins/catalog-backend/migrationsv2/20201006203131_entity_remove_redundant_columns.js b/plugins/catalog-backend/migrationsv2/20201006203131_entity_remove_redundant_columns.js deleted file mode 100644 index f40df5f73e..0000000000 --- a/plugins/catalog-backend/migrationsv2/20201006203131_entity_remove_redundant_columns.js +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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. - */ - -// @ts-check - -/** - * @param {import('knex').Knex} knex - */ -exports.up = async function up(knex) { - await knex.schema.alterTable('entities', table => { - table.dropColumn('api_version'); - table.dropColumn('kind'); - table.dropColumn('name'); - table.dropColumn('namespace'); - }); -}; - -/** - * @param {import('knex').Knex} knex - */ -exports.down = async function down(knex) { - await knex.schema.alterTable('entities', table => { - table - .string('api_version') - .notNullable() - .comment('The apiVersion field of the entity'); - table.string('kind').notNullable().comment('The kind field of the entity'); - table - .string('name') - .nullable() - .comment('The metadata.name field of the entity'); - table - .string('namespace') - .nullable() - .comment('The metadata.namespace field of the entity'); - }); -}; diff --git a/plugins/catalog-backend/migrationsv2/20201007201501_index_entity_search.js b/plugins/catalog-backend/migrationsv2/20201007201501_index_entity_search.js deleted file mode 100644 index 77bf0529eb..0000000000 --- a/plugins/catalog-backend/migrationsv2/20201007201501_index_entity_search.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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. - */ - -// @ts-check - -/** - * @param {import('knex').Knex} knex - */ -exports.up = async function up(knex) { - await knex.schema.alterTable('entities_search', table => { - table.index(['key'], 'entities_search_key'); - table.index(['value'], 'entities_search_value'); - }); -}; - -/** - * @param {import('knex').Knex} knex - */ -exports.down = async function down(knex) { - await knex.schema.alterTable('entities_search', table => { - table.dropIndex('', 'entities_search_key'); - table.dropIndex('', 'entities_search_value'); - }); -}; diff --git a/plugins/catalog-backend/migrationsv2/20201019130742_add_relations_table.js b/plugins/catalog-backend/migrationsv2/20201019130742_add_relations_table.js deleted file mode 100644 index 85e729f814..0000000000 --- a/plugins/catalog-backend/migrationsv2/20201019130742_add_relations_table.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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. - */ - -// @ts-check - -/** - * @param {import('knex').Knex} knex - */ -exports.up = async function up(knex) { - await knex.schema.createTable('entities_relations', table => { - table.comment('All relations between entities in the catalog'); - table - .uuid('originating_entity_id') - .references('id') - .inTable('entities') - .onDelete('CASCADE') - .notNullable() - .comment('The entity that provided the relation'); - table - .string('source_full_name') - .notNullable() - .comment('The full name of the source entity of the relation'); - table - .string('type') - .notNullable() - .comment('The type of the relation between the entities'); - table - .string('target_full_name') - .notNullable() - .comment('The full name of the target entity of the relation'); - - table.primary(['source_full_name', 'type', 'target_full_name']); - }); -}; - -/** - * @param {import('knex').Knex} knex - */ -exports.down = async function down(knex) { - await knex.schema.dropTable('entities_relations'); -}; diff --git a/plugins/catalog-backend/migrationsv2/20201123205611_relations_table_uniq.js b/plugins/catalog-backend/migrationsv2/20201123205611_relations_table_uniq.js deleted file mode 100644 index 9e8198b5eb..0000000000 --- a/plugins/catalog-backend/migrationsv2/20201123205611_relations_table_uniq.js +++ /dev/null @@ -1,93 +0,0 @@ -/* - * 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. - */ - -// @ts-check - -/** - * @param {import('knex').Knex} knex - */ -exports.up = async function up(knex) { - if (knex.client.config.client === 'sqlite3') { - // sqlite doesn't support dropPrimary so we recreate it properly instead - await knex.schema.dropTable('entities_relations'); - await knex.schema.createTable('entities_relations', table => { - table.comment('All relations between entities in the catalog'); - table - .uuid('originating_entity_id') - .references('id') - .inTable('entities') - .onDelete('CASCADE') - .notNullable() - .comment('The entity that provided the relation'); - table - .string('source_full_name') - .notNullable() - .comment('The full name of the source entity of the relation'); - table - .string('type') - .notNullable() - .comment('The type of the relation between the entities'); - table - .string('target_full_name') - .notNullable() - .comment('The full name of the target entity of the relation'); - table.index('source_full_name', 'source_full_name_idx'); - }); - } else { - await knex.schema.alterTable('entities_relations', table => { - table.dropPrimary(); - table.index('source_full_name', 'source_full_name_idx'); - }); - } -}; - -/** - * @param {import('knex').Knex} knex - */ -exports.down = async function down(knex) { - if (knex.client.config.client === 'sqlite3') { - await knex.schema.dropTable('entities_relations'); - await knex.schema.createTable('entities_relations', table => { - table.comment('All relations between entities in the catalog'); - table - .uuid('originating_entity_id') - .references('id') - .inTable('entities') - .onDelete('CASCADE') - .notNullable() - .comment('The entity that provided the relation'); - table - .string('source_full_name') - .notNullable() - .comment('The full name of the source entity of the relation'); - table - .string('type') - .notNullable() - .comment('The type of the relation between the entities'); - table - .string('target_full_name') - .notNullable() - .comment('The full name of the target entity of the relation'); - - table.primary(['source_full_name', 'type', 'target_full_name']); - }); - } else { - await knex.schema.alterTable('entities_relations', table => { - table.dropIndex([], 'source_full_name_idx'); - table.primary(['source_full_name', 'type', 'target_full_name']); - }); - } -}; diff --git a/plugins/catalog-backend/migrationsv2/20201210185851_fk_index.js b/plugins/catalog-backend/migrationsv2/20201210185851_fk_index.js deleted file mode 100644 index abb26cd5fc..0000000000 --- a/plugins/catalog-backend/migrationsv2/20201210185851_fk_index.js +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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. - */ - -// @ts-check - -/** - * @param {import('knex').Knex} knex - */ -exports.up = async function up(knex) { - if (knex.client.config.client !== 'sqlite3') { - await knex.schema.alterTable('entities_relations', table => { - table.index('originating_entity_id', 'originating_entity_id_idx'); - }); - await knex.schema.alterTable('entities_search', table => { - table.index('entity_id', 'entity_id_idx'); - }); - } -}; - -/** - * @param {import('knex').Knex} knex - */ -exports.down = async function down(knex) { - if (knex.client.config.client !== 'sqlite3') { - await knex.schema.alterTable('entities_relations', table => { - table.dropIndex([], 'originating_entity_id_idx'); - }); - await knex.schema.alterTable('entities_relations', table => { - table.dropIndex([], 'entity_id_idx'); - }); - } -}; diff --git a/plugins/catalog-backend/migrationsv2/20201230103504_update_log_varchar.js b/plugins/catalog-backend/migrationsv2/20201230103504_update_log_varchar.js deleted file mode 100644 index d924b0414a..0000000000 --- a/plugins/catalog-backend/migrationsv2/20201230103504_update_log_varchar.js +++ /dev/null @@ -1,73 +0,0 @@ -/* - * 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. - */ - -// @ts-check - -/** - * @param {import('knex').Knex} knex - */ -exports.up = async function up(knex) { - if (knex.client.config.client !== 'sqlite3') { - // We actually just want to widen columns, but can't do that while a - // view is dependent on them - so we just reconstruct it exactly as it was - await knex.schema - .raw('DROP VIEW location_update_log_latest;') - .alterTable('location_update_log', table => { - table.text('message').alter(); - table.text('entity_name').nullable().alter(); - }).raw(` - CREATE VIEW location_update_log_latest AS - SELECT t1.* FROM location_update_log t1 - JOIN - ( - SELECT location_id, MAX(id) AS MAXID - FROM location_update_log - GROUP BY location_id - ) t2 - ON t1.location_id = t2.location_id - AND t1.id = t2.MAXID - GROUP BY t1.location_id, t1.id - ORDER BY created_at DESC; - `); - } -}; - -/** - * @param {import('knex').Knex} knex - */ -exports.down = async function down(knex) { - if (knex.client.config.client !== 'sqlite3') { - await knex.schema - .raw('DROP VIEW location_update_log_latest;') - .alterTable('location_update_log', table => { - table.string('message').alter(); - table.string('entity_name').nullable().alter(); - }).raw(` - CREATE VIEW location_update_log_latest AS - SELECT t1.* FROM location_update_log t1 - JOIN - ( - SELECT location_id, MAX(id) AS MAXID - FROM location_update_log - GROUP BY location_id - ) t2 - ON t1.location_id = t2.location_id - AND t1.id = t2.MAXID - GROUP BY t1.location_id, t1.id - ORDER BY created_at DESC; - `); - } -}; diff --git a/plugins/catalog-backend/migrationsv2/20210209121210_locations_fk_index.js b/plugins/catalog-backend/migrationsv2/20210209121210_locations_fk_index.js deleted file mode 100644 index ccfb1faffb..0000000000 --- a/plugins/catalog-backend/migrationsv2/20210209121210_locations_fk_index.js +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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. - */ - -// @ts-check - -/** - * @param {import('knex').Knex} knex - */ -exports.up = async function up(knex) { - if (knex.client.config.client !== 'sqlite3') { - await knex.schema.alterTable('entities', table => { - table.index('location_id', 'entity_location_id_idx'); - }); - await knex.schema.alterTable('location_update_log', table => { - table.index('location_id', 'update_log_location_id_idx'); - }); - } -}; - -/** - * @param {import('knex').Knex} knex - */ -exports.down = async function down(knex) { - if (knex.client.config.client !== 'sqlite3') { - await knex.schema.alterTable('entities', table => { - table.dropIndex([], 'entity_location_id_idx'); - }); - await knex.schema.alterTable('location_update_log', table => { - table.dropIndex([], 'update_log_location_id_idx'); - }); - } -}; diff --git a/plugins/catalog-backend/src/next/NextCatalogBuilder.ts b/plugins/catalog-backend/src/next/NextCatalogBuilder.ts index e10d13c129..b6b0a04d04 100644 --- a/plugins/catalog-backend/src/next/NextCatalogBuilder.ts +++ b/plugins/catalog-backend/src/next/NextCatalogBuilder.ts @@ -246,7 +246,7 @@ export class NextCatalogBuilder { await dbClient.migrate.latest({ directory: resolvePackagePath( '@backstage/plugin-catalog-backend', - 'migrationsv2', + 'migrations', ), }); From b45e29410a8ec199840b3f36362c30e0a126e584 Mon Sep 17 00:00:00 2001 From: Johan Haals Date: Thu, 3 Jun 2021 13:19:57 +0200 Subject: [PATCH 03/62] Add changeset Signed-off-by: Johan Haals --- .changeset/dull-poets-learn.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .changeset/dull-poets-learn.md diff --git a/.changeset/dull-poets-learn.md b/.changeset/dull-poets-learn.md new file mode 100644 index 0000000000..0574d0ebc6 --- /dev/null +++ b/.changeset/dull-poets-learn.md @@ -0,0 +1,9 @@ +--- +'@backstage/plugin-catalog-backend': patch +--- + +This release enables the new catalog processing engine which is a major milestone for the catalog! + +This update makes processing more scalable across multiple instances, adds support for deletions and ui flagging of entities that are no longer referenced by a location. + +As this is a major internal change we have taken some precaution by offering a `LEGACY_CATALOG=1` environment variable that you can set when starting the backend in order to run the previous version. If you do so for any reason make sure to raise an issue immediately as this is a temporary "break the glass" option which will be removed in a subsequent release. From f8e773e3e979564dd81ae3a476c8bf517cc2f8a6 Mon Sep 17 00:00:00 2001 From: Johan Haals Date: Fri, 4 Jun 2021 08:48:54 +0200 Subject: [PATCH 04/62] chore: Update migrations dir in tests Signed-off-by: Johan Haals --- plugins/catalog-backend/src/next/database/DatabaseManager.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/catalog-backend/src/next/database/DatabaseManager.ts b/plugins/catalog-backend/src/next/database/DatabaseManager.ts index 22ae4e782f..d501bc6c61 100644 --- a/plugins/catalog-backend/src/next/database/DatabaseManager.ts +++ b/plugins/catalog-backend/src/next/database/DatabaseManager.ts @@ -36,7 +36,7 @@ export class DatabaseManager { ): Promise { const migrationsDir = resolvePackagePath( '@backstage/plugin-catalog-backend', - 'migrationsv2', + 'migrations', ); await knex.migrate.latest({ From 3db3b67f5f1b1b023bf7e3678de7b1efdba441c5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 8 Jun 2021 04:08:47 +0000 Subject: [PATCH 05/62] chore(deps): bump http-proxy-middleware from 0.19.2 to 2.0.0 Bumps [http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware) from 0.19.2 to 2.0.0. - [Release notes](https://github.com/chimurai/http-proxy-middleware/releases) - [Changelog](https://github.com/chimurai/http-proxy-middleware/blob/master/CHANGELOG.md) - [Commits](https://github.com/chimurai/http-proxy-middleware/compare/v0.19.2...v2.0.0) --- updated-dependencies: - dependency-name: http-proxy-middleware dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- plugins/proxy-backend/package.json | 2 +- yarn.lock | 28 +++++++++++++++++----------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/plugins/proxy-backend/package.json b/plugins/proxy-backend/package.json index d2b0d64678..e83b0d9710 100644 --- a/plugins/proxy-backend/package.json +++ b/plugins/proxy-backend/package.json @@ -33,7 +33,7 @@ "@types/express": "^4.17.6", "express": "^4.17.1", "express-promise-router": "^4.1.0", - "http-proxy-middleware": "^0.19.1", + "http-proxy-middleware": "^2.0.0", "morgan": "^1.10.0", "uuid": "^8.0.0", "winston": "^3.2.1", diff --git a/yarn.lock b/yarn.lock index 683ec0f557..f8ec474142 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6191,10 +6191,10 @@ "@types/http-proxy" "*" "@types/node" "*" -"@types/http-proxy@*", "@types/http-proxy@^1.17.4": - version "1.17.5" - resolved "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.5.tgz#c203c5e6e9dc6820d27a40eb1e511c70a220423d" - integrity sha512-GNkDE7bTv6Sf8JbV2GksknKOsk7OznNYHSdrtvPJXO0qJ9odZig6IZKUi5RFGi6d1bf6dgIAe4uXi3DBc7069Q== +"@types/http-proxy@*", "@types/http-proxy@^1.17.4", "@types/http-proxy@^1.17.5": + version "1.17.6" + resolved "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.6.tgz#62dc3fade227d6ac2862c8f19ee0da9da9fd8616" + integrity sha512-+qsjqR75S/ib0ig0R9WN+CDoZeOBU6F2XLewgC4KVgdXiNHiKKHFEMRHOrs5PbYE97D5vataw5wPj4KLYfUkuQ== dependencies: "@types/node" "*" @@ -15181,15 +15181,16 @@ http-proxy-middleware@0.19.1: lodash "^4.17.11" micromatch "^3.1.10" -http-proxy-middleware@^0.19.1: - version "0.19.2" - resolved "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.19.2.tgz#ee73dcc8348165afefe8de2ff717751d181608ee" - integrity sha512-aYk1rTKqLTus23X3L96LGNCGNgWpG4cG0XoZIT1GUPhhulEHX/QalnO6Vbo+WmKWi4AL2IidjuC0wZtbpg0yhQ== +http-proxy-middleware@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.0.tgz#20d1ac3409199c83e5d0383ba6436b04e7acb9fe" + integrity sha512-S+RN5njuyvYV760aiVKnyuTXqUMcSIvYOsHA891DOVQyrdZOwaXtBHpt9FUVPEDAsOvsPArZp6VXQLs44yvkow== dependencies: + "@types/http-proxy" "^1.17.5" http-proxy "^1.18.1" - is-glob "^4.0.0" - lodash "^4.17.11" - micromatch "^3.1.10" + is-glob "^4.0.1" + is-plain-obj "^3.0.0" + micromatch "^4.0.2" http-proxy@^1.17.0, http-proxy@^1.18.1: version "1.18.1" @@ -16065,6 +16066,11 @@ is-plain-obj@^2.0.0: resolved "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== +is-plain-obj@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-3.0.0.tgz#af6f2ea14ac5a646183a5bbdb5baabbc156ad9d7" + integrity sha512-gwsOE28k+23GP1B6vFl1oVh/WOzmawBrKwo5Ev6wMKzPkaXaCDIQKzLnvsA42DRlbVTWorkgTKIviAKCWkfUwA== + is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: version "2.0.4" resolved "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" From 090dfe65db7ba2f1a76cd009ab911cdfdae017be Mon Sep 17 00:00:00 2001 From: Carlo Colombo Date: Tue, 8 Jun 2021 14:47:21 +0200 Subject: [PATCH 06/62] Add supprt to enable LFS for hosted Bitbucket Signed-off-by: Carlo Colombo --- .changeset/lazy-cougars-rule.md | 5 ++ .../actions/builtin/publish/bitbucket.test.ts | 82 +++++++++++++++++++ .../actions/builtin/publish/bitbucket.ts | 43 +++++++++- 3 files changed, 129 insertions(+), 1 deletion(-) create mode 100644 .changeset/lazy-cougars-rule.md diff --git a/.changeset/lazy-cougars-rule.md b/.changeset/lazy-cougars-rule.md new file mode 100644 index 0000000000..cc6ec91bd5 --- /dev/null +++ b/.changeset/lazy-cougars-rule.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-scaffolder-backend': patch +--- + +Adds support to enable LFS for hosted Bitbucket diff --git a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/bitbucket.test.ts b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/bitbucket.test.ts index 40e7f613f2..f670cc715a 100644 --- a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/bitbucket.test.ts +++ b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/bitbucket.test.ts @@ -173,6 +173,88 @@ describe('publish:bitbucket', () => { }); }); + describe('LFS for hosted bitbucket', () => { + const repoCreationResponse = { + links: { + self: [ + { + href: 'https://bitbucket.mycompany.com/projects/project/repos/repo', + }, + ], + clone: [ + { + name: 'http', + href: 'https://bitbucket.mycompany.com/scm/project/repo', + }, + ], + }, + }; + + it('should call the correct APIs to enable LFS if requested and the host is hosted bitbucket', async () => { + expect.assertions(1); + server.use( + rest.post( + 'https://hosted.bitbucket.com/rest/api/1.0/projects/owner/repos', + (_, res, ctx) => { + return res( + ctx.status(201), + ctx.set('Content-Type', 'application/json'), + ctx.json(repoCreationResponse), + ); + }, + ), + rest.put( + 'https://hosted.bitbucket.com/rest/git-lfs/admin/projects/owner/repos/repo/enabled', + (req, res, ctx) => { + expect(req.headers.get('Authorization')).toBe('Bearer thing'); + return res(ctx.status(204)); + }, + ), + ); + + await action.handler({ + ...mockContext, + input: { + ...mockContext.input, + repoUrl: 'hosted.bitbucket.com?owner=owner&repo=repo', + enableLFS: true, + }, + }); + }); + + it('should report an error if enabling LFS fails', async () => { + server.use( + rest.post( + 'https://hosted.bitbucket.com/rest/api/1.0/projects/owner/repos', + (_, res, ctx) => { + return res( + ctx.status(201), + ctx.set('Content-Type', 'application/json'), + ctx.json(repoCreationResponse), + ); + }, + ), + rest.put( + 'https://hosted.bitbucket.com/rest/git-lfs/admin/projects/owner/repos/repo/enabled', + (_, res, ctx) => { + return res(ctx.status(500)); + }, + ), + ); + + await expect( + action.handler({ + ...mockContext, + input: { + ...mockContext.input, + repoUrl: 'hosted.bitbucket.com?owner=owner&repo=repo', + enableLFS: true, + }, + }), + ).rejects.toThrow(/Failed to enable LFS/); + }); + }); + it('should call initAndPush with the correct values', async () => { server.use( rest.post( diff --git a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/bitbucket.ts b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/bitbucket.ts index 243e515b19..d543f4cdaa 100644 --- a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/bitbucket.ts +++ b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/bitbucket.ts @@ -156,6 +156,32 @@ const getAuthorizationHeader = (config: BitbucketIntegrationConfig) => { ); }; +const performEnableLFS = async (opts: { + authorization: string; + host: string; + owner: string; + repo: string; +}) => { + const { authorization, host, owner, repo } = opts; + + const options: RequestInit = { + method: 'PUT', + headers: { + Authorization: authorization, + }, + }; + + const { ok, status, statusText } = await fetch( + `https://${host}/rest/git-lfs/admin/projects/${owner}/repos/${repo}/enabled`, + options, + ); + + if (!ok) + throw new Error( + `Failed to enable LFS in the repository, ${status}: ${statusText}`, + ); +}; + export function createPublishBitbucketAction(options: { integrations: ScmIntegrationRegistry; }) { @@ -166,6 +192,7 @@ export function createPublishBitbucketAction(options: { description: string; repoVisibility: 'private' | 'public'; sourcePath?: string; + enableLFS: boolean; }>({ id: 'publish:bitbucket', description: @@ -193,6 +220,11 @@ export function createPublishBitbucketAction(options: { 'Path within the workspace that will be used as the repository root. If omitted, the entire workspace will be published as the repository.', type: 'string', }, + enableLFS: { + title: + 'Enable LFS for the repository. Only available for hosted Bitbucket.', + type: 'boolean', + }, }, }, output: { @@ -210,7 +242,12 @@ export function createPublishBitbucketAction(options: { }, }, async handler(ctx) { - const { repoUrl, description, repoVisibility = 'private' } = ctx.input; + const { + repoUrl, + description, + repoVisibility = 'private', + enableLFS = false, + } = ctx.input; const { owner, repo, host } = parseRepoUrl(repoUrl); @@ -252,6 +289,10 @@ export function createPublishBitbucketAction(options: { logger: ctx.logger, }); + if (enableLFS && host !== 'bitbucket.org') { + await performEnableLFS({ authorization, host, owner, repo }); + } + ctx.output('remoteUrl', remoteUrl); ctx.output('repoContentsUrl', repoContentsUrl); }, From 6ffcf9ed854b29fead9d8270eb3285ac3224821a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Tue, 8 Jun 2021 14:17:42 +0200 Subject: [PATCH 07/62] fixup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .changeset/violet-birds-lay.md | 5 +++ packages/cli/package.json | 2 +- .../proxy-backend/src/service/router.test.ts | 40 ++++++++----------- plugins/proxy-backend/src/service/router.ts | 18 +++++---- yarn.lock | 36 ++++++++--------- 5 files changed, 51 insertions(+), 50 deletions(-) create mode 100644 .changeset/violet-birds-lay.md diff --git a/.changeset/violet-birds-lay.md b/.changeset/violet-birds-lay.md new file mode 100644 index 0000000000..841603058f --- /dev/null +++ b/.changeset/violet-birds-lay.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-proxy-backend': patch +--- + +Bump http-proxy-middleware from 0.19.2 to 2.0.0 diff --git a/packages/cli/package.json b/packages/cli/package.json index 3f075824dc..450aa02ee4 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -139,7 +139,7 @@ "@types/rollup-plugin-postcss": "^2.0.0", "@types/tar": "^4.0.3", "@types/webpack": "^4.41.7", - "@types/webpack-dev-server": "3.11.0", + "@types/webpack-dev-server": "^3.11.0", "@types/yarnpkg__lockfile": "^1.1.4", "del": "^5.1.0", "mock-fs": "^4.13.0", diff --git a/plugins/proxy-backend/src/service/router.test.ts b/plugins/proxy-backend/src/service/router.test.ts index 57b87754e2..8b88e45cc5 100644 --- a/plugins/proxy-backend/src/service/router.test.ts +++ b/plugins/proxy-backend/src/service/router.test.ts @@ -14,25 +14,19 @@ * limitations under the License. */ -import { buildMiddleware, createRouter } from './router'; import { getVoidLogger, loadBackendConfig, SingleHostDiscovery, } from '@backstage/backend-common'; -import createProxyMiddleware, { - Config as ProxyMiddlewareConfig, - Proxy, -} from 'http-proxy-middleware'; +import { Request, Response } from 'express'; import * as http from 'http'; +import { createProxyMiddleware, Options } from 'http-proxy-middleware'; +import { buildMiddleware, createRouter } from './router'; -jest.mock('http-proxy-middleware', () => { - return jest.fn().mockImplementation( - (): Proxy => { - return () => undefined; - }, - ); -}); +jest.mock('http-proxy-middleware', () => ({ + createProxyMiddleware: jest.fn(() => () => undefined), +})); const mockCreateProxyMiddleware = createProxyMiddleware as jest.MockedFunction< typeof createProxyMiddleware @@ -66,7 +60,7 @@ describe('buildMiddleware', () => { const [filter, fullConfig] = mockCreateProxyMiddleware.mock.calls[0] as [ (pathname: string, req: Partial) => boolean, - ProxyMiddlewareConfig, + Options, ]; expect(filter('', { method: 'GET', headers: {} })).toBe(true); expect(filter('', { method: 'POST', headers: {} })).toBe(true); @@ -86,7 +80,7 @@ describe('buildMiddleware', () => { const [filter, fullConfig] = mockCreateProxyMiddleware.mock.calls[0] as [ (pathname: string, req: Partial) => boolean, - ProxyMiddlewareConfig, + Options, ]; expect(filter('', { method: 'GET', headers: {} })).toBe(true); expect(filter('', { method: 'POST', headers: {} })).toBe(true); @@ -106,7 +100,7 @@ describe('buildMiddleware', () => { const [filter, fullConfig] = mockCreateProxyMiddleware.mock.calls[0] as [ (pathname: string, req: Partial) => boolean, - ProxyMiddlewareConfig, + Options, ]; expect(filter('', { method: 'GET', headers: {} })).toBe(true); expect(filter('', { method: 'POST', headers: {} })).toBe(true); @@ -129,7 +123,7 @@ describe('buildMiddleware', () => { const [filter, fullConfig] = mockCreateProxyMiddleware.mock.calls[0] as [ (pathname: string, req: Partial) => boolean, - ProxyMiddlewareConfig, + Options, ]; expect(filter('', { method: 'GET', headers: {} })).toBe(true); expect(filter('', { method: 'POST', headers: {} })).toBe(false); @@ -254,8 +248,7 @@ describe('buildMiddleware', () => { expect(createProxyMiddleware).toHaveBeenCalledTimes(1); - const config = mockCreateProxyMiddleware.mock - .calls[0][1] as ProxyMiddlewareConfig; + const config = mockCreateProxyMiddleware.mock.calls[0][1] as Options; const testClientResponse = { headers: { @@ -275,8 +268,8 @@ describe('buildMiddleware', () => { config.onProxyRes!( testClientResponse as http.IncomingMessage, - {} as http.IncomingMessage, - {} as http.ServerResponse, + {} as Request, + {} as Response, ); expect(Object.keys(testClientResponse.headers!)).toEqual([ @@ -298,8 +291,7 @@ describe('buildMiddleware', () => { expect(createProxyMiddleware).toHaveBeenCalledTimes(1); - const config = mockCreateProxyMiddleware.mock - .calls[0][1] as ProxyMiddlewareConfig; + const config = mockCreateProxyMiddleware.mock.calls[0][1] as Options; const testClientResponse = { headers: { @@ -313,8 +305,8 @@ describe('buildMiddleware', () => { config.onProxyRes!( testClientResponse as http.IncomingMessage, - {} as http.IncomingMessage, - {} as http.ServerResponse, + {} as Request, + {} as Response, ); expect(Object.keys(testClientResponse.headers!)).toEqual(['set-cookie']); diff --git a/plugins/proxy-backend/src/service/router.ts b/plugins/proxy-backend/src/service/router.ts index c3b1d056db..8957d4e8ce 100644 --- a/plugins/proxy-backend/src/service/router.ts +++ b/plugins/proxy-backend/src/service/router.ts @@ -17,9 +17,10 @@ import { Config } from '@backstage/config'; import express from 'express'; import Router from 'express-promise-router'; -import createProxyMiddleware, { - Config as ProxyMiddlewareConfig, - Proxy, +import { + createProxyMiddleware, + Options, + RequestHandler, } from 'http-proxy-middleware'; import { Logger } from 'winston'; import http from 'http'; @@ -52,7 +53,7 @@ export interface RouterOptions { discovery: PluginEndpointDiscovery; } -export interface ProxyConfig extends ProxyMiddlewareConfig { +export interface ProxyConfig extends Options { allowedMethods?: string[]; allowedHeaders?: string[]; } @@ -64,14 +65,17 @@ export function buildMiddleware( logger: Logger, route: string, config: string | ProxyConfig, -): Proxy { +): RequestHandler { const fullConfig = typeof config === 'string' ? { target: config } : { ...config }; // Validate that target is a valid URL. + if (typeof fullConfig.target !== 'string') { + throw new Error(`Proxy target must be a string`); + } try { // eslint-disable-next-line no-new - new URL(fullConfig.target!); + new URL(fullConfig.target! as string); } catch { throw new Error( `Proxy target is not a valid URL: ${fullConfig.target ?? ''}`, @@ -131,7 +135,7 @@ export function buildMiddleware( // 2. Only permit the allowed HTTP methods if configured // // We are filtering the proxy request headers here rather than in - // `onProxyReq` becuase when global-agent is enabled then `onProxyReq` + // `onProxyReq` because when global-agent is enabled then `onProxyReq` // fires _after_ the agent has already sent the headers to the proxy // target, causing a ERR_HTTP_HEADERS_SENT crash const filter = (_pathname: string, req: http.IncomingMessage): boolean => { diff --git a/yarn.lock b/yarn.lock index f8ec474142..3437ae6a98 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6182,7 +6182,7 @@ dependencies: "@types/node" "*" -"@types/http-proxy-middleware@*", "@types/http-proxy-middleware@^0.19.3": +"@types/http-proxy-middleware@^0.19.3": version "0.19.3" resolved "https://registry.npmjs.org/@types/http-proxy-middleware/-/http-proxy-middleware-0.19.3.tgz#b2eb96fbc0f9ac7250b5d9c4c53aade049497d03" integrity sha512-lnBTx6HCOUeIJMLbI/LaL5EmdKLhczJY5oeXZpX/cXE4rRqb3RmV7VcMpiEfYkmTjipv3h7IAyIINe4plEv7cA== @@ -7025,27 +7025,16 @@ resolved "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.0.tgz#215c231dff736d5ba92410e6d602050cce7e273f" integrity sha512-eQ9qFW/fhfGJF8WKHGEHZEyVWfZxrT+6CLIJGBcZPfxUh/+BnEj+UCGYMlr9qZuX/2AltsvwrGqp0LhEW8D0zQ== -"@types/webpack-dev-server@*": - version "3.11.1" - resolved "https://registry.npmjs.org/@types/webpack-dev-server/-/webpack-dev-server-3.11.1.tgz#f8f4dac1da226d530bd15a1d5dc34b23ba766ccb" - integrity sha512-rIb+LtUkKnh7+oIJm3WiMJONd71Q0lZuqGLcSqhZ5qjN9gV/CNmZe7Bai+brnBPZ/KVYOsr+4bFLiNZwjBicLw== +"@types/webpack-dev-server@*", "@types/webpack-dev-server@^3.11.0": + version "3.11.4" + resolved "https://registry.npmjs.org/@types/webpack-dev-server/-/webpack-dev-server-3.11.4.tgz#90d47dd660b696d409431ab8c1e9fa3615103a07" + integrity sha512-DCKORHjqNNVuMIDWFrlljftvc9CL0+09p3l7lBpb8dRqgN5SmvkWCY4MPKxoI6wJgdRqohmoNbptkxqSKAzLRg== dependencies: "@types/connect-history-api-fallback" "*" "@types/express" "*" - "@types/http-proxy-middleware" "*" "@types/serve-static" "*" - "@types/webpack" "*" - -"@types/webpack-dev-server@3.11.0": - version "3.11.0" - resolved "https://registry.npmjs.org/@types/webpack-dev-server/-/webpack-dev-server-3.11.0.tgz#bcc3b85e7dc6ac2db25330610513f2228c2fcfb2" - integrity sha512-3+86AgSzl18n5P1iUP9/lz3G3GMztCp+wxdDvVuNhx1sr1jE79GpYfKHL8k+Vht3N74K2n98CuAEw4YPJCYtDA== - dependencies: - "@types/connect-history-api-fallback" "*" - "@types/express" "*" - "@types/http-proxy-middleware" "*" - "@types/serve-static" "*" - "@types/webpack" "*" + "@types/webpack" "^4" + http-proxy-middleware "^1.0.0" "@types/webpack-env@^1.15.2", "@types/webpack-env@^1.15.3": version "1.16.0" @@ -15181,6 +15170,17 @@ http-proxy-middleware@0.19.1: lodash "^4.17.11" micromatch "^3.1.10" +http-proxy-middleware@^1.0.0: + version "1.3.1" + resolved "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-1.3.1.tgz#43700d6d9eecb7419bf086a128d0f7205d9eb665" + integrity sha512-13eVVDYS4z79w7f1+NPllJtOQFx/FdUW4btIvVRMaRlUY9VGstAbo5MOhLEuUgZFRHn3x50ufn25zkj/boZnEg== + dependencies: + "@types/http-proxy" "^1.17.5" + http-proxy "^1.18.1" + is-glob "^4.0.1" + is-plain-obj "^3.0.0" + micromatch "^4.0.2" + http-proxy-middleware@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.0.tgz#20d1ac3409199c83e5d0383ba6436b04e7acb9fe" From cc8e0b7478ada68e779172b7c5b36f930632fcd4 Mon Sep 17 00:00:00 2001 From: Daniel Ortega Date: Thu, 10 Jun 2021 00:50:17 +0200 Subject: [PATCH 08/62] #5986 Adding .DS_Store to Scaffolded Backstage app .gitignore file Signed-off-by: Daniel Ortega --- packages/create-app/templates/default-app/.gitignore.hbs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/create-app/templates/default-app/.gitignore.hbs b/packages/create-app/templates/default-app/.gitignore.hbs index 4adebc5adc..d16a8d3fba 100644 --- a/packages/create-app/templates/default-app/.gitignore.hbs +++ b/packages/create-app/templates/default-app/.gitignore.hbs @@ -1,3 +1,6 @@ +# macOS +.DS_Store + # Logs logs *.log From e84f6aac87f551666342a476125a073dd4b8ce37 Mon Sep 17 00:00:00 2001 From: Eric Peterson Date: Fri, 4 Jun 2021 20:35:01 +0200 Subject: [PATCH 09/62] Update @backstage/create-app to include the latest improvements in @backstage/search* Signed-off-by: Eric Peterson --- packages/create-app/package.json | 2 + packages/create-app/src/lib/versions.ts | 4 + .../app/src/components/search/SearchPage.tsx | 86 +++++++++++++++++++ .../packages/backend/package.json.hbs | 2 + .../default-app/packages/backend/src/index.ts | 3 + .../packages/backend/src/plugins/search.ts | 38 ++++++++ 6 files changed, 135 insertions(+) create mode 100644 packages/create-app/templates/default-app/packages/app/src/components/search/SearchPage.tsx create mode 100644 packages/create-app/templates/default-app/packages/backend/src/plugins/search.ts diff --git a/packages/create-app/package.json b/packages/create-app/package.json index a0fb9e6d4a..c69354044d 100644 --- a/packages/create-app/package.json +++ b/packages/create-app/package.json @@ -64,6 +64,8 @@ "@backstage/plugin-rollbar-backend": "*", "@backstage/plugin-scaffolder": "*", "@backstage/plugin-search": "*", + "@backstage/plugin-search-backend": "*", + "@backstage/plugin-search-backend-node": "*", "@backstage/plugin-scaffolder-backend": "*", "@backstage/plugin-tech-radar": "*", "@backstage/plugin-techdocs": "*", diff --git a/packages/create-app/src/lib/versions.ts b/packages/create-app/src/lib/versions.ts index 2a133b4bf8..a0f646747b 100644 --- a/packages/create-app/src/lib/versions.ts +++ b/packages/create-app/src/lib/versions.ts @@ -58,6 +58,8 @@ import { version as pluginRollbarBackend } from '../../../../plugins/rollbar-bac import { version as pluginScaffolder } from '../../../../plugins/scaffolder/package.json'; import { version as pluginScaffolderBackend } from '../../../../plugins/scaffolder-backend/package.json'; import { version as pluginSearch } from '../../../../plugins/search/package.json'; +import { version as pluginSearchBackend } from '../../../../plugins/search-backend/package.json'; +import { version as pluginSearchBackendNode } from '../../../../plugins/search-backend-node/package.json'; import { version as pluginTechRadar } from '../../../../plugins/tech-radar/package.json'; import { version as pluginTechdocs } from '../../../../plugins/techdocs/package.json'; import { version as pluginTechdocsBackend } from '../../../../plugins/techdocs-backend/package.json'; @@ -89,6 +91,8 @@ export const packageVersions = { '@backstage/plugin-scaffolder': pluginScaffolder, '@backstage/plugin-scaffolder-backend': pluginScaffolderBackend, '@backstage/plugin-search': pluginSearch, + '@backstage/plugin-search-backend': pluginSearchBackend, + '@backstage/plugin-search-backend-node': pluginSearchBackendNode, '@backstage/plugin-tech-radar': pluginTechRadar, '@backstage/plugin-techdocs': pluginTechdocs, '@backstage/plugin-techdocs-backend': pluginTechdocsBackend, diff --git a/packages/create-app/templates/default-app/packages/app/src/components/search/SearchPage.tsx b/packages/create-app/templates/default-app/packages/app/src/components/search/SearchPage.tsx new file mode 100644 index 0000000000..f525be80a2 --- /dev/null +++ b/packages/create-app/templates/default-app/packages/app/src/components/search/SearchPage.tsx @@ -0,0 +1,86 @@ +import React from 'react'; +import { makeStyles, Theme, Grid, List, Paper } from '@material-ui/core'; + +import { Content, Header, Page } from '@backstage/core'; +import { CatalogResultListItem } from '@backstage/plugin-catalog'; +import { + SearchBar, + SearchFilter, + SearchResult, + DefaultResultListItem, +} from '@backstage/plugin-search'; + +const useStyles = makeStyles((theme: Theme) => ({ + bar: { + padding: theme.spacing(1, 0), + }, + filters: { + padding: theme.spacing(2), + }, + filter: { + '& + &': { + marginTop: theme.spacing(2.5), + }, + }, +})); + +const SearchPage = () => { + const classes = useStyles(); + + return ( + +
+ + + + + + + + + + + + + + + + {({ results }) => ( + + {results.map(({ type, document }) => { + switch (type) { + case 'software-catalog': + return ( + + ); + default: + return ( + + ); + } + })} + + )} + + + + + + ); +}; + +export const searchPage = ; 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 4b493a32c3..8f5a116de4 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 @@ -27,6 +27,8 @@ "@backstage/plugin-catalog-backend": "^{{version '@backstage/plugin-catalog-backend'}}", "@backstage/plugin-proxy-backend": "^{{version '@backstage/plugin-proxy-backend'}}", "@backstage/plugin-scaffolder-backend": "^{{version '@backstage/plugin-scaffolder-backend'}}", + "@backstage/plugin-search-backend": "^{{version '@backstage/plugin-search-backend'}}", + "@backstage/plugin-search-backend-node": "^{{version '@backstage/plugin-search-backend-node'}}", "@backstage/plugin-techdocs-backend": "^{{version '@backstage/plugin-techdocs-backend'}}", "@gitbeaker/node": "^30.2.0", "@octokit/rest": "^18.5.3", diff --git a/packages/create-app/templates/default-app/packages/backend/src/index.ts b/packages/create-app/templates/default-app/packages/backend/src/index.ts index aebd034aae..3d8849fa75 100644 --- a/packages/create-app/templates/default-app/packages/backend/src/index.ts +++ b/packages/create-app/templates/default-app/packages/backend/src/index.ts @@ -25,6 +25,7 @@ import catalog from './plugins/catalog'; import scaffolder from './plugins/scaffolder'; import proxy from './plugins/proxy'; import techdocs from './plugins/techdocs'; +import search from './plugins/search'; import { PluginEnvironment } from './types'; function makeCreateEnv(config: Config) { @@ -57,6 +58,7 @@ async function main() { const authEnv = useHotMemoize(module, () => createEnv('auth')); const proxyEnv = useHotMemoize(module, () => createEnv('proxy')); const techdocsEnv = useHotMemoize(module, () => createEnv('techdocs')); + const searchEnv = useHotMemoize(module, () => createEnv('search')); const appEnv = useHotMemoize(module, () => createEnv('app')); const apiRouter = Router(); @@ -65,6 +67,7 @@ async function main() { apiRouter.use('/auth', await auth(authEnv)); apiRouter.use('/techdocs', await techdocs(techdocsEnv)); apiRouter.use('/proxy', await proxy(proxyEnv)); + apiRouter.use('/search', await search(searchEnv)); apiRouter.use(notFoundHandler()); const service = createServiceBuilder(module) diff --git a/packages/create-app/templates/default-app/packages/backend/src/plugins/search.ts b/packages/create-app/templates/default-app/packages/backend/src/plugins/search.ts new file mode 100644 index 0000000000..248ed37ea8 --- /dev/null +++ b/packages/create-app/templates/default-app/packages/backend/src/plugins/search.ts @@ -0,0 +1,38 @@ +import { useHotCleanup } from '@backstage/backend-common'; +import { createRouter } from '@backstage/plugin-search-backend'; +import { + IndexBuilder, + LunrSearchEngine, +} from '@backstage/plugin-search-backend-node'; +import { PluginEnvironment } from '../types'; +import { DefaultCatalogCollator } from '@backstage/plugin-catalog-backend'; + +export default async function createPlugin({ + logger, + discovery, +}: PluginEnvironment) { + // Initialize a connection to a search engine. + const searchEngine = new LunrSearchEngine({ logger }); + const indexBuilder = new IndexBuilder({ logger, searchEngine }); + + // Collators are responsible for gathering documents known to plugins. This + // particular collator gathers entities from the software catalog. + indexBuilder.addCollator({ + defaultRefreshIntervalSeconds: 600, + collator: new DefaultCatalogCollator({ discovery }), + }); + + // The scheduler controls when documents are gathered from collators and sent + // to the search engine for indexing. + const { scheduler } = await indexBuilder.build(); + + // A 3 second delay gives the backend server a chance to initialize before + // any collators are executed, which may attempt requests against the API. + setTimeout(() => scheduler.start(), 3000); + useHotCleanup(module, () => scheduler.stop()); + + return await createRouter({ + engine: indexBuilder.getSearchEngine(), + logger, + }); +} From 509b5638cfde9cd9fdd4c3e0579b47da44377041 Mon Sep 17 00:00:00 2001 From: Eric Peterson Date: Thu, 10 Jun 2021 11:07:41 +0200 Subject: [PATCH 10/62] Changeset Signed-off-by: Eric Peterson --- .changeset/were-only-dreaming.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/were-only-dreaming.md diff --git a/.changeset/were-only-dreaming.md b/.changeset/were-only-dreaming.md new file mode 100644 index 0000000000..6b3ebb9b54 --- /dev/null +++ b/.changeset/were-only-dreaming.md @@ -0,0 +1,5 @@ +--- +'@backstage/create-app': patch +--- + +Added "out-of-the-box" alpha-milestone search features to scaffolded Backstage apps. From b7d03deeb62b0f872d97bcf8578d42e0c99f4d7e Mon Sep 17 00:00:00 2001 From: Eric Peterson Date: Thu, 10 Jun 2021 11:56:41 +0200 Subject: [PATCH 11/62] More detailed upgrade guide. Signed-off-by: Eric Peterson --- .changeset/were-only-dreaming.md | 171 +++++++++++++++++++++++++++++++ 1 file changed, 171 insertions(+) diff --git a/.changeset/were-only-dreaming.md b/.changeset/were-only-dreaming.md index 6b3ebb9b54..09fd6e9875 100644 --- a/.changeset/were-only-dreaming.md +++ b/.changeset/were-only-dreaming.md @@ -3,3 +3,174 @@ --- Added "out-of-the-box" alpha-milestone search features to scaffolded Backstage apps. + +To apply this change to an existing app, do the following... + +First, navigate to your backend package and install the two new search backend +packages: + +```sh +cd packages/backend +yarn add @backstage/plugin-search-backend @backstage/plugin-search-backend-node +``` + +Wire up these new packages into your app backend by first creating a new +`search.ts` file at `src/plugins/search.ts` with contents like the following: + +```typescript +import { useHotCleanup } from '@backstage/backend-common'; +import { createRouter } from '@backstage/plugin-search-backend'; +import { + IndexBuilder, + LunrSearchEngine, +} from '@backstage/plugin-search-backend-node'; +import { PluginEnvironment } from '../types'; +import { DefaultCatalogCollator } from '@backstage/plugin-catalog-backend'; + +export default async function createPlugin({ + logger, + discovery, +}: PluginEnvironment) { + // Initialize a connection to a search engine. + const searchEngine = new LunrSearchEngine({ logger }); + const indexBuilder = new IndexBuilder({ logger, searchEngine }); + + // Collators are responsible for gathering documents known to plugins. This + // particular collator gathers entities from the software catalog. + indexBuilder.addCollator({ + defaultRefreshIntervalSeconds: 600, + collator: new DefaultCatalogCollator({ discovery }), + }); + + // The scheduler controls when documents are gathered from collators and sent + // to the search engine for indexing. + const { scheduler } = await indexBuilder.build(); + + // A 3 second delay gives the backend server a chance to initialize before + // any collators are executed, which may attempt requests against the API. + setTimeout(() => scheduler.start(), 3000); + useHotCleanup(module, () => scheduler.stop()); + + return await createRouter({ + engine: indexBuilder.getSearchEngine(), + logger, + }); +} +``` + +Then, ensure the search plugin you configured above is initialized by modifying +your backend's `index.ts` file in the following ways: + +```diff ++import search from './plugins/search'; +// ... ++const searchEnv = useHotMemoize(module, () => createEnv('search')); +// ... ++apiRouter.use('/search', await search(searchEnv)); +// ... +``` + +In your frontend app package, create a new `searchPage` component at, for +example, `packages/app/src/components/search/SearchPage.tsx` with contents like +the following: + +```tsx +import React from 'react'; +import { makeStyles, Theme, Grid, List, Paper } from '@material-ui/core'; + +import { Content, Header, Lifecycle, Page } from '@backstage/core'; +import { CatalogResultListItem } from '@backstage/plugin-catalog'; +import { + SearchBar, + SearchFilter, + SearchResult, + DefaultResultListItem, +} from '@backstage/plugin-search'; + +const useStyles = makeStyles((theme: Theme) => ({ + bar: { + padding: theme.spacing(1, 0), + }, + filters: { + padding: theme.spacing(2), + }, + filter: { + '& + &': { + marginTop: theme.spacing(2.5), + }, + }, +})); + +const SearchPage = () => { + const classes = useStyles(); + + return ( + +
} /> + + + + + + + + + + + + + + + + {({ results }) => ( + + {results.map(({ type, document }) => { + switch (type) { + case 'software-catalog': + return ( + + ); + default: + return ( + + ); + } + })} + + )} + + + + + + ); +}; + +export const searchPage = ; +``` + +Then in `App.tsx`, import this new `searchPage` component, and set it as a +child of the existing `` route so that it looks like this: + +```diff ++import { searchPage } from './components/search/SearchPage'; +// ... +-} /> ++}> ++ {searchPage} ++; +``` From 5db7445b4557e5a18ea9309d7c4addc0c52446b3 Mon Sep 17 00:00:00 2001 From: Daniel Ortega Date: Thu, 10 Jun 2021 13:54:12 +0200 Subject: [PATCH 12/62] #5986 Adding required changeset Signed-off-by: Daniel Ortega --- .changeset/clean-frogs-brake.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/clean-frogs-brake.md diff --git a/.changeset/clean-frogs-brake.md b/.changeset/clean-frogs-brake.md new file mode 100644 index 0000000000..a6d7dd0c08 --- /dev/null +++ b/.changeset/clean-frogs-brake.md @@ -0,0 +1,5 @@ +--- +'@backstage/create-app': minor +--- + +Adding .DS_Store pattern to .gitignore in Scaffolded Backstage App. To migrate an existing app that pattern should be added manually. From 4a93128245877157542883d505df12808a587a9d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 10 Jun 2021 12:18:06 +0000 Subject: [PATCH 13/62] Version Packages --- .changeset/breezy-ways-try.md | 43 ---- .changeset/catalog-search-item.md | 5 - .changeset/cuddly-yaks-sneeze.md | 5 - .changeset/cyan-suns-chew.md | 5 - .changeset/early-baboons-double.md | 5 - .changeset/eight-doors-melt.md | 43 ---- .changeset/empty-berries-melt.md | 5 - .changeset/famous-rockets-share.md | 5 - .changeset/few-cats-type.md | 34 --- .changeset/giant-snakes-watch.md | 5 - .changeset/heavy-terms-vanish.md | 5 - .changeset/hip-trees-heal.md | 23 -- .changeset/khaki-dancers-admire.md | 23 -- .changeset/long-socks-fold.md | 8 - .changeset/modern-ladybugs-perform.md | 5 - .changeset/nine-hornets-wave.md | 5 - .changeset/old-crabs-jump.md | 5 - .changeset/olive-singers-sparkle.md | 5 - .changeset/perfect-toes-search.md | 17 -- .changeset/pink-bags-tickle.md | 5 - .changeset/pretty-dryers-turn.md | 7 - .changeset/real-bulldogs-greet.md | 6 - .changeset/search-cross-the-goal.md | 9 - .changeset/search-new-fantastic-pov.md | 76 ------ .changeset/search-whole-new-world.md | 118 --------- .changeset/shiny-hotels-tell.md | 5 - .changeset/silent-lions-collect.md | 5 - .changeset/slimy-games-brake.md | 5 - .changeset/sour-brooms-dream.md | 9 - .changeset/strange-chicken-explain.md | 5 - .changeset/tame-hotels-itch.md | 6 - .changeset/tricky-goats-boil.md | 5 - .changeset/warm-bikes-warn.md | 5 - .changeset/were-only-dreaming.md | 176 ------------- .changeset/wild-wasps-turn.md | 5 - packages/app/CHANGELOG.md | 30 +++ packages/app/package.json | 22 +- packages/backend-common/CHANGELOG.md | 28 ++ packages/backend-common/package.json | 6 +- packages/backend-test-utils/CHANGELOG.md | 14 + packages/backend-test-utils/package.json | 8 +- packages/backend/CHANGELOG.md | 26 ++ packages/backend/package.json | 22 +- packages/catalog-client/CHANGELOG.md | 8 + packages/catalog-client/package.json | 6 +- packages/catalog-model/CHANGELOG.md | 22 ++ packages/catalog-model/package.json | 4 +- packages/cli/CHANGELOG.md | 53 ++++ packages/cli/package.json | 4 +- packages/codemods/CHANGELOG.md | 15 ++ packages/codemods/package.json | 2 +- packages/core-api/CHANGELOG.md | 9 + packages/core-api/package.json | 6 +- packages/core-app-api/CHANGELOG.md | 43 ++++ packages/core-app-api/package.json | 8 +- packages/core-components/CHANGELOG.md | 39 +++ packages/core-components/package.json | 8 +- packages/core-plugin-api/CHANGELOG.md | 36 +++ packages/core-plugin-api/package.json | 4 +- packages/core/package.json | 4 +- packages/create-app/CHANGELOG.md | 283 +++++++++++++++++++++ packages/create-app/package.json | 2 +- packages/dev-utils/package.json | 8 +- packages/errors/package.json | 2 +- packages/integration-react/CHANGELOG.md | 10 + packages/integration-react/package.json | 6 +- packages/integration/CHANGELOG.md | 6 + packages/integration/package.json | 4 +- packages/search-common/CHANGELOG.md | 9 + packages/search-common/package.json | 4 +- packages/techdocs-common/package.json | 8 +- packages/test-utils/package.json | 4 +- packages/theme/package.json | 2 +- plugins/api-docs/package.json | 6 +- plugins/app-backend/package.json | 4 +- plugins/auth-backend/package.json | 8 +- plugins/badges-backend/package.json | 8 +- plugins/badges/package.json | 6 +- plugins/bitrise/package.json | 6 +- plugins/catalog-backend/CHANGELOG.md | 18 ++ plugins/catalog-backend/package.json | 18 +- plugins/catalog-graphql/package.json | 6 +- plugins/catalog-import/CHANGELOG.md | 16 ++ plugins/catalog-import/package.json | 14 +- plugins/catalog-react/CHANGELOG.md | 16 ++ plugins/catalog-react/package.json | 12 +- plugins/catalog/CHANGELOG.md | 23 ++ plugins/catalog/package.json | 14 +- plugins/circleci/package.json | 6 +- plugins/cloudbuild/package.json | 6 +- plugins/code-coverage-backend/package.json | 10 +- plugins/code-coverage/package.json | 6 +- plugins/config-schema/package.json | 2 +- plugins/cost-insights/CHANGELOG.md | 6 + plugins/cost-insights/package.json | 4 +- plugins/explore-react/package.json | 2 +- plugins/explore/package.json | 6 +- plugins/fossa/package.json | 6 +- plugins/gcp-projects/package.json | 2 +- plugins/git-release-manager/package.json | 4 +- plugins/github-actions/CHANGELOG.md | 12 + plugins/github-actions/package.json | 10 +- plugins/github-deployments/CHANGELOG.md | 14 + plugins/github-deployments/package.json | 12 +- plugins/gitops-profiles/package.json | 2 +- plugins/graphiql/package.json | 4 +- plugins/graphql/package.json | 4 +- plugins/ilert/package.json | 6 +- plugins/jenkins/package.json | 6 +- plugins/kafka-backend/package.json | 6 +- plugins/kafka/package.json | 6 +- plugins/kubernetes-backend/package.json | 6 +- plugins/kubernetes-common/package.json | 4 +- plugins/kubernetes/package.json | 6 +- plugins/lighthouse/package.json | 6 +- plugins/newrelic/package.json | 2 +- plugins/org/package.json | 8 +- plugins/pagerduty/package.json | 6 +- plugins/proxy-backend/CHANGELOG.md | 9 + plugins/proxy-backend/package.json | 6 +- plugins/register-component/package.json | 6 +- plugins/rollbar-backend/package.json | 4 +- plugins/rollbar/package.json | 6 +- plugins/scaffolder-backend/CHANGELOG.md | 50 ++++ plugins/scaffolder-backend/package.json | 12 +- plugins/scaffolder/CHANGELOG.md | 34 +++ plugins/scaffolder/package.json | 14 +- plugins/search-backend-node/CHANGELOG.md | 85 +++++++ plugins/search-backend-node/package.json | 8 +- plugins/search-backend/CHANGELOG.md | 86 +++++++ plugins/search-backend/package.json | 10 +- plugins/search/CHANGELOG.md | 132 ++++++++++ plugins/search/package.json | 10 +- plugins/sentry/package.json | 6 +- plugins/shortcuts/package.json | 2 +- plugins/sonarqube/package.json | 6 +- plugins/splunk-on-call/package.json | 6 +- plugins/tech-radar/package.json | 2 +- plugins/techdocs-backend/package.json | 6 +- plugins/techdocs/package.json | 10 +- plugins/todo-backend/package.json | 10 +- plugins/todo/package.json | 12 +- plugins/user-settings/package.json | 2 +- plugins/welcome/package.json | 2 +- 144 files changed, 1399 insertions(+), 965 deletions(-) delete mode 100644 .changeset/breezy-ways-try.md delete mode 100644 .changeset/catalog-search-item.md delete mode 100644 .changeset/cuddly-yaks-sneeze.md delete mode 100644 .changeset/cyan-suns-chew.md delete mode 100644 .changeset/early-baboons-double.md delete mode 100644 .changeset/eight-doors-melt.md delete mode 100644 .changeset/empty-berries-melt.md delete mode 100644 .changeset/famous-rockets-share.md delete mode 100644 .changeset/few-cats-type.md delete mode 100644 .changeset/giant-snakes-watch.md delete mode 100644 .changeset/heavy-terms-vanish.md delete mode 100644 .changeset/hip-trees-heal.md delete mode 100644 .changeset/khaki-dancers-admire.md delete mode 100644 .changeset/long-socks-fold.md delete mode 100644 .changeset/modern-ladybugs-perform.md delete mode 100644 .changeset/nine-hornets-wave.md delete mode 100644 .changeset/old-crabs-jump.md delete mode 100644 .changeset/olive-singers-sparkle.md delete mode 100644 .changeset/perfect-toes-search.md delete mode 100644 .changeset/pink-bags-tickle.md delete mode 100644 .changeset/pretty-dryers-turn.md delete mode 100644 .changeset/real-bulldogs-greet.md delete mode 100644 .changeset/search-cross-the-goal.md delete mode 100644 .changeset/search-new-fantastic-pov.md delete mode 100644 .changeset/search-whole-new-world.md delete mode 100644 .changeset/shiny-hotels-tell.md delete mode 100644 .changeset/silent-lions-collect.md delete mode 100644 .changeset/slimy-games-brake.md delete mode 100644 .changeset/sour-brooms-dream.md delete mode 100644 .changeset/strange-chicken-explain.md delete mode 100644 .changeset/tame-hotels-itch.md delete mode 100644 .changeset/tricky-goats-boil.md delete mode 100644 .changeset/warm-bikes-warn.md delete mode 100644 .changeset/were-only-dreaming.md delete mode 100644 .changeset/wild-wasps-turn.md create mode 100644 packages/backend-test-utils/CHANGELOG.md create mode 100644 packages/codemods/CHANGELOG.md create mode 100644 packages/search-common/CHANGELOG.md diff --git a/.changeset/breezy-ways-try.md b/.changeset/breezy-ways-try.md deleted file mode 100644 index 15e831a673..0000000000 --- a/.changeset/breezy-ways-try.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -'@backstage/cli': minor ---- - -Switch from `ts-jest` to `@sucrase/jest-plugin`, improving performance and aligning transpilation with bundling. - -In order to switch back to `ts-jest`, install `ts-jest@^26.4.3` as a dependency in the root of your repo and add the following in the root `package.json`: - -```json -"jest": { - "globals": { - "ts-jest": { - "isolatedModules": true - } - }, - "transform": { - "\\.esm\\.js$": "@backstage/cli/config/jestEsmTransform.js", - "\\.(js|jsx|ts|tsx)$": "ts-jest", - "\\.(bmp|gif|jpg|jpeg|png|frag|xml|svg)$": "@backstage/cli/config/jestFileTransform.js", - "\\.(yaml)$": "yaml-jest" - } -} -``` - -Note that this will override the default jest transforms included with the `@backstage/cli`. - -It is possible that some test code needs a small migration as a result of this change, which stems from a difference in how `sucrase` and `ts-jest` transform module re-exports. - -Consider the following code: - -```ts -import * as utils from './utils'; - -jest.spyOn(utils, 'myUtility').mockReturnValue(3); -``` - -If the `./utils` import for example refers to an index file that in turn re-exports from `./utils/myUtility`, you would have to change the code to the following to work around the fact that the exported object from `./utils` ends up not having configurable properties, thus breaking `jest.spyOn`. - -```ts -import * as utils from './utils/myUtility'; - -jest.spyOn(utils, 'myUtility').mockReturnValue(3); -``` diff --git a/.changeset/catalog-search-item.md b/.changeset/catalog-search-item.md deleted file mode 100644 index c1a12ec161..0000000000 --- a/.changeset/catalog-search-item.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-catalog': patch ---- - -A `` component is now available for use in custom Search Experiences. diff --git a/.changeset/cuddly-yaks-sneeze.md b/.changeset/cuddly-yaks-sneeze.md deleted file mode 100644 index 47d24d1cdb..0000000000 --- a/.changeset/cuddly-yaks-sneeze.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/core-api': patch ---- - -Improve forwards compatibility with `@backstage/core-app-api` and `@backstage/core-plugin-api` by re-using route reference types and factory methods from `@backstage/core-plugin-api`. diff --git a/.changeset/cyan-suns-chew.md b/.changeset/cyan-suns-chew.md deleted file mode 100644 index 95d51c23fe..0000000000 --- a/.changeset/cyan-suns-chew.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-cost-insights': patch ---- - -Move `canvas` package to `devDependencies`. diff --git a/.changeset/early-baboons-double.md b/.changeset/early-baboons-double.md deleted file mode 100644 index efbf0f559e..0000000000 --- a/.changeset/early-baboons-double.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/core-app-api': patch ---- - -Fixes a type bug where supplying all app icons to `createApp` was required, rather than just a partial list. diff --git a/.changeset/eight-doors-melt.md b/.changeset/eight-doors-melt.md deleted file mode 100644 index 7a44216746..0000000000 --- a/.changeset/eight-doors-melt.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -'@backstage/create-app': patch ---- - -Updated the `@gitbeaker/node` dependency past the broken one without a `dist` folder. - -See [this issue](https://github.com/jdalrymple/gitbeaker/issues/1861) for more details. - -If you get build errors that look like the following in your Backstage instance, you may want to also bump all of your `@gitbeaker/*` dependencies to at least `^30.2.0`. - -``` -node:internal/modules/cjs/loader:356 - throw err; - ^ - -Error: Cannot find module '/path/to/project/node_modules/@gitbeaker/node/dist/index.js'. Please verify that the package.json has a valid "main" entry - at tryPackage (node:internal/modules/cjs/loader:348:19) - at Function.Module._findPath (node:internal/modules/cjs/loader:561:18) - at Function.Module._resolveFilename (node:internal/modules/cjs/loader:926:27) - at Function.Module._load (node:internal/modules/cjs/loader:773:27) - at Module.require (node:internal/modules/cjs/loader:1012:19) - at require (node:internal/modules/cjs/helpers:93:18) - at Object. (/path/to/project/test.js:4:18) - at Module._compile (node:internal/modules/cjs/loader:1108:14) - at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10) - at Module.load (node:internal/modules/cjs/loader:988:32) { - code: 'MODULE_NOT_FOUND', - path: '/path/to/project/node_modules/@gitbeaker/node/package.json', - requestPath: '@gitbeaker/node' -} -``` - -you could also consider pinning the version to an older one in your `package.json` either root or `packages/backend/package.json`, before the breakage occurred. - -```json -"resolutions": { - "**/@gitbeaker/node": "29.2.4", - "**/@gitbeaker/core": "29.2.4", - "**/@gitbeaker/requester-utils": "29.2.4" -} -``` - -Be aware that this is only required short term until we can release our updated versions of `@backstage/plugin-scaffolder-backend`. diff --git a/.changeset/empty-berries-melt.md b/.changeset/empty-berries-melt.md deleted file mode 100644 index ab1125262a..0000000000 --- a/.changeset/empty-berries-melt.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-catalog-backend': patch ---- - -Restructure the next catalog types and files a bit diff --git a/.changeset/famous-rockets-share.md b/.changeset/famous-rockets-share.md deleted file mode 100644 index 8b5a216fc9..0000000000 --- a/.changeset/famous-rockets-share.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/core-components': patch ---- - -Use app.title for helmet in header diff --git a/.changeset/few-cats-type.md b/.changeset/few-cats-type.md deleted file mode 100644 index 45a59d5ada..0000000000 --- a/.changeset/few-cats-type.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -'@backstage/core-app-api': patch -'@backstage/core-components': patch -'@backstage/core-plugin-api': patch ---- - -This change adds automatic error boundaries around extensions. - -This means that all exposed parts of a plugin are wrapped in a general error boundary component, that is plugin aware. The default design for the error box is borrowed from `@backstage/errors`. To override the default "fallback", one must provide a component named `ErrorBoundaryFallback` to `createApp`, like so: - -```ts -const app = createApp({ - components: { - ErrorBoundaryFallback: props => { - // a custom fallback component - return ( - <> -

Oops.

-

- The plugin {props.plugin.getId()} failed with {props.error.message} -

- - - ); - }, - }, -}); -``` - -The props here include: - -- `error`. An `Error` object or something that inherits it that represents the error that was thrown from any inner component. -- `resetError`. A callback that will simply attempt to mount the children of the error boundary again. -- `plugin`. A `BackstagePlugin` that can be used to look up info to be presented in the error message. For instance, you may want to keep a map of your internal plugins and team names or slack channels and present these when an error occurs. Typically, you'll do that by getting the plugin ID with `plugin.getId()`. diff --git a/.changeset/giant-snakes-watch.md b/.changeset/giant-snakes-watch.md deleted file mode 100644 index 553518b678..0000000000 --- a/.changeset/giant-snakes-watch.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/backend-test-utils': patch ---- - -Skip running docker tests unless in CI diff --git a/.changeset/heavy-terms-vanish.md b/.changeset/heavy-terms-vanish.md deleted file mode 100644 index 90a1b31e53..0000000000 --- a/.changeset/heavy-terms-vanish.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-github-actions': patch ---- - -Add missing token on job list call to GitHub API diff --git a/.changeset/hip-trees-heal.md b/.changeset/hip-trees-heal.md deleted file mode 100644 index 422402dcee..0000000000 --- a/.changeset/hip-trees-heal.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -'@backstage/backend-common': patch ---- - -Omits the `upgrade-insecure-requests` Content-Security-Policy directive by default, to prevent automatic HTTPS request upgrading for HTTP-deployed Backstage sites. - -If you previously disabled this using `false` in your `app-config.yaml`, this line is no longer necessary: - -```diff -backend: - csp: -- upgrade-insecure-requests: false -``` - -To keep the existing behavior of `upgrade-insecure-requests` Content-Security-Policy being _enabled_, add the key with an empty array as the value in your `app-config.yaml`: - -```diff -backend: -+ csp: -+ upgrade-insecure-requests: [] -``` - -Read more on [upgrade-insecure-requests here](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/upgrade-insecure-requests). diff --git a/.changeset/khaki-dancers-admire.md b/.changeset/khaki-dancers-admire.md deleted file mode 100644 index 7c5c61aa90..0000000000 --- a/.changeset/khaki-dancers-admire.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -'@backstage/catalog-model': patch -'@backstage/plugin-scaffolder': patch -'@backstage/plugin-scaffolder-backend': patch ---- - -Introduce conditional steps in scaffolder templates. - -A step can now include an `if` property that only executes a step if the -condition is truthy. The condition can include handlebar templates. - -```yaml -- id: register - if: '{{ not parameters.dryRun }}' - name: Register - action: catalog:register - input: - repoContentsUrl: '{{ steps.publish.output.repoContentsUrl }}' - catalogInfoPath: '/catalog-info.yaml' -``` - -Also introduces a `not` helper in handlebar templates that allows to negate -boolean expressions. diff --git a/.changeset/long-socks-fold.md b/.changeset/long-socks-fold.md deleted file mode 100644 index 23a7811685..0000000000 --- a/.changeset/long-socks-fold.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -'@backstage/integration-react': patch -'@backstage/plugin-catalog': patch ---- - -Move `ScmIntegrationIcon` from `@backstage/plugin-catalog` to -`@backstage/integration-react` and make it customizable using -`app.getSystemIcon()`. diff --git a/.changeset/modern-ladybugs-perform.md b/.changeset/modern-ladybugs-perform.md deleted file mode 100644 index 182b0899db..0000000000 --- a/.changeset/modern-ladybugs-perform.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder-backend': minor ---- - -Scaffolding a repository in Bitbucket will now use the apiBaseUrl if it is provided instead of only the host parameter diff --git a/.changeset/nine-hornets-wave.md b/.changeset/nine-hornets-wave.md deleted file mode 100644 index 7eab7fadc5..0000000000 --- a/.changeset/nine-hornets-wave.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder': patch ---- - -Provide a link to the template source on the `TemplateCard`. diff --git a/.changeset/old-crabs-jump.md b/.changeset/old-crabs-jump.md deleted file mode 100644 index 9441f3aeb7..0000000000 --- a/.changeset/old-crabs-jump.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/cli': patch ---- - -Updated dependencies diff --git a/.changeset/olive-singers-sparkle.md b/.changeset/olive-singers-sparkle.md deleted file mode 100644 index 14e45867a0..0000000000 --- a/.changeset/olive-singers-sparkle.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/core-plugin-api': patch ---- - -Apply fixes to the extension creation API that were mistakenly applied to `@backstage/core-app-api` instead. diff --git a/.changeset/perfect-toes-search.md b/.changeset/perfect-toes-search.md deleted file mode 100644 index 65aceb6f08..0000000000 --- a/.changeset/perfect-toes-search.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -'@backstage/create-app': patch -'@backstage/plugin-scaffolder-backend': patch ---- - -Migrating old `backstage.io/v1alpha1` templates to `backstage.io/v1beta2` - -Deprecating the `create-react-app` Template. We're planning on removing the `create-react-app` templater, as it's been a little tricky to support and takes 15mins to run in a container. We've currently cached a copy of the output for `create-react-app` and ship that under our sample templates folder. If you want to continue using it, we suggest copying the template out of there and putting it in your own repository as it will be removed in upcoming releases. - -We also recommend removing this entry from your `app-config.yaml` if it exists: - -```diff -- - type: url -- target: https://github.com/backstage/backstage/blob/master/plugins/scaffolder-backend/sample-templates/create-react-app/template.yaml -- rules: -- - allow: [Template] -``` diff --git a/.changeset/pink-bags-tickle.md b/.changeset/pink-bags-tickle.md deleted file mode 100644 index 9c600459e7..0000000000 --- a/.changeset/pink-bags-tickle.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/core-app-api': patch ---- - -Deprecate and disable the extension creation methods, which were added to this package by mistake and should only exist within `@backstage/core-plugin-api`. diff --git a/.changeset/pretty-dryers-turn.md b/.changeset/pretty-dryers-turn.md deleted file mode 100644 index 9b80d8f6b7..0000000000 --- a/.changeset/pretty-dryers-turn.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@backstage/plugin-catalog': patch -'@backstage/plugin-catalog-react': patch ---- - -Expose `getEntitySourceLocation`, `getEntityMetadataViewUrl`, and -`getEntityMetadataEditUrl` from `@backstage/plugin-catalog-react`. diff --git a/.changeset/real-bulldogs-greet.md b/.changeset/real-bulldogs-greet.md deleted file mode 100644 index 49d8a65d54..0000000000 --- a/.changeset/real-bulldogs-greet.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@backstage/catalog-client': patch -'@backstage/plugin-catalog-import': patch ---- - -Display preview result final step. diff --git a/.changeset/search-cross-the-goal.md b/.changeset/search-cross-the-goal.md deleted file mode 100644 index 580b28ac23..0000000000 --- a/.changeset/search-cross-the-goal.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'@backstage/search-common': patch -'@backstage/plugin-search-backend-node': patch -'@backstage/plugin-search': patch ---- - -The ` set of components exported by the Search Plugin are now updated to use the Search Backend API. These will be made available as the default non-"next" versions in a follow-up release. - -The interfaces for decorators and collators in the Search Backend have also seen minor, breaking revisions ahead of a general release. If you happen to be building on top of these interfaces, check and update your implementations accordingly. The APIs will be considered more stable in a follow-up release. diff --git a/.changeset/search-new-fantastic-pov.md b/.changeset/search-new-fantastic-pov.md deleted file mode 100644 index 0baba045b7..0000000000 --- a/.changeset/search-new-fantastic-pov.md +++ /dev/null @@ -1,76 +0,0 @@ ---- -'@backstage/plugin-search-backend': minor -'@backstage/plugin-search-backend-node': minor ---- - -This release represents a move out of a pre-alpha phase of the Backstage Search -plugin, into an alpha phase. With this release, you gain more control over the -layout of your search page on the frontend, as well as the ability to extend -search on the backend to encompass everything Backstage users may want to find. - -If you are updating to version `v0.4.0` of `@backstage/plugin-search` from a -prior release, you will need to make modifications to your app backend. - -First, navigate to your backend package and install the two related search -backend packages: - -```sh -cd packages/backend -yarn add @backstage/plugin-search-backend @backstage/plugin-search-backend-node -``` - -Wire up these new packages into your app backend by first creating a new -`search.ts` file at `src/plugins/search.ts` with contents like the following: - -```typescript -import { useHotCleanup } from '@backstage/backend-common'; -import { createRouter } from '@backstage/plugin-search-backend'; -import { - IndexBuilder, - LunrSearchEngine, -} from '@backstage/plugin-search-backend-node'; -import { PluginEnvironment } from '../types'; -import { DefaultCatalogCollator } from '@backstage/plugin-catalog-backend'; - -export default async function createPlugin({ - logger, - discovery, -}: PluginEnvironment) { - // Initialize a connection to a search engine. - const searchEngine = new LunrSearchEngine({ logger }); - const indexBuilder = new IndexBuilder({ logger, searchEngine }); - - // Collators are responsible for gathering documents known to plugins. This - // particular collator gathers entities from the software catalog. - indexBuilder.addCollator({ - defaultRefreshIntervalSeconds: 600, - collator: new DefaultCatalogCollator({ discovery }), - }); - - // The scheduler controls when documents are gathered from collators and sent - // to the search engine for indexing. - const { scheduler } = await indexBuilder.build(); - - // A 3 second delay gives the backend server a chance to initialize before - // any collators are executed, which may attempt requests against the API. - setTimeout(() => scheduler.start(), 3000); - useHotCleanup(module, () => scheduler.stop()); - - return await createRouter({ - engine: indexBuilder.getSearchEngine(), - logger, - }); -} -``` - -Then, ensure the search plugin you configured above is initialized by modifying -your backend's `index.ts` file in the following ways: - -```diff -+import search from './plugins/search'; -// ... -+const searchEnv = useHotMemoize(module, () => createEnv('search')); -// ... -+apiRouter.use('/search', await search(searchEnv)); -// ... -``` diff --git a/.changeset/search-whole-new-world.md b/.changeset/search-whole-new-world.md deleted file mode 100644 index 3dee24a371..0000000000 --- a/.changeset/search-whole-new-world.md +++ /dev/null @@ -1,118 +0,0 @@ ---- -'@backstage/plugin-search': minor ---- - -This release represents a move out of a pre-alpha phase of the Backstage Search -plugin, into an alpha phase. With this release, you gain more control over the -layout of your search page on the frontend, as well as the ability to extend -search on the backend to encompass everything Backstage users may want to find. - -If you are updating to this version of `@backstage/plugin-search` from a prior -release, you will need to make the following modifications to your App: - -In your app package, create a new `searchPage` component at, for example, -`packages/app/src/components/search/SearchPage.tsx` with contents like the -following: - -```tsx -import React from 'react'; -import { makeStyles, Theme, Grid, List, Paper } from '@material-ui/core'; - -import { Content, Header, Lifecycle, Page } from '@backstage/core'; -import { CatalogResultListItem } from '@backstage/plugin-catalog'; -import { - SearchBar, - SearchFilter, - SearchResult, - DefaultResultListItem, -} from '@backstage/plugin-search'; - -const useStyles = makeStyles((theme: Theme) => ({ - bar: { - padding: theme.spacing(1, 0), - }, - filters: { - padding: theme.spacing(2), - }, - filter: { - '& + &': { - marginTop: theme.spacing(2.5), - }, - }, -})); - -const SearchPage = () => { - const classes = useStyles(); - - return ( - -
} /> - - - - - - - - - - - - - - - - {({ results }) => ( - - {results.map(({ type, document }) => { - switch (type) { - case 'software-catalog': - return ( - - ); - default: - return ( - - ); - } - })} - - )} - - - - - - ); -}; - -export const searchPage = ; -``` - -Then in `App.tsx`, import this new `searchPage` component, and set it as a -child of the existing `` route so that it looks like this: - -```tsx -import { searchPage } from './components/search/SearchPage'; -// ... -}> - {searchPage} -; -``` - -You will also need to update your backend. For details, check the changeset for -`v0.2.0` of `@backstage/plugin-search-backend`. diff --git a/.changeset/shiny-hotels-tell.md b/.changeset/shiny-hotels-tell.md deleted file mode 100644 index 7443a8d639..0000000000 --- a/.changeset/shiny-hotels-tell.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-github-deployments': patch ---- - -Add deployment statuses to the GithubDeployments plugin diff --git a/.changeset/silent-lions-collect.md b/.changeset/silent-lions-collect.md deleted file mode 100644 index 76747871ef..0000000000 --- a/.changeset/silent-lions-collect.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/core-app-api': patch ---- - -Update `createApp` options to allow plugins with unknown output types in order to improve forwards and backwards compatibility. diff --git a/.changeset/slimy-games-brake.md b/.changeset/slimy-games-brake.md deleted file mode 100644 index a8fafb09f3..0000000000 --- a/.changeset/slimy-games-brake.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder-backend': patch ---- - -Add `debug:log` action for debugging. diff --git a/.changeset/sour-brooms-dream.md b/.changeset/sour-brooms-dream.md deleted file mode 100644 index 4cb5a0e584..0000000000 --- a/.changeset/sour-brooms-dream.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'@backstage/cli': patch ---- - -Fix error message formatting in the packaging process. - -error.errors can be undefined which will lead to a TypeError, swallowing the actual error message in the process. - -For instance, if you break your tsconfig.json with invalid syntax, backstage-cli will not be able to build anything and it will be very hard to find out why because the underlying error message is hidden behind a TypeError. diff --git a/.changeset/strange-chicken-explain.md b/.changeset/strange-chicken-explain.md deleted file mode 100644 index 0b2dffbccb..0000000000 --- a/.changeset/strange-chicken-explain.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-catalog': patch ---- - -A new card that shows components that depend on the active component diff --git a/.changeset/tame-hotels-itch.md b/.changeset/tame-hotels-itch.md deleted file mode 100644 index 2ae7b005a6..0000000000 --- a/.changeset/tame-hotels-itch.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@backstage/backend-common': patch -'@backstage/integration': patch ---- - -Download archives as compressed tar files for Bitbucket to keep executable permissions. diff --git a/.changeset/tricky-goats-boil.md b/.changeset/tricky-goats-boil.md deleted file mode 100644 index 36d5806d8e..0000000000 --- a/.changeset/tricky-goats-boil.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder-backend': patch ---- - -Update gitbeaker past the broken version without a dist folder diff --git a/.changeset/warm-bikes-warn.md b/.changeset/warm-bikes-warn.md deleted file mode 100644 index a0f6fa73af..0000000000 --- a/.changeset/warm-bikes-warn.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-catalog': patch ---- - -Exported AboutCard contents and utility functions diff --git a/.changeset/were-only-dreaming.md b/.changeset/were-only-dreaming.md deleted file mode 100644 index 09fd6e9875..0000000000 --- a/.changeset/were-only-dreaming.md +++ /dev/null @@ -1,176 +0,0 @@ ---- -'@backstage/create-app': patch ---- - -Added "out-of-the-box" alpha-milestone search features to scaffolded Backstage apps. - -To apply this change to an existing app, do the following... - -First, navigate to your backend package and install the two new search backend -packages: - -```sh -cd packages/backend -yarn add @backstage/plugin-search-backend @backstage/plugin-search-backend-node -``` - -Wire up these new packages into your app backend by first creating a new -`search.ts` file at `src/plugins/search.ts` with contents like the following: - -```typescript -import { useHotCleanup } from '@backstage/backend-common'; -import { createRouter } from '@backstage/plugin-search-backend'; -import { - IndexBuilder, - LunrSearchEngine, -} from '@backstage/plugin-search-backend-node'; -import { PluginEnvironment } from '../types'; -import { DefaultCatalogCollator } from '@backstage/plugin-catalog-backend'; - -export default async function createPlugin({ - logger, - discovery, -}: PluginEnvironment) { - // Initialize a connection to a search engine. - const searchEngine = new LunrSearchEngine({ logger }); - const indexBuilder = new IndexBuilder({ logger, searchEngine }); - - // Collators are responsible for gathering documents known to plugins. This - // particular collator gathers entities from the software catalog. - indexBuilder.addCollator({ - defaultRefreshIntervalSeconds: 600, - collator: new DefaultCatalogCollator({ discovery }), - }); - - // The scheduler controls when documents are gathered from collators and sent - // to the search engine for indexing. - const { scheduler } = await indexBuilder.build(); - - // A 3 second delay gives the backend server a chance to initialize before - // any collators are executed, which may attempt requests against the API. - setTimeout(() => scheduler.start(), 3000); - useHotCleanup(module, () => scheduler.stop()); - - return await createRouter({ - engine: indexBuilder.getSearchEngine(), - logger, - }); -} -``` - -Then, ensure the search plugin you configured above is initialized by modifying -your backend's `index.ts` file in the following ways: - -```diff -+import search from './plugins/search'; -// ... -+const searchEnv = useHotMemoize(module, () => createEnv('search')); -// ... -+apiRouter.use('/search', await search(searchEnv)); -// ... -``` - -In your frontend app package, create a new `searchPage` component at, for -example, `packages/app/src/components/search/SearchPage.tsx` with contents like -the following: - -```tsx -import React from 'react'; -import { makeStyles, Theme, Grid, List, Paper } from '@material-ui/core'; - -import { Content, Header, Lifecycle, Page } from '@backstage/core'; -import { CatalogResultListItem } from '@backstage/plugin-catalog'; -import { - SearchBar, - SearchFilter, - SearchResult, - DefaultResultListItem, -} from '@backstage/plugin-search'; - -const useStyles = makeStyles((theme: Theme) => ({ - bar: { - padding: theme.spacing(1, 0), - }, - filters: { - padding: theme.spacing(2), - }, - filter: { - '& + &': { - marginTop: theme.spacing(2.5), - }, - }, -})); - -const SearchPage = () => { - const classes = useStyles(); - - return ( - -
} /> - - - - - - - - - - - - - - - - {({ results }) => ( - - {results.map(({ type, document }) => { - switch (type) { - case 'software-catalog': - return ( - - ); - default: - return ( - - ); - } - })} - - )} - - - - - - ); -}; - -export const searchPage = ; -``` - -Then in `App.tsx`, import this new `searchPage` component, and set it as a -child of the existing `` route so that it looks like this: - -```diff -+import { searchPage } from './components/search/SearchPage'; -// ... --} /> -+}> -+ {searchPage} -+; -``` diff --git a/.changeset/wild-wasps-turn.md b/.changeset/wild-wasps-turn.md deleted file mode 100644 index 2bdb0d832d..0000000000 --- a/.changeset/wild-wasps-turn.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-proxy-backend': patch ---- - -Fixed proxy requests to the base URL of routes without a trailing slash redirecting to the `target` with the full path appended. diff --git a/packages/app/CHANGELOG.md b/packages/app/CHANGELOG.md index 7f9e9e554d..c200104775 100644 --- a/packages/app/CHANGELOG.md +++ b/packages/app/CHANGELOG.md @@ -1,5 +1,35 @@ # example-app +## 0.2.32 + +### Patch Changes + +- Updated dependencies [9cd3c533c] +- Updated dependencies [db1c8f93b] +- Updated dependencies [9d906c7a1] +- Updated dependencies [9bdd2cca8] +- Updated dependencies [27a9b503a] +- Updated dependencies [f4e3ac5ce] +- Updated dependencies [9b4010965] +- Updated dependencies [7f7443308] +- Updated dependencies [7028ee1ca] +- Updated dependencies [70bc30c5b] +- Updated dependencies [db1c8f93b] +- Updated dependencies [5aff84759] +- Updated dependencies [21e8ebef5] +- Updated dependencies [4fbb00707] +- Updated dependencies [d5ad47bbb] + - @backstage/cli@0.7.0 + - @backstage/plugin-catalog@0.6.2 + - @backstage/plugin-cost-insights@0.10.2 + - @backstage/plugin-github-actions@0.4.9 + - @backstage/catalog-model@0.8.2 + - @backstage/plugin-scaffolder@0.9.8 + - @backstage/integration-react@0.1.3 + - @backstage/plugin-catalog-react@0.2.2 + - @backstage/plugin-catalog-import@0.5.9 + - @backstage/plugin-search@0.4.0 + ## 0.2.31 ### Patch Changes diff --git a/packages/app/package.json b/packages/app/package.json index 03d87dc243..1b0b3aa22c 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,25 +1,25 @@ { "name": "example-app", - "version": "0.2.31", + "version": "0.2.32", "private": true, "bundled": true, "dependencies": { - "@backstage/catalog-model": "^0.8.1", - "@backstage/cli": "^0.6.14", + "@backstage/catalog-model": "^0.8.2", + "@backstage/cli": "^0.7.0", "@backstage/core": "^0.7.12", - "@backstage/integration-react": "^0.1.2", + "@backstage/integration-react": "^0.1.3", "@backstage/plugin-api-docs": "^0.4.15", "@backstage/plugin-badges": "^0.2.2", - "@backstage/plugin-catalog": "^0.6.1", - "@backstage/plugin-catalog-import": "^0.5.8", - "@backstage/plugin-catalog-react": "^0.2.1", + "@backstage/plugin-catalog": "^0.6.2", + "@backstage/plugin-catalog-import": "^0.5.9", + "@backstage/plugin-catalog-react": "^0.2.2", "@backstage/plugin-circleci": "^0.2.15", "@backstage/plugin-cloudbuild": "^0.2.16", "@backstage/plugin-code-coverage": "^0.1.4", - "@backstage/plugin-cost-insights": "^0.10.1", + "@backstage/plugin-cost-insights": "^0.10.2", "@backstage/plugin-explore": "^0.3.6", "@backstage/plugin-gcp-projects": "^0.2.6", - "@backstage/plugin-github-actions": "^0.4.8", + "@backstage/plugin-github-actions": "^0.4.9", "@backstage/plugin-graphiql": "^0.2.11", "@backstage/plugin-jenkins": "^0.4.4", "@backstage/plugin-kafka": "^0.2.8", @@ -29,8 +29,8 @@ "@backstage/plugin-org": "^0.3.14", "@backstage/plugin-pagerduty": "0.3.5", "@backstage/plugin-rollbar": "^0.3.6", - "@backstage/plugin-scaffolder": "^0.9.7", - "@backstage/plugin-search": "^0.3.7", + "@backstage/plugin-scaffolder": "^0.9.8", + "@backstage/plugin-search": "^0.4.0", "@backstage/plugin-sentry": "^0.3.11", "@backstage/plugin-shortcuts": "^0.1.2", "@backstage/plugin-tech-radar": "^0.4.0", diff --git a/packages/backend-common/CHANGELOG.md b/packages/backend-common/CHANGELOG.md index 728d8fabcd..6256697036 100644 --- a/packages/backend-common/CHANGELOG.md +++ b/packages/backend-common/CHANGELOG.md @@ -1,5 +1,33 @@ # @backstage/backend-common +## 0.8.2 + +### Patch Changes + +- 92963779b: Omits the `upgrade-insecure-requests` Content-Security-Policy directive by default, to prevent automatic HTTPS request upgrading for HTTP-deployed Backstage sites. + + If you previously disabled this using `false` in your `app-config.yaml`, this line is no longer necessary: + + ```diff + backend: + csp: + - upgrade-insecure-requests: false + ``` + + To keep the existing behavior of `upgrade-insecure-requests` Content-Security-Policy being _enabled_, add the key with an empty array as the value in your `app-config.yaml`: + + ```diff + backend: + + csp: + + upgrade-insecure-requests: [] + ``` + + Read more on [upgrade-insecure-requests here](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/upgrade-insecure-requests). + +- eda9dbd5f: Download archives as compressed tar files for Bitbucket to keep executable permissions. +- Updated dependencies [eda9dbd5f] + - @backstage/integration@0.5.6 + ## 0.8.1 ### Patch Changes diff --git a/packages/backend-common/package.json b/packages/backend-common/package.json index 4de9c36c8c..fc57ee59a8 100644 --- a/packages/backend-common/package.json +++ b/packages/backend-common/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/backend-common", "description": "Common functionality library for Backstage backends", - "version": "0.8.1", + "version": "0.8.2", "main": "src/index.ts", "types": "src/index.ts", "private": false, @@ -33,7 +33,7 @@ "@backstage/config": "^0.1.5", "@backstage/config-loader": "^0.6.2", "@backstage/errors": "^0.1.1", - "@backstage/integration": "^0.5.3", + "@backstage/integration": "^0.5.6", "@google-cloud/storage": "^5.8.0", "@octokit/rest": "^18.5.3", "@types/cors": "^2.8.6", @@ -76,7 +76,7 @@ } }, "devDependencies": { - "@backstage/cli": "^0.6.12", + "@backstage/cli": "^0.7.0", "@backstage/test-utils": "^0.1.12", "@types/archiver": "^5.1.0", "@types/compression": "^1.7.0", diff --git a/packages/backend-test-utils/CHANGELOG.md b/packages/backend-test-utils/CHANGELOG.md new file mode 100644 index 0000000000..c2078fd0bc --- /dev/null +++ b/packages/backend-test-utils/CHANGELOG.md @@ -0,0 +1,14 @@ +# @backstage/backend-test-utils + +## 0.1.2 + +### Patch Changes + +- 0711954a9: Skip running docker tests unless in CI +- Updated dependencies [9cd3c533c] +- Updated dependencies [92963779b] +- Updated dependencies [7f7443308] +- Updated dependencies [21e8ebef5] +- Updated dependencies [eda9dbd5f] + - @backstage/cli@0.7.0 + - @backstage/backend-common@0.8.2 diff --git a/packages/backend-test-utils/package.json b/packages/backend-test-utils/package.json index 95276651ca..c4ff5603f3 100644 --- a/packages/backend-test-utils/package.json +++ b/packages/backend-test-utils/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/backend-test-utils", "description": "Test helpers library for Backstage backends", - "version": "0.1.1", + "version": "0.1.2", "main": "src/index.ts", "types": "src/index.ts", "private": false, @@ -30,8 +30,8 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/backend-common": "^0.8.0", - "@backstage/cli": "^0.6.10", + "@backstage/backend-common": "^0.8.2", + "@backstage/cli": "^0.7.0", "@backstage/config": "^0.1.5", "knex": "^0.95.1", "mysql2": "^2.2.5", @@ -41,7 +41,7 @@ "uuid": "^8.0.0" }, "devDependencies": { - "@backstage/cli": "^0.6.10", + "@backstage/cli": "^0.7.0", "jest": "^26.0.1" }, "files": [ diff --git a/packages/backend/CHANGELOG.md b/packages/backend/CHANGELOG.md index 4a8fd1b86f..65d28457d0 100644 --- a/packages/backend/CHANGELOG.md +++ b/packages/backend/CHANGELOG.md @@ -1,5 +1,31 @@ # example-backend +## 0.2.32 + +### Patch Changes + +- Updated dependencies [9c63be545] +- Updated dependencies [92963779b] +- Updated dependencies [27a9b503a] +- Updated dependencies [66c6bfebd] +- Updated dependencies [55a253de2] +- Updated dependencies [70bc30c5b] +- Updated dependencies [db1c8f93b] +- Updated dependencies [5aff84759] +- Updated dependencies [f26e6008f] +- Updated dependencies [eda9dbd5f] +- Updated dependencies [4f8cf50fe] +- Updated dependencies [875809a59] + - @backstage/plugin-catalog-backend@0.10.2 + - @backstage/backend-common@0.8.2 + - @backstage/catalog-model@0.8.2 + - @backstage/plugin-scaffolder-backend@0.12.0 + - @backstage/catalog-client@0.3.13 + - @backstage/plugin-search-backend-node@0.2.0 + - @backstage/plugin-search-backend@0.2.0 + - @backstage/plugin-proxy-backend@0.2.9 + - example-app@0.2.32 + ## 0.2.30 ### Patch Changes diff --git a/packages/backend/package.json b/packages/backend/package.json index be843e4d38..f4f304d714 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -1,6 +1,6 @@ { "name": "example-backend", - "version": "0.2.30", + "version": "0.2.32", "main": "dist/index.cjs.js", "types": "src/index.ts", "license": "Apache-2.0", @@ -27,30 +27,30 @@ "migrate:create": "knex migrate:make -x ts" }, "dependencies": { - "@backstage/backend-common": "^0.8.0", - "@backstage/catalog-client": "^0.3.12", - "@backstage/catalog-model": "^0.8.0", + "@backstage/backend-common": "^0.8.2", + "@backstage/catalog-client": "^0.3.13", + "@backstage/catalog-model": "^0.8.2", "@backstage/config": "^0.1.5", "@backstage/plugin-app-backend": "^0.3.13", "@backstage/plugin-auth-backend": "^0.3.12", "@backstage/plugin-badges-backend": "^0.1.6", - "@backstage/plugin-catalog-backend": "^0.10.0", + "@backstage/plugin-catalog-backend": "^0.10.2", "@backstage/plugin-code-coverage-backend": "^0.1.6", "@backstage/plugin-graphql-backend": "^0.1.8", "@backstage/plugin-kubernetes-backend": "^0.3.8", "@backstage/plugin-kafka-backend": "^0.2.6", - "@backstage/plugin-proxy-backend": "^0.2.8", + "@backstage/plugin-proxy-backend": "^0.2.9", "@backstage/plugin-rollbar-backend": "^0.1.11", - "@backstage/plugin-scaffolder-backend": "^0.11.4", - "@backstage/plugin-search-backend": "^0.1.5", - "@backstage/plugin-search-backend-node": "^0.1.3", + "@backstage/plugin-scaffolder-backend": "^0.12.0", + "@backstage/plugin-search-backend": "^0.2.0", + "@backstage/plugin-search-backend-node": "^0.2.0", "@backstage/plugin-techdocs-backend": "^0.8.2", "@backstage/plugin-todo-backend": "^0.1.6", "@gitbeaker/node": "^30.2.0", "@octokit/rest": "^18.5.3", "azure-devops-node-api": "^10.1.1", "dockerode": "^3.2.1", - "example-app": "^0.2.30", + "example-app": "^0.2.32", "express": "^4.17.1", "express-promise-router": "^4.1.0", "knex": "^0.95.1", @@ -60,7 +60,7 @@ "winston": "^3.2.1" }, "devDependencies": { - "@backstage/cli": "^0.6.13", + "@backstage/cli": "^0.7.0", "@types/dockerode": "^3.2.1", "@types/express": "^4.17.6", "@types/express-serve-static-core": "^4.17.5" diff --git a/packages/catalog-client/CHANGELOG.md b/packages/catalog-client/CHANGELOG.md index e1ef7b759b..847924b67b 100644 --- a/packages/catalog-client/CHANGELOG.md +++ b/packages/catalog-client/CHANGELOG.md @@ -1,5 +1,13 @@ # @backstage/catalog-client +## 0.3.13 + +### Patch Changes + +- 70bc30c5b: Display preview result final step. +- Updated dependencies [27a9b503a] + - @backstage/catalog-model@0.8.2 + ## 0.3.12 ### Patch Changes diff --git a/packages/catalog-client/package.json b/packages/catalog-client/package.json index 0cf8d7d1b8..c366374bf5 100644 --- a/packages/catalog-client/package.json +++ b/packages/catalog-client/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/catalog-client", - "version": "0.3.12", + "version": "0.3.13", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -29,13 +29,13 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/catalog-model": "^0.8.0", + "@backstage/catalog-model": "^0.8.2", "@backstage/config": "^0.1.5", "@backstage/errors": "^0.1.1", "cross-fetch": "^3.0.6" }, "devDependencies": { - "@backstage/cli": "^0.6.13", + "@backstage/cli": "^0.7.0", "@types/jest": "^26.0.7", "msw": "^0.21.2" }, diff --git a/packages/catalog-model/CHANGELOG.md b/packages/catalog-model/CHANGELOG.md index 94b4662a97..df350ff288 100644 --- a/packages/catalog-model/CHANGELOG.md +++ b/packages/catalog-model/CHANGELOG.md @@ -1,5 +1,27 @@ # @backstage/catalog-model +## 0.8.2 + +### Patch Changes + +- 27a9b503a: Introduce conditional steps in scaffolder templates. + + A step can now include an `if` property that only executes a step if the + condition is truthy. The condition can include handlebar templates. + + ```yaml + - id: register + if: '{{ not parameters.dryRun }}' + name: Register + action: catalog:register + input: + repoContentsUrl: '{{ steps.publish.output.repoContentsUrl }}' + catalogInfoPath: '/catalog-info.yaml' + ``` + + Also introduces a `not` helper in handlebar templates that allows to negate + boolean expressions. + ## 0.8.1 ### Patch Changes diff --git a/packages/catalog-model/package.json b/packages/catalog-model/package.json index edcffaa691..e2ea7fad92 100644 --- a/packages/catalog-model/package.json +++ b/packages/catalog-model/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/catalog-model", - "version": "0.8.1", + "version": "0.8.2", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -41,7 +41,7 @@ "yup": "^0.29.3" }, "devDependencies": { - "@backstage/cli": "^0.6.14", + "@backstage/cli": "^0.7.0", "@types/express": "^4.17.6", "@types/jest": "^26.0.7", "@types/lodash": "^4.14.151", diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index da06bfea17..8eae37ef56 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -1,5 +1,58 @@ # @backstage/cli +## 0.7.0 + +### Minor Changes + +- 9cd3c533c: Switch from `ts-jest` to `@sucrase/jest-plugin`, improving performance and aligning transpilation with bundling. + + In order to switch back to `ts-jest`, install `ts-jest@^26.4.3` as a dependency in the root of your repo and add the following in the root `package.json`: + + ```json + "jest": { + "globals": { + "ts-jest": { + "isolatedModules": true + } + }, + "transform": { + "\\.esm\\.js$": "@backstage/cli/config/jestEsmTransform.js", + "\\.(js|jsx|ts|tsx)$": "ts-jest", + "\\.(bmp|gif|jpg|jpeg|png|frag|xml|svg)$": "@backstage/cli/config/jestFileTransform.js", + "\\.(yaml)$": "yaml-jest" + } + } + ``` + + Note that this will override the default jest transforms included with the `@backstage/cli`. + + It is possible that some test code needs a small migration as a result of this change, which stems from a difference in how `sucrase` and `ts-jest` transform module re-exports. + + Consider the following code: + + ```ts + import * as utils from './utils'; + + jest.spyOn(utils, 'myUtility').mockReturnValue(3); + ``` + + If the `./utils` import for example refers to an index file that in turn re-exports from `./utils/myUtility`, you would have to change the code to the following to work around the fact that the exported object from `./utils` ends up not having configurable properties, thus breaking `jest.spyOn`. + + ```ts + import * as utils from './utils/myUtility'; + + jest.spyOn(utils, 'myUtility').mockReturnValue(3); + ``` + +### Patch Changes + +- 7f7443308: Updated dependencies +- 21e8ebef5: Fix error message formatting in the packaging process. + + error.errors can be undefined which will lead to a TypeError, swallowing the actual error message in the process. + + For instance, if you break your tsconfig.json with invalid syntax, backstage-cli will not be able to build anything and it will be very hard to find out why because the underlying error message is hidden behind a TypeError. + ## 0.6.14 ### Patch Changes diff --git a/packages/cli/package.json b/packages/cli/package.json index a8df1014fb..7d8940f154 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/cli", "description": "CLI for developing Backstage plugins and apps", - "version": "0.6.14", + "version": "0.7.0", "private": false, "publishConfig": { "access": "public" @@ -118,7 +118,7 @@ "yn": "^4.0.0" }, "devDependencies": { - "@backstage/backend-common": "^0.8.1", + "@backstage/backend-common": "^0.8.2", "@backstage/config": "^0.1.5", "@backstage/core": "^0.7.12", "@backstage/dev-utils": "^0.1.17", diff --git a/packages/codemods/CHANGELOG.md b/packages/codemods/CHANGELOG.md new file mode 100644 index 0000000000..9f2ae5d214 --- /dev/null +++ b/packages/codemods/CHANGELOG.md @@ -0,0 +1,15 @@ +# @backstage/codemods + +## 0.1.1 + +### Patch Changes + +- Updated dependencies [9bca2a252] +- Updated dependencies [e47336ea4] +- Updated dependencies [75b8537ce] +- Updated dependencies [da8cba44f] +- Updated dependencies [da8cba44f] +- Updated dependencies [9bca2a252] + - @backstage/core-app-api@0.1.2 + - @backstage/core-components@0.1.2 + - @backstage/core-plugin-api@0.1.2 diff --git a/packages/codemods/package.json b/packages/codemods/package.json index 16f2e522a7..2ce0172b75 100644 --- a/packages/codemods/package.json +++ b/packages/codemods/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/codemods", "description": "A collection of codemods for Backstage projects", - "version": "0.1.0", + "version": "0.1.1", "private": true, "homepage": "https://backstage.io", "repository": { diff --git a/packages/core-api/CHANGELOG.md b/packages/core-api/CHANGELOG.md index c06e2b6789..2282976d74 100644 --- a/packages/core-api/CHANGELOG.md +++ b/packages/core-api/CHANGELOG.md @@ -1,5 +1,14 @@ # @backstage/core-api +## 0.2.22 + +### Patch Changes + +- 9bca2a252: Improve forwards compatibility with `@backstage/core-app-api` and `@backstage/core-plugin-api` by re-using route reference types and factory methods from `@backstage/core-plugin-api`. +- Updated dependencies [75b8537ce] +- Updated dependencies [da8cba44f] + - @backstage/core-plugin-api@0.1.2 + ## 0.2.21 ### Patch Changes diff --git a/packages/core-api/package.json b/packages/core-api/package.json index 1c3e707a29..1eaeeb24b1 100644 --- a/packages/core-api/package.json +++ b/packages/core-api/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/core-api", "description": "Internal Core API used by Backstage plugins and apps", - "version": "0.2.21", + "version": "0.2.22", "private": false, "publishConfig": { "access": "public", @@ -30,7 +30,7 @@ }, "dependencies": { "@backstage/config": "^0.1.4", - "@backstage/core-plugin-api": "^0.1.1", + "@backstage/core-plugin-api": "^0.1.2", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", @@ -43,7 +43,7 @@ "zen-observable": "^0.8.15" }, "devDependencies": { - "@backstage/cli": "^0.6.14", + "@backstage/cli": "^0.7.0", "@backstage/test-utils": "^0.1.13", "@backstage/test-utils-core": "^0.1.1", "@testing-library/jest-dom": "^5.10.1", diff --git a/packages/core-app-api/CHANGELOG.md b/packages/core-app-api/CHANGELOG.md index f98cf7eeb1..4d7b7541d0 100644 --- a/packages/core-app-api/CHANGELOG.md +++ b/packages/core-app-api/CHANGELOG.md @@ -1,5 +1,48 @@ # @backstage/core-app-api +## 0.1.2 + +### Patch Changes + +- 9bca2a252: Fixes a type bug where supplying all app icons to `createApp` was required, rather than just a partial list. +- 75b8537ce: This change adds automatic error boundaries around extensions. + + This means that all exposed parts of a plugin are wrapped in a general error boundary component, that is plugin aware. The default design for the error box is borrowed from `@backstage/errors`. To override the default "fallback", one must provide a component named `ErrorBoundaryFallback` to `createApp`, like so: + + ```ts + const app = createApp({ + components: { + ErrorBoundaryFallback: props => { + // a custom fallback component + return ( + <> +

Oops.

+

+ The plugin {props.plugin.getId()} failed with{' '} + {props.error.message} +

+ + + ); + }, + }, + }); + ``` + + The props here include: + + - `error`. An `Error` object or something that inherits it that represents the error that was thrown from any inner component. + - `resetError`. A callback that will simply attempt to mount the children of the error boundary again. + - `plugin`. A `BackstagePlugin` that can be used to look up info to be presented in the error message. For instance, you may want to keep a map of your internal plugins and team names or slack channels and present these when an error occurs. Typically, you'll do that by getting the plugin ID with `plugin.getId()`. + +- da8cba44f: Deprecate and disable the extension creation methods, which were added to this package by mistake and should only exist within `@backstage/core-plugin-api`. +- 9bca2a252: Update `createApp` options to allow plugins with unknown output types in order to improve forwards and backwards compatibility. +- Updated dependencies [e47336ea4] +- Updated dependencies [75b8537ce] +- Updated dependencies [da8cba44f] + - @backstage/core-components@0.1.2 + - @backstage/core-plugin-api@0.1.2 + ## 0.1.1 ### Patch Changes diff --git a/packages/core-app-api/package.json b/packages/core-app-api/package.json index ddb598ce9b..9298a53ea4 100644 --- a/packages/core-app-api/package.json +++ b/packages/core-app-api/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/core-app-api", "description": "Core app API used by Backstage apps", - "version": "0.1.1", + "version": "0.1.2", "private": false, "publishConfig": { "access": "public", @@ -29,9 +29,9 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/core-components": "^0.1.1", + "@backstage/core-components": "^0.1.2", "@backstage/config": "^0.1.3", - "@backstage/core-plugin-api": "^0.1.1", + "@backstage/core-plugin-api": "^0.1.2", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", @@ -44,7 +44,7 @@ "zen-observable": "^0.8.15" }, "devDependencies": { - "@backstage/cli": "^0.6.14", + "@backstage/cli": "^0.7.0", "@backstage/test-utils": "^0.1.13", "@backstage/test-utils-core": "^0.1.1", "@testing-library/jest-dom": "^5.10.1", diff --git a/packages/core-components/CHANGELOG.md b/packages/core-components/CHANGELOG.md index 93941494c8..83e5bad9f5 100644 --- a/packages/core-components/CHANGELOG.md +++ b/packages/core-components/CHANGELOG.md @@ -1,5 +1,44 @@ # @backstage/core-components +## 0.1.2 + +### Patch Changes + +- e47336ea4: Use app.title for helmet in header +- 75b8537ce: This change adds automatic error boundaries around extensions. + + This means that all exposed parts of a plugin are wrapped in a general error boundary component, that is plugin aware. The default design for the error box is borrowed from `@backstage/errors`. To override the default "fallback", one must provide a component named `ErrorBoundaryFallback` to `createApp`, like so: + + ```ts + const app = createApp({ + components: { + ErrorBoundaryFallback: props => { + // a custom fallback component + return ( + <> +

Oops.

+

+ The plugin {props.plugin.getId()} failed with{' '} + {props.error.message} +

+ + + ); + }, + }, + }); + ``` + + The props here include: + + - `error`. An `Error` object or something that inherits it that represents the error that was thrown from any inner component. + - `resetError`. A callback that will simply attempt to mount the children of the error boundary again. + - `plugin`. A `BackstagePlugin` that can be used to look up info to be presented in the error message. For instance, you may want to keep a map of your internal plugins and team names or slack channels and present these when an error occurs. Typically, you'll do that by getting the plugin ID with `plugin.getId()`. + +- Updated dependencies [75b8537ce] +- Updated dependencies [da8cba44f] + - @backstage/core-plugin-api@0.1.2 + ## 0.1.1 ### Patch Changes diff --git a/packages/core-components/package.json b/packages/core-components/package.json index 1ce4adf2b7..42a98b859a 100644 --- a/packages/core-components/package.json +++ b/packages/core-components/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/core-components", "description": "Core components used by Backstage plugins and apps", - "version": "0.1.1", + "version": "0.1.2", "private": false, "publishConfig": { "access": "public", @@ -30,7 +30,7 @@ }, "dependencies": { "@backstage/config": "^0.1.5", - "@backstage/core-plugin-api": "^0.1.1", + "@backstage/core-plugin-api": "^0.1.2", "@backstage/errors": "^0.1.1", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", @@ -70,8 +70,8 @@ "zen-observable": "^0.8.15" }, "devDependencies": { - "@backstage/core-app-api": "^0.1.1", - "@backstage/cli": "^0.6.14", + "@backstage/core-app-api": "^0.1.2", + "@backstage/cli": "^0.7.0", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/packages/core-plugin-api/CHANGELOG.md b/packages/core-plugin-api/CHANGELOG.md index fcb4b00a4b..8d45bb8d70 100644 --- a/packages/core-plugin-api/CHANGELOG.md +++ b/packages/core-plugin-api/CHANGELOG.md @@ -1,5 +1,41 @@ # @backstage/core-plugin-api +## 0.1.2 + +### Patch Changes + +- 75b8537ce: This change adds automatic error boundaries around extensions. + + This means that all exposed parts of a plugin are wrapped in a general error boundary component, that is plugin aware. The default design for the error box is borrowed from `@backstage/errors`. To override the default "fallback", one must provide a component named `ErrorBoundaryFallback` to `createApp`, like so: + + ```ts + const app = createApp({ + components: { + ErrorBoundaryFallback: props => { + // a custom fallback component + return ( + <> +

Oops.

+

+ The plugin {props.plugin.getId()} failed with{' '} + {props.error.message} +

+ + + ); + }, + }, + }); + ``` + + The props here include: + + - `error`. An `Error` object or something that inherits it that represents the error that was thrown from any inner component. + - `resetError`. A callback that will simply attempt to mount the children of the error boundary again. + - `plugin`. A `BackstagePlugin` that can be used to look up info to be presented in the error message. For instance, you may want to keep a map of your internal plugins and team names or slack channels and present these when an error occurs. Typically, you'll do that by getting the plugin ID with `plugin.getId()`. + +- da8cba44f: Apply fixes to the extension creation API that were mistakenly applied to `@backstage/core-app-api` instead. + ## 0.1.1 ### Patch Changes diff --git a/packages/core-plugin-api/package.json b/packages/core-plugin-api/package.json index 64c2154ce9..816727ed9e 100644 --- a/packages/core-plugin-api/package.json +++ b/packages/core-plugin-api/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/core-plugin-api", "description": "Core API used by Backstage plugins", - "version": "0.1.1", + "version": "0.1.2", "private": false, "publishConfig": { "access": "public", @@ -41,7 +41,7 @@ "zen-observable": "^0.8.15" }, "devDependencies": { - "@backstage/cli": "^0.6.14", + "@backstage/cli": "^0.7.0", "@backstage/test-utils": "^0.1.13", "@backstage/test-utils-core": "^0.1.1", "@testing-library/jest-dom": "^5.10.1", diff --git a/packages/core/package.json b/packages/core/package.json index ee7e56741d..4ecb3839aa 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -30,7 +30,7 @@ }, "dependencies": { "@backstage/config": "^0.1.5", - "@backstage/core-api": "^0.2.21", + "@backstage/core-api": "^0.2.22", "@backstage/errors": "^0.1.1", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", @@ -71,7 +71,7 @@ "zen-observable": "^0.8.15" }, "devDependencies": { - "@backstage/cli": "^0.6.14", + "@backstage/cli": "^0.7.0", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/packages/create-app/CHANGELOG.md b/packages/create-app/CHANGELOG.md index 5d8e1c3d71..1627f35d6e 100644 --- a/packages/create-app/CHANGELOG.md +++ b/packages/create-app/CHANGELOG.md @@ -1,5 +1,288 @@ # @backstage/create-app +## 1.0.0 + +### Patch Changes + +- 4f8cf50fe: Updated the `@gitbeaker/node` dependency past the broken one without a `dist` folder. + + See [this issue](https://github.com/jdalrymple/gitbeaker/issues/1861) for more details. + + If you get build errors that look like the following in your Backstage instance, you may want to also bump all of your `@gitbeaker/*` dependencies to at least `^30.2.0`. + + ``` + node:internal/modules/cjs/loader:356 + throw err; + ^ + + Error: Cannot find module '/path/to/project/node_modules/@gitbeaker/node/dist/index.js'. Please verify that the package.json has a valid "main" entry + at tryPackage (node:internal/modules/cjs/loader:348:19) + at Function.Module._findPath (node:internal/modules/cjs/loader:561:18) + at Function.Module._resolveFilename (node:internal/modules/cjs/loader:926:27) + at Function.Module._load (node:internal/modules/cjs/loader:773:27) + at Module.require (node:internal/modules/cjs/loader:1012:19) + at require (node:internal/modules/cjs/helpers:93:18) + at Object. (/path/to/project/test.js:4:18) + at Module._compile (node:internal/modules/cjs/loader:1108:14) + at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10) + at Module.load (node:internal/modules/cjs/loader:988:32) { + code: 'MODULE_NOT_FOUND', + path: '/path/to/project/node_modules/@gitbeaker/node/package.json', + requestPath: '@gitbeaker/node' + } + ``` + + you could also consider pinning the version to an older one in your `package.json` either root or `packages/backend/package.json`, before the breakage occurred. + + ```json + "resolutions": { + "**/@gitbeaker/node": "29.2.4", + "**/@gitbeaker/core": "29.2.4", + "**/@gitbeaker/requester-utils": "29.2.4" + } + ``` + + Be aware that this is only required short term until we can release our updated versions of `@backstage/plugin-scaffolder-backend`. + +- 55a253de2: Migrating old `backstage.io/v1alpha1` templates to `backstage.io/v1beta2` + + Deprecating the `create-react-app` Template. We're planning on removing the `create-react-app` templater, as it's been a little tricky to support and takes 15mins to run in a container. We've currently cached a copy of the output for `create-react-app` and ship that under our sample templates folder. If you want to continue using it, we suggest copying the template out of there and putting it in your own repository as it will be removed in upcoming releases. + + We also recommend removing this entry from your `app-config.yaml` if it exists: + + ```diff + - - type: url + - target: https://github.com/backstage/backstage/blob/master/plugins/scaffolder-backend/sample-templates/create-react-app/template.yaml + - rules: + - - allow: [Template] + ``` + +- 509b5638c: Added "out-of-the-box" alpha-milestone search features to scaffolded Backstage apps. + + To apply this change to an existing app, do the following... + + First, navigate to your backend package and install the two new search backend + packages: + + ```sh + cd packages/backend + yarn add @backstage/plugin-search-backend @backstage/plugin-search-backend-node + ``` + + Wire up these new packages into your app backend by first creating a new + `search.ts` file at `src/plugins/search.ts` with contents like the following: + + ```typescript + import { useHotCleanup } from '@backstage/backend-common'; + import { createRouter } from '@backstage/plugin-search-backend'; + import { + IndexBuilder, + LunrSearchEngine, + } from '@backstage/plugin-search-backend-node'; + import { PluginEnvironment } from '../types'; + import { DefaultCatalogCollator } from '@backstage/plugin-catalog-backend'; + + export default async function createPlugin({ + logger, + discovery, + }: PluginEnvironment) { + // Initialize a connection to a search engine. + const searchEngine = new LunrSearchEngine({ logger }); + const indexBuilder = new IndexBuilder({ logger, searchEngine }); + + // Collators are responsible for gathering documents known to plugins. This + // particular collator gathers entities from the software catalog. + indexBuilder.addCollator({ + defaultRefreshIntervalSeconds: 600, + collator: new DefaultCatalogCollator({ discovery }), + }); + + // The scheduler controls when documents are gathered from collators and sent + // to the search engine for indexing. + const { scheduler } = await indexBuilder.build(); + + // A 3 second delay gives the backend server a chance to initialize before + // any collators are executed, which may attempt requests against the API. + setTimeout(() => scheduler.start(), 3000); + useHotCleanup(module, () => scheduler.stop()); + + return await createRouter({ + engine: indexBuilder.getSearchEngine(), + logger, + }); + } + ``` + + Then, ensure the search plugin you configured above is initialized by modifying + your backend's `index.ts` file in the following ways: + + ```diff + +import search from './plugins/search'; + // ... + +const searchEnv = useHotMemoize(module, () => createEnv('search')); + // ... + +apiRouter.use('/search', await search(searchEnv)); + // ... + ``` + + In your frontend app package, create a new `searchPage` component at, for + example, `packages/app/src/components/search/SearchPage.tsx` with contents like + the following: + + ```tsx + import React from 'react'; + import { makeStyles, Theme, Grid, List, Paper } from '@material-ui/core'; + + import { Content, Header, Lifecycle, Page } from '@backstage/core'; + import { CatalogResultListItem } from '@backstage/plugin-catalog'; + import { + SearchBar, + SearchFilter, + SearchResult, + DefaultResultListItem, + } from '@backstage/plugin-search'; + + const useStyles = makeStyles((theme: Theme) => ({ + bar: { + padding: theme.spacing(1, 0), + }, + filters: { + padding: theme.spacing(2), + }, + filter: { + '& + &': { + marginTop: theme.spacing(2.5), + }, + }, + })); + + const SearchPage = () => { + const classes = useStyles(); + + return ( + +
} /> + + + + + + + + + + + + + + + + {({ results }) => ( + + {results.map(({ type, document }) => { + switch (type) { + case 'software-catalog': + return ( + + ); + default: + return ( + + ); + } + })} + + )} + + + + + + ); + }; + + export const searchPage = ; + ``` + + Then in `App.tsx`, import this new `searchPage` component, and set it as a + child of the existing `` route so that it looks like this: + + ```diff + +import { searchPage } from './components/search/SearchPage'; + // ... + -} /> + +}> + + {searchPage} + +; + ``` + +- Updated dependencies [9cd3c533c] +- Updated dependencies [db1c8f93b] +- Updated dependencies [9c63be545] +- Updated dependencies [9bdd2cca8] +- Updated dependencies [92963779b] +- Updated dependencies [27a9b503a] +- Updated dependencies [f4e3ac5ce] +- Updated dependencies [66c6bfebd] +- Updated dependencies [9b4010965] +- Updated dependencies [7f7443308] +- Updated dependencies [55a253de2] +- Updated dependencies [7028ee1ca] +- Updated dependencies [70bc30c5b] +- Updated dependencies [db1c8f93b] +- Updated dependencies [5aff84759] +- Updated dependencies [5aff84759] +- Updated dependencies [f26e6008f] +- Updated dependencies [21e8ebef5] +- Updated dependencies [4fbb00707] +- Updated dependencies [eda9dbd5f] +- Updated dependencies [4f8cf50fe] +- Updated dependencies [d5ad47bbb] +- Updated dependencies [875809a59] + - @backstage/cli@0.7.0 + - @backstage/plugin-catalog@0.6.2 + - @backstage/plugin-catalog-backend@0.10.2 + - @backstage/plugin-github-actions@0.4.9 + - @backstage/backend-common@0.8.2 + - @backstage/catalog-model@0.8.2 + - @backstage/plugin-scaffolder@0.9.8 + - @backstage/plugin-scaffolder-backend@0.12.0 + - @backstage/integration-react@0.1.3 + - @backstage/catalog-client@0.3.13 + - @backstage/plugin-catalog-import@0.5.9 + - @backstage/plugin-search-backend-node@0.2.0 + - @backstage/plugin-search@0.4.0 + - @backstage/plugin-search-backend@0.2.0 + - @backstage/plugin-proxy-backend@0.2.9 + - @backstage/core@0.7.12 + - @backstage/errors@0.1.1 + - @backstage/test-utils@0.1.13 + - @backstage/theme@0.2.8 + - @backstage/plugin-api-docs@0.4.15 + - @backstage/plugin-app-backend@0.3.13 + - @backstage/plugin-auth-backend@0.3.12 + - @backstage/plugin-explore@0.3.6 + - @backstage/plugin-lighthouse@0.2.17 + - @backstage/plugin-rollbar-backend@0.1.11 + - @backstage/plugin-tech-radar@0.4.0 + - @backstage/plugin-techdocs@0.9.5 + - @backstage/plugin-techdocs-backend@0.8.2 + - @backstage/plugin-user-settings@0.2.10 + ## 0.3.24 ### Patch Changes diff --git a/packages/create-app/package.json b/packages/create-app/package.json index c69354044d..1373c52c71 100644 --- a/packages/create-app/package.json +++ b/packages/create-app/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/create-app", "description": "Create app package for Backstage", - "version": "0.3.24", + "version": "1.0.0", "private": false, "publishConfig": { "access": "public" diff --git a/packages/dev-utils/package.json b/packages/dev-utils/package.json index 91c34c8ef2..100d06b1a0 100644 --- a/packages/dev-utils/package.json +++ b/packages/dev-utils/package.json @@ -30,9 +30,9 @@ }, "dependencies": { "@backstage/core": "^0.7.12", - "@backstage/catalog-model": "^0.8.1", - "@backstage/integration-react": "^0.1.2", - "@backstage/plugin-catalog-react": "^0.2.1", + "@backstage/catalog-model": "^0.8.2", + "@backstage/integration-react": "^0.1.3", + "@backstage/plugin-catalog-react": "^0.2.2", "@backstage/test-utils": "^0.1.13", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", @@ -48,7 +48,7 @@ "react-router-dom": "6.0.0-beta.0" }, "devDependencies": { - "@backstage/cli": "^0.6.14", + "@backstage/cli": "^0.7.0", "@types/jest": "^26.0.7", "@types/node": "^14.14.32" }, diff --git a/packages/errors/package.json b/packages/errors/package.json index 508cf4fab0..8fa76d8bfc 100644 --- a/packages/errors/package.json +++ b/packages/errors/package.json @@ -34,7 +34,7 @@ "serialize-error": "^8.0.1" }, "devDependencies": { - "@backstage/cli": "^0.6.1", + "@backstage/cli": "^0.7.0", "@types/jest": "^26.0.7" }, "files": [ diff --git a/packages/integration-react/CHANGELOG.md b/packages/integration-react/CHANGELOG.md index 54aa3b3ab1..711d6d8203 100644 --- a/packages/integration-react/CHANGELOG.md +++ b/packages/integration-react/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/integration-react +## 0.1.3 + +### Patch Changes + +- f4e3ac5ce: Move `ScmIntegrationIcon` from `@backstage/plugin-catalog` to + `@backstage/integration-react` and make it customizable using + `app.getSystemIcon()`. +- Updated dependencies [eda9dbd5f] + - @backstage/integration@0.5.6 + ## 0.1.2 ### Patch Changes diff --git a/packages/integration-react/package.json b/packages/integration-react/package.json index fe831ca24f..313e5b8783 100644 --- a/packages/integration-react/package.json +++ b/packages/integration-react/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/integration-react", - "version": "0.1.2", + "version": "0.1.3", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -22,7 +22,7 @@ "dependencies": { "@backstage/config": "^0.1.2", "@backstage/core": "^0.7.9", - "@backstage/integration": "^0.5.0", + "@backstage/integration": "^0.5.6", "@backstage/theme": "^0.2.3", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", @@ -32,7 +32,7 @@ "react-use": "^17.2.4" }, "devDependencies": { - "@backstage/cli": "^0.6.11", + "@backstage/cli": "^0.7.0", "@backstage/dev-utils": "^0.1.14", "@backstage/test-utils": "^0.1.11", "@testing-library/jest-dom": "^5.10.1", diff --git a/packages/integration/CHANGELOG.md b/packages/integration/CHANGELOG.md index 14b1d75441..3044922a00 100644 --- a/packages/integration/CHANGELOG.md +++ b/packages/integration/CHANGELOG.md @@ -1,5 +1,11 @@ # @backstage/integration +## 0.5.6 + +### Patch Changes + +- eda9dbd5f: Download archives as compressed tar files for Bitbucket to keep executable permissions. + ## 0.5.5 ### Patch Changes diff --git a/packages/integration/package.json b/packages/integration/package.json index 1220493eea..bd557d7ec8 100644 --- a/packages/integration/package.json +++ b/packages/integration/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/integration", - "version": "0.5.5", + "version": "0.5.6", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -37,7 +37,7 @@ "luxon": "^1.25.0" }, "devDependencies": { - "@backstage/cli": "^0.6.14", + "@backstage/cli": "^0.7.0", "@backstage/config-loader": "^0.6.3", "@backstage/test-utils": "^0.1.13", "@types/jest": "^26.0.7", diff --git a/packages/search-common/CHANGELOG.md b/packages/search-common/CHANGELOG.md new file mode 100644 index 0000000000..f4c0e4e6f1 --- /dev/null +++ b/packages/search-common/CHANGELOG.md @@ -0,0 +1,9 @@ +# @backstage/search-common + +## 0.1.2 + +### Patch Changes + +- db1c8f93b: The ` set of components exported by the Search Plugin are now updated to use the Search Backend API. These will be made available as the default non-"next" versions in a follow-up release. + + The interfaces for decorators and collators in the Search Backend have also seen minor, breaking revisions ahead of a general release. If you happen to be building on top of these interfaces, check and update your implementations accordingly. The APIs will be considered more stable in a follow-up release. diff --git a/packages/search-common/package.json b/packages/search-common/package.json index 18e3557a49..5415adbf0d 100644 --- a/packages/search-common/package.json +++ b/packages/search-common/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/search-common", "description": "Common functionalities for Search, to be shared between various search-enabled plugins", - "version": "0.1.1", + "version": "0.1.2", "main": "src/index.ts", "types": "src/index.ts", "private": false, @@ -39,7 +39,7 @@ "@backstage/config": "^0.1.3" }, "devDependencies": { - "@backstage/cli": "^0.6.2" + "@backstage/cli": "^0.7.0" }, "jest": { "roots": [ diff --git a/packages/techdocs-common/package.json b/packages/techdocs-common/package.json index d1ec21060b..ad9d2c6ac2 100644 --- a/packages/techdocs-common/package.json +++ b/packages/techdocs-common/package.json @@ -38,11 +38,11 @@ "dependencies": { "@azure/identity": "^1.2.2", "@azure/storage-blob": "^12.4.0", - "@backstage/backend-common": "^0.8.1", - "@backstage/catalog-model": "^0.8.1", + "@backstage/backend-common": "^0.8.2", + "@backstage/catalog-model": "^0.8.2", "@backstage/config": "^0.1.5", "@backstage/errors": "^0.1.1", - "@backstage/integration": "^0.5.5", + "@backstage/integration": "^0.5.6", "@google-cloud/storage": "^5.6.0", "@types/express": "^4.17.6", "aws-sdk": "^2.840.0", @@ -60,7 +60,7 @@ "winston": "^3.2.1" }, "devDependencies": { - "@backstage/cli": "^0.6.14", + "@backstage/cli": "^0.7.0", "@types/fs-extra": "^9.0.5", "@types/git-url-parse": "^9.0.0", "@types/js-yaml": "^4.0.0", diff --git a/packages/test-utils/package.json b/packages/test-utils/package.json index 8f906965b4..cb6e13d7df 100644 --- a/packages/test-utils/package.json +++ b/packages/test-utils/package.json @@ -29,7 +29,7 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/core-api": "^0.2.21", + "@backstage/core-api": "^0.2.22", "@backstage/test-utils-core": "^0.1.1", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", @@ -45,7 +45,7 @@ "zen-observable": "^0.8.15" }, "devDependencies": { - "@backstage/cli": "^0.6.14", + "@backstage/cli": "^0.7.0", "@types/jest": "^26.0.7", "@types/node": "^14.14.32" }, diff --git a/packages/theme/package.json b/packages/theme/package.json index 2575af6c97..d433be4648 100644 --- a/packages/theme/package.json +++ b/packages/theme/package.json @@ -31,7 +31,7 @@ "@material-ui/core": "^4.11.0" }, "devDependencies": { - "@backstage/cli": "^0.6.14" + "@backstage/cli": "^0.7.0" }, "files": [ "dist" diff --git a/plugins/api-docs/package.json b/plugins/api-docs/package.json index 54588303e1..fd3bc353e9 100644 --- a/plugins/api-docs/package.json +++ b/plugins/api-docs/package.json @@ -30,9 +30,9 @@ }, "dependencies": { "@asyncapi/react-component": "^0.23.0", - "@backstage/catalog-model": "^0.8.0", + "@backstage/catalog-model": "^0.8.2", "@backstage/core": "^0.7.11", - "@backstage/plugin-catalog-react": "^0.2.0", + "@backstage/plugin-catalog-react": "^0.2.2", "@backstage/theme": "^0.2.8", "@material-icons/font": "^1.0.2", "@material-ui/core": "^4.11.0", @@ -49,7 +49,7 @@ "swagger-ui-react": "^3.37.2" }, "devDependencies": { - "@backstage/cli": "^0.6.14", + "@backstage/cli": "^0.7.0", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/app-backend/package.json b/plugins/app-backend/package.json index 60fa678dd0..4d101e7ca5 100644 --- a/plugins/app-backend/package.json +++ b/plugins/app-backend/package.json @@ -29,7 +29,7 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/backend-common": "^0.8.0", + "@backstage/backend-common": "^0.8.2", "@backstage/config-loader": "^0.6.1", "@backstage/config": "^0.1.5", "@types/express": "^4.17.6", @@ -40,7 +40,7 @@ "yn": "^4.0.0" }, "devDependencies": { - "@backstage/cli": "^0.6.11", + "@backstage/cli": "^0.7.0", "@types/supertest": "^2.0.8", "msw": "^0.20.5", "supertest": "^6.1.3" diff --git a/plugins/auth-backend/package.json b/plugins/auth-backend/package.json index dac1c0268a..ab5e252fed 100644 --- a/plugins/auth-backend/package.json +++ b/plugins/auth-backend/package.json @@ -29,9 +29,9 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/backend-common": "^0.8.1", - "@backstage/catalog-client": "^0.3.12", - "@backstage/catalog-model": "^0.8.0", + "@backstage/backend-common": "^0.8.2", + "@backstage/catalog-client": "^0.3.13", + "@backstage/catalog-model": "^0.8.2", "@backstage/config": "^0.1.5", "@backstage/errors": "^0.1.1", "@backstage/test-utils": "^0.1.12", @@ -68,7 +68,7 @@ "yn": "^4.0.0" }, "devDependencies": { - "@backstage/cli": "^0.6.13", + "@backstage/cli": "^0.7.0", "@types/body-parser": "^1.19.0", "@types/cookie-parser": "^1.4.2", "@types/express-session": "^1.17.2", diff --git a/plugins/badges-backend/package.json b/plugins/badges-backend/package.json index 8a38cbaa3b..28adf1399b 100644 --- a/plugins/badges-backend/package.json +++ b/plugins/badges-backend/package.json @@ -30,9 +30,9 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/backend-common": "^0.8.1", - "@backstage/catalog-client": "^0.3.12", - "@backstage/catalog-model": "^0.8.0", + "@backstage/backend-common": "^0.8.2", + "@backstage/catalog-client": "^0.3.13", + "@backstage/catalog-model": "^0.8.2", "@backstage/config": "^0.1.5", "@backstage/errors": "^0.1.1", "@types/express": "^4.17.6", @@ -45,7 +45,7 @@ "yn": "^4.0.0" }, "devDependencies": { - "@backstage/cli": "^0.6.13", + "@backstage/cli": "^0.7.0", "@types/supertest": "^2.0.8", "supertest": "^6.1.3" }, diff --git a/plugins/badges/package.json b/plugins/badges/package.json index 23c914c9ab..99f78f3bd5 100644 --- a/plugins/badges/package.json +++ b/plugins/badges/package.json @@ -20,10 +20,10 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/catalog-model": "^0.8.0", + "@backstage/catalog-model": "^0.8.2", "@backstage/core": "^0.7.11", "@backstage/errors": "^0.1.1", - "@backstage/plugin-catalog-react": "^0.2.0", + "@backstage/plugin-catalog-react": "^0.2.2", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", @@ -34,7 +34,7 @@ "react-use": "^17.2.4" }, "devDependencies": { - "@backstage/cli": "^0.6.14", + "@backstage/cli": "^0.7.0", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/bitrise/package.json b/plugins/bitrise/package.json index 8f3fa016c6..ab43d75061 100644 --- a/plugins/bitrise/package.json +++ b/plugins/bitrise/package.json @@ -20,9 +20,9 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/catalog-model": "^0.8.0", + "@backstage/catalog-model": "^0.8.2", "@backstage/core": "^0.7.11", - "@backstage/plugin-catalog-react": "^0.2.0", + "@backstage/plugin-catalog-react": "^0.2.2", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", @@ -37,7 +37,7 @@ "recharts": "^1.8.5" }, "devDependencies": { - "@backstage/cli": "^0.6.14", + "@backstage/cli": "^0.7.0", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/catalog-backend/CHANGELOG.md b/plugins/catalog-backend/CHANGELOG.md index fe0a72a902..c8ff84831a 100644 --- a/plugins/catalog-backend/CHANGELOG.md +++ b/plugins/catalog-backend/CHANGELOG.md @@ -1,5 +1,23 @@ # @backstage/plugin-catalog-backend +## 0.10.2 + +### Patch Changes + +- 9c63be545: Restructure the next catalog types and files a bit +- Updated dependencies [92963779b] +- Updated dependencies [27a9b503a] +- Updated dependencies [70bc30c5b] +- Updated dependencies [db1c8f93b] +- Updated dependencies [5aff84759] +- Updated dependencies [eda9dbd5f] + - @backstage/backend-common@0.8.2 + - @backstage/catalog-model@0.8.2 + - @backstage/catalog-client@0.3.13 + - @backstage/search-common@0.1.2 + - @backstage/plugin-search-backend-node@0.2.0 + - @backstage/integration@0.5.6 + ## 0.10.1 ### Patch Changes diff --git a/plugins/catalog-backend/package.json b/plugins/catalog-backend/package.json index 6773917d91..a1238d25b6 100644 --- a/plugins/catalog-backend/package.json +++ b/plugins/catalog-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-backend", - "version": "0.10.1", + "version": "0.10.2", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -30,14 +30,14 @@ }, "dependencies": { "@azure/msal-node": "^1.0.0-beta.3", - "@backstage/backend-common": "^0.8.1", - "@backstage/catalog-client": "^0.3.12", - "@backstage/catalog-model": "^0.8.1", + "@backstage/backend-common": "^0.8.2", + "@backstage/catalog-client": "^0.3.13", + "@backstage/catalog-model": "^0.8.2", "@backstage/config": "^0.1.5", "@backstage/errors": "^0.1.1", - "@backstage/integration": "^0.5.5", - "@backstage/plugin-search-backend-node": "^0.1.4", - "@backstage/search-common": "^0.1.1", + "@backstage/integration": "^0.5.6", + "@backstage/plugin-search-backend-node": "^0.2.0", + "@backstage/search-common": "^0.1.2", "@microsoft/microsoft-graph-types": "^1.25.0", "@octokit/graphql": "^4.5.8", "@types/express": "^4.17.6", @@ -65,8 +65,8 @@ "yup": "^0.29.3" }, "devDependencies": { - "@backstage/backend-test-utils": "^0.1.1", - "@backstage/cli": "^0.6.14", + "@backstage/backend-test-utils": "^0.1.2", + "@backstage/cli": "^0.7.0", "@backstage/test-utils": "^0.1.13", "@types/core-js": "^2.5.4", "@types/git-url-parse": "^9.0.0", diff --git a/plugins/catalog-graphql/package.json b/plugins/catalog-graphql/package.json index e8820ee070..40eb6d3382 100644 --- a/plugins/catalog-graphql/package.json +++ b/plugins/catalog-graphql/package.json @@ -30,8 +30,8 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/backend-common": "^0.8.0", - "@backstage/catalog-model": "^0.8.0", + "@backstage/backend-common": "^0.8.2", + "@backstage/catalog-model": "^0.8.2", "@backstage/config": "^0.1.5", "@graphql-modules/core": "^0.7.17", "apollo-server": "^2.16.1", @@ -42,7 +42,7 @@ "winston": "^3.2.1" }, "devDependencies": { - "@backstage/cli": "^0.6.13", + "@backstage/cli": "^0.7.0", "@backstage/test-utils": "^0.1.11", "@graphql-codegen/cli": "^1.21.3", "@graphql-codegen/typescript": "^1.17.7", diff --git a/plugins/catalog-import/CHANGELOG.md b/plugins/catalog-import/CHANGELOG.md index 18c514f847..9b6e1c4487 100644 --- a/plugins/catalog-import/CHANGELOG.md +++ b/plugins/catalog-import/CHANGELOG.md @@ -1,5 +1,21 @@ # @backstage/plugin-catalog-import +## 0.5.9 + +### Patch Changes + +- 70bc30c5b: Display preview result final step. +- Updated dependencies [27a9b503a] +- Updated dependencies [f4e3ac5ce] +- Updated dependencies [7028ee1ca] +- Updated dependencies [70bc30c5b] +- Updated dependencies [eda9dbd5f] + - @backstage/catalog-model@0.8.2 + - @backstage/integration-react@0.1.3 + - @backstage/plugin-catalog-react@0.2.2 + - @backstage/catalog-client@0.3.13 + - @backstage/integration@0.5.6 + ## 0.5.8 ### Patch Changes diff --git a/plugins/catalog-import/package.json b/plugins/catalog-import/package.json index e2db1968d8..c017c3d08a 100644 --- a/plugins/catalog-import/package.json +++ b/plugins/catalog-import/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-import", - "version": "0.5.8", + "version": "0.5.9", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -30,12 +30,12 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/catalog-model": "^0.8.0", - "@backstage/catalog-client": "^0.3.12", + "@backstage/catalog-model": "^0.8.2", + "@backstage/catalog-client": "^0.3.13", "@backstage/core": "^0.7.11", - "@backstage/integration": "^0.5.4", - "@backstage/integration-react": "^0.1.2", - "@backstage/plugin-catalog-react": "^0.2.0", + "@backstage/integration": "^0.5.6", + "@backstage/integration-react": "^0.1.3", + "@backstage/plugin-catalog-react": "^0.2.2", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", @@ -53,7 +53,7 @@ "yaml": "^1.10.0" }, "devDependencies": { - "@backstage/cli": "^0.6.14", + "@backstage/cli": "^0.7.0", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/catalog-react/CHANGELOG.md b/plugins/catalog-react/CHANGELOG.md index 16f2d3e1b1..88d7a04a78 100644 --- a/plugins/catalog-react/CHANGELOG.md +++ b/plugins/catalog-react/CHANGELOG.md @@ -1,5 +1,21 @@ # @backstage/plugin-catalog-react +## 0.2.2 + +### Patch Changes + +- 7028ee1ca: Expose `getEntitySourceLocation`, `getEntityMetadataViewUrl`, and + `getEntityMetadataEditUrl` from `@backstage/plugin-catalog-react`. +- Updated dependencies [75b8537ce] +- Updated dependencies [27a9b503a] +- Updated dependencies [da8cba44f] +- Updated dependencies [70bc30c5b] +- Updated dependencies [eda9dbd5f] + - @backstage/core-plugin-api@0.1.2 + - @backstage/catalog-model@0.8.2 + - @backstage/catalog-client@0.3.13 + - @backstage/integration@0.5.6 + ## 0.2.1 ### Patch Changes diff --git a/plugins/catalog-react/package.json b/plugins/catalog-react/package.json index 8d7bc1f5d1..bb814d7d4f 100644 --- a/plugins/catalog-react/package.json +++ b/plugins/catalog-react/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-react", - "version": "0.2.1", + "version": "0.2.2", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -28,11 +28,11 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/catalog-client": "^0.3.12", - "@backstage/catalog-model": "^0.8.1", + "@backstage/catalog-client": "^0.3.13", + "@backstage/catalog-model": "^0.8.2", "@backstage/core": "^0.7.12", - "@backstage/core-plugin-api": "^0.1.1", - "@backstage/integration": "^0.5.0", + "@backstage/core-plugin-api": "^0.1.2", + "@backstage/integration": "^0.5.6", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", @@ -44,7 +44,7 @@ "react-use": "^17.2.4" }, "devDependencies": { - "@backstage/cli": "^0.6.14", + "@backstage/cli": "^0.7.0", "@backstage/core": "^0.7.12", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", diff --git a/plugins/catalog/CHANGELOG.md b/plugins/catalog/CHANGELOG.md index c04e205715..53df1b37f8 100644 --- a/plugins/catalog/CHANGELOG.md +++ b/plugins/catalog/CHANGELOG.md @@ -1,5 +1,28 @@ # @backstage/plugin-catalog +## 0.6.2 + +### Patch Changes + +- db1c8f93b: A `` component is now available for use in custom Search Experiences. +- f4e3ac5ce: Move `ScmIntegrationIcon` from `@backstage/plugin-catalog` to + `@backstage/integration-react` and make it customizable using + `app.getSystemIcon()`. +- 7028ee1ca: Expose `getEntitySourceLocation`, `getEntityMetadataViewUrl`, and + `getEntityMetadataEditUrl` from `@backstage/plugin-catalog-react`. +- 4fbb00707: A new card that shows components that depend on the active component +- d5ad47bbb: Exported AboutCard contents and utility functions +- Updated dependencies [27a9b503a] +- Updated dependencies [f4e3ac5ce] +- Updated dependencies [7028ee1ca] +- Updated dependencies [70bc30c5b] +- Updated dependencies [eda9dbd5f] + - @backstage/catalog-model@0.8.2 + - @backstage/integration-react@0.1.3 + - @backstage/plugin-catalog-react@0.2.2 + - @backstage/catalog-client@0.3.13 + - @backstage/integration@0.5.6 + ## 0.6.1 ### Patch Changes diff --git a/plugins/catalog/package.json b/plugins/catalog/package.json index 0133ae3bbb..ce72d95103 100644 --- a/plugins/catalog/package.json +++ b/plugins/catalog/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog", - "version": "0.6.1", + "version": "0.6.2", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -30,13 +30,13 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/catalog-client": "^0.3.12", - "@backstage/catalog-model": "^0.8.1", + "@backstage/catalog-client": "^0.3.13", + "@backstage/catalog-model": "^0.8.2", "@backstage/core": "^0.7.12", "@backstage/errors": "^0.1.1", - "@backstage/integration": "^0.5.5", - "@backstage/integration-react": "^0.1.2", - "@backstage/plugin-catalog-react": "^0.2.1", + "@backstage/integration": "^0.5.6", + "@backstage/integration-react": "^0.1.3", + "@backstage/plugin-catalog-react": "^0.2.2", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", @@ -53,7 +53,7 @@ "react-use": "^17.2.4" }, "devDependencies": { - "@backstage/cli": "^0.6.14", + "@backstage/cli": "^0.7.0", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/circleci/package.json b/plugins/circleci/package.json index 20cac43ac9..3091996034 100644 --- a/plugins/circleci/package.json +++ b/plugins/circleci/package.json @@ -31,9 +31,9 @@ "postpack": "backstage-cli postpack" }, "dependencies": { - "@backstage/catalog-model": "^0.8.0", + "@backstage/catalog-model": "^0.8.2", "@backstage/core": "^0.7.11", - "@backstage/plugin-catalog-react": "^0.2.0", + "@backstage/plugin-catalog-react": "^0.2.2", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", @@ -50,7 +50,7 @@ "react-use": "^17.2.4" }, "devDependencies": { - "@backstage/cli": "^0.6.14", + "@backstage/cli": "^0.7.0", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/cloudbuild/package.json b/plugins/cloudbuild/package.json index 03408ac6c1..29cc77d7e9 100644 --- a/plugins/cloudbuild/package.json +++ b/plugins/cloudbuild/package.json @@ -30,8 +30,8 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/catalog-model": "^0.8.0", - "@backstage/plugin-catalog-react": "^0.2.0", + "@backstage/catalog-model": "^0.8.2", + "@backstage/plugin-catalog-react": "^0.2.2", "@backstage/core": "^0.7.11", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", @@ -47,7 +47,7 @@ "react-use": "^17.2.4" }, "devDependencies": { - "@backstage/cli": "^0.6.14", + "@backstage/cli": "^0.7.0", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/code-coverage-backend/package.json b/plugins/code-coverage-backend/package.json index 1306fa093a..7def52f498 100644 --- a/plugins/code-coverage-backend/package.json +++ b/plugins/code-coverage-backend/package.json @@ -19,12 +19,12 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/backend-common": "^0.8.0", - "@backstage/catalog-client": "^0.3.12", - "@backstage/catalog-model": "^0.8.0", + "@backstage/backend-common": "^0.8.2", + "@backstage/catalog-client": "^0.3.13", + "@backstage/catalog-model": "^0.8.2", "@backstage/config": "^0.1.5", "@backstage/errors": "^0.1.1", - "@backstage/integration": "^0.5.4", + "@backstage/integration": "^0.5.6", "@types/express": "^4.17.6", "cross-fetch": "^3.0.6", "express": "^4.17.1", @@ -36,7 +36,7 @@ "yn": "^4.0.0" }, "devDependencies": { - "@backstage/cli": "^0.6.13", + "@backstage/cli": "^0.7.0", "@types/express-xml-bodyparser": "^0.3.2", "@types/supertest": "^2.0.8", "msw": "^0.21.2", diff --git a/plugins/code-coverage/package.json b/plugins/code-coverage/package.json index a7d7126646..51626acef0 100644 --- a/plugins/code-coverage/package.json +++ b/plugins/code-coverage/package.json @@ -20,11 +20,11 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/catalog-model": "^0.8.0", + "@backstage/catalog-model": "^0.8.2", "@backstage/config": "^0.1.4", "@backstage/core": "^0.7.11", "@backstage/errors": "^0.1.1", - "@backstage/plugin-catalog-react": "^0.2.0", + "@backstage/plugin-catalog-react": "^0.2.2", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", @@ -39,7 +39,7 @@ "recharts": "^1.8.5" }, "devDependencies": { - "@backstage/cli": "^0.6.14", + "@backstage/cli": "^0.7.0", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/config-schema/package.json b/plugins/config-schema/package.json index 12e1c65664..427de0967b 100644 --- a/plugins/config-schema/package.json +++ b/plugins/config-schema/package.json @@ -34,7 +34,7 @@ "react-use": "^17.2.4" }, "devDependencies": { - "@backstage/cli": "^0.6.14", + "@backstage/cli": "^0.7.0", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/cost-insights/CHANGELOG.md b/plugins/cost-insights/CHANGELOG.md index 922ab04eb1..f1d0b9b7c8 100644 --- a/plugins/cost-insights/CHANGELOG.md +++ b/plugins/cost-insights/CHANGELOG.md @@ -1,5 +1,11 @@ # @backstage/plugin-cost-insights +## 0.10.2 + +### Patch Changes + +- 9d906c7a1: Move `canvas` package to `devDependencies`. + ## 0.10.1 ### Patch Changes diff --git a/plugins/cost-insights/package.json b/plugins/cost-insights/package.json index bb7e9b6984..32c985be24 100644 --- a/plugins/cost-insights/package.json +++ b/plugins/cost-insights/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-cost-insights", - "version": "0.10.1", + "version": "0.10.2", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -54,7 +54,7 @@ "yup": "^0.29.3" }, "devDependencies": { - "@backstage/cli": "^0.6.14", + "@backstage/cli": "^0.7.0", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/explore-react/package.json b/plugins/explore-react/package.json index 5a8d082abe..cb178e9ae6 100644 --- a/plugins/explore-react/package.json +++ b/plugins/explore-react/package.json @@ -31,7 +31,7 @@ "@backstage/core": "^0.7.9" }, "devDependencies": { - "@backstage/cli": "^0.6.11", + "@backstage/cli": "^0.7.0", "@backstage/dev-utils": "^0.1.14", "@backstage/test-utils": "^0.1.11", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/explore/package.json b/plugins/explore/package.json index a05ed2185d..fd6ff19a93 100644 --- a/plugins/explore/package.json +++ b/plugins/explore/package.json @@ -30,9 +30,9 @@ "start": "backstage-cli plugin:serve" }, "dependencies": { - "@backstage/catalog-model": "^0.8.0", + "@backstage/catalog-model": "^0.8.2", "@backstage/core": "^0.7.11", - "@backstage/plugin-catalog-react": "^0.2.0", + "@backstage/plugin-catalog-react": "^0.2.2", "@backstage/plugin-explore-react": "^0.0.5", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", @@ -45,7 +45,7 @@ "react-use": "^17.2.4" }, "devDependencies": { - "@backstage/cli": "^0.6.14", + "@backstage/cli": "^0.7.0", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/fossa/package.json b/plugins/fossa/package.json index fe0057b200..9f00172358 100644 --- a/plugins/fossa/package.json +++ b/plugins/fossa/package.json @@ -31,10 +31,10 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/catalog-model": "^0.8.0", + "@backstage/catalog-model": "^0.8.2", "@backstage/core": "^0.7.11", "@backstage/errors": "^0.1.1", - "@backstage/plugin-catalog-react": "^0.2.0", + "@backstage/plugin-catalog-react": "^0.2.2", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", @@ -47,7 +47,7 @@ "react-use": "^17.2.4" }, "devDependencies": { - "@backstage/cli": "^0.6.14", + "@backstage/cli": "^0.7.0", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/gcp-projects/package.json b/plugins/gcp-projects/package.json index affb0bf0c6..3be5ae031b 100644 --- a/plugins/gcp-projects/package.json +++ b/plugins/gcp-projects/package.json @@ -41,7 +41,7 @@ "react-use": "^17.2.4" }, "devDependencies": { - "@backstage/cli": "^0.6.14", + "@backstage/cli": "^0.7.0", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/git-release-manager/package.json b/plugins/git-release-manager/package.json index 1c075c420c..e90905a767 100644 --- a/plugins/git-release-manager/package.json +++ b/plugins/git-release-manager/package.json @@ -21,7 +21,7 @@ }, "dependencies": { "@backstage/core": "^0.7.11", - "@backstage/integration": "^0.5.3", + "@backstage/integration": "^0.5.6", "@backstage/theme": "^0.2.8", "recharts": "^1.8.5", "@material-ui/core": "^4.11.0", @@ -36,7 +36,7 @@ "react": "^16.13.1" }, "devDependencies": { - "@backstage/cli": "^0.6.14", + "@backstage/cli": "^0.7.0", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/github-actions/CHANGELOG.md b/plugins/github-actions/CHANGELOG.md index 2f9580b3ca..c404501902 100644 --- a/plugins/github-actions/CHANGELOG.md +++ b/plugins/github-actions/CHANGELOG.md @@ -1,5 +1,17 @@ # @backstage/plugin-github-actions +## 0.4.9 + +### Patch Changes + +- 9bdd2cca8: Add missing token on job list call to GitHub API +- Updated dependencies [27a9b503a] +- Updated dependencies [7028ee1ca] +- Updated dependencies [eda9dbd5f] + - @backstage/catalog-model@0.8.2 + - @backstage/plugin-catalog-react@0.2.2 + - @backstage/integration@0.5.6 + ## 0.4.8 ### Patch Changes diff --git a/plugins/github-actions/package.json b/plugins/github-actions/package.json index 51678940bf..9e651194db 100644 --- a/plugins/github-actions/package.json +++ b/plugins/github-actions/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-github-actions", - "version": "0.4.8", + "version": "0.4.9", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -32,10 +32,10 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/catalog-model": "^0.8.0", - "@backstage/plugin-catalog-react": "^0.2.0", + "@backstage/catalog-model": "^0.8.2", + "@backstage/plugin-catalog-react": "^0.2.2", "@backstage/core": "^0.7.11", - "@backstage/integration": "^0.5.4", + "@backstage/integration": "^0.5.6", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", @@ -50,7 +50,7 @@ "react-use": "^17.2.4" }, "devDependencies": { - "@backstage/cli": "^0.6.14", + "@backstage/cli": "^0.7.0", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/github-deployments/CHANGELOG.md b/plugins/github-deployments/CHANGELOG.md index 3f8a4f51ed..4a2dab8798 100644 --- a/plugins/github-deployments/CHANGELOG.md +++ b/plugins/github-deployments/CHANGELOG.md @@ -1,5 +1,19 @@ # @backstage/plugin-github-deployments +## 0.1.8 + +### Patch Changes + +- ef2f928f4: Add deployment statuses to the GithubDeployments plugin +- Updated dependencies [27a9b503a] +- Updated dependencies [f4e3ac5ce] +- Updated dependencies [7028ee1ca] +- Updated dependencies [eda9dbd5f] + - @backstage/catalog-model@0.8.2 + - @backstage/integration-react@0.1.3 + - @backstage/plugin-catalog-react@0.2.2 + - @backstage/integration@0.5.6 + ## 0.1.7 ### Patch Changes diff --git a/plugins/github-deployments/package.json b/plugins/github-deployments/package.json index aba58f4410..af49b876d3 100644 --- a/plugins/github-deployments/package.json +++ b/plugins/github-deployments/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-github-deployments", - "version": "0.1.7", + "version": "0.1.8", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -20,12 +20,12 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/catalog-model": "^0.8.0", + "@backstage/catalog-model": "^0.8.2", "@backstage/core": "^0.7.11", "@backstage/errors": "^0.1.1", - "@backstage/integration": "^0.5.4", - "@backstage/integration-react": "^0.1.2", - "@backstage/plugin-catalog-react": "^0.2.0", + "@backstage/integration": "^0.5.6", + "@backstage/integration-react": "^0.1.3", + "@backstage/plugin-catalog-react": "^0.2.2", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", @@ -37,7 +37,7 @@ "react-use": "^17.2.4" }, "devDependencies": { - "@backstage/cli": "^0.6.14", + "@backstage/cli": "^0.7.0", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/gitops-profiles/package.json b/plugins/gitops-profiles/package.json index 5116c797b8..66d136b6f8 100644 --- a/plugins/gitops-profiles/package.json +++ b/plugins/gitops-profiles/package.json @@ -42,7 +42,7 @@ "react-use": "^17.2.4" }, "devDependencies": { - "@backstage/cli": "^0.6.14", + "@backstage/cli": "^0.7.0", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/graphiql/package.json b/plugins/graphiql/package.json index c6929fe208..209d105b4c 100644 --- a/plugins/graphiql/package.json +++ b/plugins/graphiql/package.json @@ -32,7 +32,7 @@ }, "dependencies": { "@backstage/core": "^0.7.11", - "@backstage/core-plugin-api": "^0.1.0", + "@backstage/core-plugin-api": "^0.1.2", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", @@ -44,7 +44,7 @@ "react-use": "^17.2.4" }, "devDependencies": { - "@backstage/cli": "^0.6.14", + "@backstage/cli": "^0.7.0", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/graphql/package.json b/plugins/graphql/package.json index 619df1d33b..9d278bceb6 100644 --- a/plugins/graphql/package.json +++ b/plugins/graphql/package.json @@ -29,7 +29,7 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/backend-common": "^0.8.0", + "@backstage/backend-common": "^0.8.2", "@backstage/config": "^0.1.5", "@backstage/plugin-catalog-graphql": "^0.2.9", "@graphql-modules/core": "^0.7.17", @@ -45,7 +45,7 @@ "yn": "^4.0.0" }, "devDependencies": { - "@backstage/cli": "^0.6.11", + "@backstage/cli": "^0.7.0", "@types/supertest": "^2.0.8", "eslint-plugin-graphql": "^4.0.0", "msw": "^0.20.5", diff --git a/plugins/ilert/package.json b/plugins/ilert/package.json index cc3a212c42..84ebdb096e 100644 --- a/plugins/ilert/package.json +++ b/plugins/ilert/package.json @@ -20,10 +20,10 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/catalog-model": "^0.8.0", + "@backstage/catalog-model": "^0.8.2", "@backstage/core": "^0.7.11", "@backstage/errors": "^0.1.1", - "@backstage/plugin-catalog-react": "^0.2.0", + "@backstage/plugin-catalog-react": "^0.2.2", "@backstage/theme": "^0.2.8", "@date-io/luxon": "1.x", "@material-ui/core": "^4.11.0", @@ -37,7 +37,7 @@ "react-use": "^17.2.4" }, "devDependencies": { - "@backstage/cli": "^0.6.14", + "@backstage/cli": "^0.7.0", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/jenkins/package.json b/plugins/jenkins/package.json index ada9815baf..a2204ac704 100644 --- a/plugins/jenkins/package.json +++ b/plugins/jenkins/package.json @@ -31,9 +31,9 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/catalog-model": "^0.8.0", + "@backstage/catalog-model": "^0.8.2", "@backstage/core": "^0.7.11", - "@backstage/plugin-catalog-react": "^0.2.0", + "@backstage/plugin-catalog-react": "^0.2.2", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", @@ -47,7 +47,7 @@ "react-use": "^17.2.4" }, "devDependencies": { - "@backstage/cli": "^0.6.14", + "@backstage/cli": "^0.7.0", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/kafka-backend/package.json b/plugins/kafka-backend/package.json index fbcd1d1e68..617dd2d3cb 100644 --- a/plugins/kafka-backend/package.json +++ b/plugins/kafka-backend/package.json @@ -31,8 +31,8 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/backend-common": "^0.8.0", - "@backstage/catalog-model": "^0.8.0", + "@backstage/backend-common": "^0.8.2", + "@backstage/catalog-model": "^0.8.2", "@backstage/config": "^0.1.5", "@types/express": "^4.17.6", "express": "^4.17.1", @@ -42,7 +42,7 @@ "winston": "^3.2.1" }, "devDependencies": { - "@backstage/cli": "^0.6.13", + "@backstage/cli": "^0.7.0", "@types/jest-when": "^2.7.2", "@types/lodash": "^4.14.151", "jest-when": "^3.1.0", diff --git a/plugins/kafka/package.json b/plugins/kafka/package.json index ce8bc35bd9..01e9408633 100644 --- a/plugins/kafka/package.json +++ b/plugins/kafka/package.json @@ -20,9 +20,9 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/catalog-model": "^0.8.0", + "@backstage/catalog-model": "^0.8.2", "@backstage/core": "^0.7.11", - "@backstage/plugin-catalog-react": "^0.2.0", + "@backstage/plugin-catalog-react": "^0.2.2", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", @@ -33,7 +33,7 @@ "react-use": "^17.2.4" }, "devDependencies": { - "@backstage/cli": "^0.6.14", + "@backstage/cli": "^0.7.0", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/kubernetes-backend/package.json b/plugins/kubernetes-backend/package.json index 06de05fad8..39297dd109 100644 --- a/plugins/kubernetes-backend/package.json +++ b/plugins/kubernetes-backend/package.json @@ -31,8 +31,8 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/backend-common": "^0.8.0", - "@backstage/catalog-model": "^0.8.0", + "@backstage/backend-common": "^0.8.2", + "@backstage/catalog-model": "^0.8.2", "@backstage/config": "^0.1.5", "@backstage/plugin-kubernetes-common": "^0.1.1", "@google-cloud/container": "^2.2.0", @@ -53,7 +53,7 @@ "yn": "^4.0.0" }, "devDependencies": { - "@backstage/cli": "^0.6.13", + "@backstage/cli": "^0.7.0", "@types/aws4": "^1.5.1", "supertest": "^6.1.3" }, diff --git a/plugins/kubernetes-common/package.json b/plugins/kubernetes-common/package.json index a9e5be0b4e..30bf5794bf 100644 --- a/plugins/kubernetes-common/package.json +++ b/plugins/kubernetes-common/package.json @@ -35,11 +35,11 @@ "url": "https://github.com/backstage/backstage/issues" }, "dependencies": { - "@backstage/catalog-model": "^0.8.0", + "@backstage/catalog-model": "^0.8.2", "@kubernetes/client-node": "^0.14.0" }, "devDependencies": { - "@backstage/cli": "^0.6.13" + "@backstage/cli": "^0.7.0" }, "jest": { "roots": [ diff --git a/plugins/kubernetes/package.json b/plugins/kubernetes/package.json index 5f3ca01e37..96820e2a4f 100644 --- a/plugins/kubernetes/package.json +++ b/plugins/kubernetes/package.json @@ -30,10 +30,10 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/catalog-model": "^0.8.0", + "@backstage/catalog-model": "^0.8.2", "@backstage/config": "^0.1.5", "@backstage/core": "^0.7.11", - "@backstage/plugin-catalog-react": "^0.2.0", + "@backstage/plugin-catalog-react": "^0.2.2", "@backstage/plugin-kubernetes-common": "^0.1.1", "@backstage/theme": "^0.2.8", "@kubernetes/client-node": "^0.14.0", @@ -49,7 +49,7 @@ "react-use": "^17.2.4" }, "devDependencies": { - "@backstage/cli": "^0.6.14", + "@backstage/cli": "^0.7.0", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/lighthouse/package.json b/plugins/lighthouse/package.json index ead00d9d7d..f053479f6d 100644 --- a/plugins/lighthouse/package.json +++ b/plugins/lighthouse/package.json @@ -31,10 +31,10 @@ "start": "backstage-cli plugin:serve" }, "dependencies": { - "@backstage/catalog-model": "^0.8.0", + "@backstage/catalog-model": "^0.8.2", "@backstage/config": "^0.1.4", "@backstage/core": "^0.7.11", - "@backstage/plugin-catalog-react": "^0.2.0", + "@backstage/plugin-catalog-react": "^0.2.2", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", @@ -46,7 +46,7 @@ "react-use": "^17.2.4" }, "devDependencies": { - "@backstage/cli": "^0.6.14", + "@backstage/cli": "^0.7.0", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/newrelic/package.json b/plugins/newrelic/package.json index e5fa8d2e88..c3abf86f6b 100644 --- a/plugins/newrelic/package.json +++ b/plugins/newrelic/package.json @@ -41,7 +41,7 @@ "react-use": "^17.2.4" }, "devDependencies": { - "@backstage/cli": "^0.6.14", + "@backstage/cli": "^0.7.0", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/org/package.json b/plugins/org/package.json index c9195d5709..2266eab7fb 100644 --- a/plugins/org/package.json +++ b/plugins/org/package.json @@ -20,10 +20,10 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/catalog-model": "^0.8.0", + "@backstage/catalog-model": "^0.8.2", "@backstage/core": "^0.7.11", - "@backstage/core-api": "^0.2.20", - "@backstage/plugin-catalog-react": "^0.2.0", + "@backstage/core-api": "^0.2.22", + "@backstage/plugin-catalog-react": "^0.2.2", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", @@ -35,7 +35,7 @@ "react-use": "^17.2.4" }, "devDependencies": { - "@backstage/cli": "^0.6.14", + "@backstage/cli": "^0.7.0", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/pagerduty/package.json b/plugins/pagerduty/package.json index 81ac6e23fc..790866aa23 100644 --- a/plugins/pagerduty/package.json +++ b/plugins/pagerduty/package.json @@ -30,9 +30,9 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/catalog-model": "^0.8.0", + "@backstage/catalog-model": "^0.8.2", "@backstage/core": "^0.7.11", - "@backstage/plugin-catalog-react": "^0.2.0", + "@backstage/plugin-catalog-react": "^0.2.2", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", @@ -46,7 +46,7 @@ "react-use": "^17.2.4" }, "devDependencies": { - "@backstage/cli": "^0.6.14", + "@backstage/cli": "^0.7.0", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/proxy-backend/CHANGELOG.md b/plugins/proxy-backend/CHANGELOG.md index 2890039b96..2147e0682a 100644 --- a/plugins/proxy-backend/CHANGELOG.md +++ b/plugins/proxy-backend/CHANGELOG.md @@ -1,5 +1,14 @@ # @backstage/plugin-proxy-backend +## 0.2.9 + +### Patch Changes + +- 875809a59: Fixed proxy requests to the base URL of routes without a trailing slash redirecting to the `target` with the full path appended. +- Updated dependencies [92963779b] +- Updated dependencies [eda9dbd5f] + - @backstage/backend-common@0.8.2 + ## 0.2.8 ### Patch Changes diff --git a/plugins/proxy-backend/package.json b/plugins/proxy-backend/package.json index d2b0d64678..97ccc7c7dc 100644 --- a/plugins/proxy-backend/package.json +++ b/plugins/proxy-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-proxy-backend", - "version": "0.2.8", + "version": "0.2.9", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -28,7 +28,7 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/backend-common": "^0.8.0", + "@backstage/backend-common": "^0.8.2", "@backstage/config": "^0.1.5", "@types/express": "^4.17.6", "express": "^4.17.1", @@ -42,7 +42,7 @@ "yup": "^0.29.3" }, "devDependencies": { - "@backstage/cli": "^0.6.11", + "@backstage/cli": "^0.7.0", "@types/http-proxy-middleware": "^0.19.3", "@types/supertest": "^2.0.8", "@types/uuid": "^8.0.0", diff --git a/plugins/register-component/package.json b/plugins/register-component/package.json index 80b0e96a50..a162c650b3 100644 --- a/plugins/register-component/package.json +++ b/plugins/register-component/package.json @@ -30,9 +30,9 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/catalog-model": "^0.8.0", + "@backstage/catalog-model": "^0.8.2", "@backstage/core": "^0.7.11", - "@backstage/plugin-catalog-react": "^0.2.0", + "@backstage/plugin-catalog-react": "^0.2.2", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", @@ -45,7 +45,7 @@ "react-use": "^17.2.4" }, "devDependencies": { - "@backstage/cli": "^0.6.14", + "@backstage/cli": "^0.7.0", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/rollbar-backend/package.json b/plugins/rollbar-backend/package.json index 03be93dbfa..ca81bc27f2 100644 --- a/plugins/rollbar-backend/package.json +++ b/plugins/rollbar-backend/package.json @@ -30,7 +30,7 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/backend-common": "^0.8.0", + "@backstage/backend-common": "^0.8.2", "@backstage/config": "^0.1.5", "@types/express": "^4.17.6", "axios": "^0.21.1", @@ -47,7 +47,7 @@ "yn": "^4.0.0" }, "devDependencies": { - "@backstage/cli": "^0.6.11", + "@backstage/cli": "^0.7.0", "@types/supertest": "^2.0.8", "supertest": "^6.1.3" }, diff --git a/plugins/rollbar/package.json b/plugins/rollbar/package.json index 06ce51eada..4f55abda2b 100644 --- a/plugins/rollbar/package.json +++ b/plugins/rollbar/package.json @@ -31,9 +31,9 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/catalog-model": "^0.8.0", + "@backstage/catalog-model": "^0.8.2", "@backstage/core": "^0.7.11", - "@backstage/plugin-catalog-react": "^0.2.0", + "@backstage/plugin-catalog-react": "^0.2.2", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", @@ -47,7 +47,7 @@ "react-use": "^17.2.4" }, "devDependencies": { - "@backstage/cli": "^0.6.14", + "@backstage/cli": "^0.7.0", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/scaffolder-backend/CHANGELOG.md b/plugins/scaffolder-backend/CHANGELOG.md index 4d48ea5713..c0cfe8dc58 100644 --- a/plugins/scaffolder-backend/CHANGELOG.md +++ b/plugins/scaffolder-backend/CHANGELOG.md @@ -1,5 +1,55 @@ # @backstage/plugin-scaffolder-backend +## 0.12.0 + +### Minor Changes + +- 66c6bfebd: Scaffolding a repository in Bitbucket will now use the apiBaseUrl if it is provided instead of only the host parameter + +### Patch Changes + +- 27a9b503a: Introduce conditional steps in scaffolder templates. + + A step can now include an `if` property that only executes a step if the + condition is truthy. The condition can include handlebar templates. + + ```yaml + - id: register + if: '{{ not parameters.dryRun }}' + name: Register + action: catalog:register + input: + repoContentsUrl: '{{ steps.publish.output.repoContentsUrl }}' + catalogInfoPath: '/catalog-info.yaml' + ``` + + Also introduces a `not` helper in handlebar templates that allows to negate + boolean expressions. + +- 55a253de2: Migrating old `backstage.io/v1alpha1` templates to `backstage.io/v1beta2` + + Deprecating the `create-react-app` Template. We're planning on removing the `create-react-app` templater, as it's been a little tricky to support and takes 15mins to run in a container. We've currently cached a copy of the output for `create-react-app` and ship that under our sample templates folder. If you want to continue using it, we suggest copying the template out of there and putting it in your own repository as it will be removed in upcoming releases. + + We also recommend removing this entry from your `app-config.yaml` if it exists: + + ```diff + - - type: url + - target: https://github.com/backstage/backstage/blob/master/plugins/scaffolder-backend/sample-templates/create-react-app/template.yaml + - rules: + - - allow: [Template] + ``` + +- f26e6008f: Add `debug:log` action for debugging. +- 4f8cf50fe: Update gitbeaker past the broken version without a dist folder +- Updated dependencies [92963779b] +- Updated dependencies [27a9b503a] +- Updated dependencies [70bc30c5b] +- Updated dependencies [eda9dbd5f] + - @backstage/backend-common@0.8.2 + - @backstage/catalog-model@0.8.2 + - @backstage/catalog-client@0.3.13 + - @backstage/integration@0.5.6 + ## 0.11.5 ### Patch Changes diff --git a/plugins/scaffolder-backend/package.json b/plugins/scaffolder-backend/package.json index ecb914c9de..8eb6097fb6 100644 --- a/plugins/scaffolder-backend/package.json +++ b/plugins/scaffolder-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-scaffolder-backend", - "version": "0.11.5", + "version": "0.12.0", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -29,12 +29,12 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/backend-common": "^0.8.1", - "@backstage/catalog-client": "^0.3.12", - "@backstage/catalog-model": "^0.8.1", + "@backstage/backend-common": "^0.8.2", + "@backstage/catalog-client": "^0.3.13", + "@backstage/catalog-model": "^0.8.2", "@backstage/config": "^0.1.5", "@backstage/errors": "^0.1.1", - "@backstage/integration": "^0.5.5", + "@backstage/integration": "^0.5.6", "@gitbeaker/core": "^30.2.0", "@gitbeaker/node": "^30.2.0", "@octokit/rest": "^18.5.3", @@ -64,7 +64,7 @@ "yaml": "^1.10.0" }, "devDependencies": { - "@backstage/cli": "^0.6.14", + "@backstage/cli": "^0.7.0", "@backstage/test-utils": "^0.1.13", "@types/fs-extra": "^9.0.1", "@types/mock-fs": "^4.13.0", diff --git a/plugins/scaffolder/CHANGELOG.md b/plugins/scaffolder/CHANGELOG.md index 25f27aac81..41603dbafa 100644 --- a/plugins/scaffolder/CHANGELOG.md +++ b/plugins/scaffolder/CHANGELOG.md @@ -1,5 +1,39 @@ # @backstage/plugin-scaffolder +## 0.9.8 + +### Patch Changes + +- 27a9b503a: Introduce conditional steps in scaffolder templates. + + A step can now include an `if` property that only executes a step if the + condition is truthy. The condition can include handlebar templates. + + ```yaml + - id: register + if: '{{ not parameters.dryRun }}' + name: Register + action: catalog:register + input: + repoContentsUrl: '{{ steps.publish.output.repoContentsUrl }}' + catalogInfoPath: '/catalog-info.yaml' + ``` + + Also introduces a `not` helper in handlebar templates that allows to negate + boolean expressions. + +- 9b4010965: Provide a link to the template source on the `TemplateCard`. +- Updated dependencies [27a9b503a] +- Updated dependencies [f4e3ac5ce] +- Updated dependencies [7028ee1ca] +- Updated dependencies [70bc30c5b] +- Updated dependencies [eda9dbd5f] + - @backstage/catalog-model@0.8.2 + - @backstage/integration-react@0.1.3 + - @backstage/plugin-catalog-react@0.2.2 + - @backstage/catalog-client@0.3.13 + - @backstage/integration@0.5.6 + ## 0.9.7 ### Patch Changes diff --git a/plugins/scaffolder/package.json b/plugins/scaffolder/package.json index dceb207ed1..a7541a5ddc 100644 --- a/plugins/scaffolder/package.json +++ b/plugins/scaffolder/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-scaffolder", - "version": "0.9.7", + "version": "0.9.8", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -30,14 +30,14 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/catalog-client": "^0.3.12", - "@backstage/catalog-model": "^0.8.1", + "@backstage/catalog-client": "^0.3.13", + "@backstage/catalog-model": "^0.8.2", "@backstage/config": "^0.1.5", "@backstage/errors": "^0.1.1", "@backstage/core": "^0.7.12", - "@backstage/integration": "^0.5.5", - "@backstage/integration-react": "^0.1.2", - "@backstage/plugin-catalog-react": "^0.2.1", + "@backstage/integration": "^0.5.6", + "@backstage/integration-react": "^0.1.3", + "@backstage/plugin-catalog-react": "^0.2.2", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", @@ -61,7 +61,7 @@ "zen-observable": "^0.8.15" }, "devDependencies": { - "@backstage/cli": "^0.6.14", + "@backstage/cli": "^0.7.0", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/search-backend-node/CHANGELOG.md b/plugins/search-backend-node/CHANGELOG.md index da49bd0726..395074f659 100644 --- a/plugins/search-backend-node/CHANGELOG.md +++ b/plugins/search-backend-node/CHANGELOG.md @@ -1,5 +1,90 @@ # @backstage/plugin-search-backend-node +## 0.2.0 + +### Minor Changes + +- 5aff84759: This release represents a move out of a pre-alpha phase of the Backstage Search + plugin, into an alpha phase. With this release, you gain more control over the + layout of your search page on the frontend, as well as the ability to extend + search on the backend to encompass everything Backstage users may want to find. + + If you are updating to version `v0.4.0` of `@backstage/plugin-search` from a + prior release, you will need to make modifications to your app backend. + + First, navigate to your backend package and install the two related search + backend packages: + + ```sh + cd packages/backend + yarn add @backstage/plugin-search-backend @backstage/plugin-search-backend-node + ``` + + Wire up these new packages into your app backend by first creating a new + `search.ts` file at `src/plugins/search.ts` with contents like the following: + + ```typescript + import { useHotCleanup } from '@backstage/backend-common'; + import { createRouter } from '@backstage/plugin-search-backend'; + import { + IndexBuilder, + LunrSearchEngine, + } from '@backstage/plugin-search-backend-node'; + import { PluginEnvironment } from '../types'; + import { DefaultCatalogCollator } from '@backstage/plugin-catalog-backend'; + + export default async function createPlugin({ + logger, + discovery, + }: PluginEnvironment) { + // Initialize a connection to a search engine. + const searchEngine = new LunrSearchEngine({ logger }); + const indexBuilder = new IndexBuilder({ logger, searchEngine }); + + // Collators are responsible for gathering documents known to plugins. This + // particular collator gathers entities from the software catalog. + indexBuilder.addCollator({ + defaultRefreshIntervalSeconds: 600, + collator: new DefaultCatalogCollator({ discovery }), + }); + + // The scheduler controls when documents are gathered from collators and sent + // to the search engine for indexing. + const { scheduler } = await indexBuilder.build(); + + // A 3 second delay gives the backend server a chance to initialize before + // any collators are executed, which may attempt requests against the API. + setTimeout(() => scheduler.start(), 3000); + useHotCleanup(module, () => scheduler.stop()); + + return await createRouter({ + engine: indexBuilder.getSearchEngine(), + logger, + }); + } + ``` + + Then, ensure the search plugin you configured above is initialized by modifying + your backend's `index.ts` file in the following ways: + + ```diff + +import search from './plugins/search'; + // ... + +const searchEnv = useHotMemoize(module, () => createEnv('search')); + // ... + +apiRouter.use('/search', await search(searchEnv)); + // ... + ``` + +### Patch Changes + +- db1c8f93b: The ` set of components exported by the Search Plugin are now updated to use the Search Backend API. These will be made available as the default non-"next" versions in a follow-up release. + + The interfaces for decorators and collators in the Search Backend have also seen minor, breaking revisions ahead of a general release. If you happen to be building on top of these interfaces, check and update your implementations accordingly. The APIs will be considered more stable in a follow-up release. + +- Updated dependencies [db1c8f93b] + - @backstage/search-common@0.1.2 + ## 0.1.4 ### Patch Changes diff --git a/plugins/search-backend-node/package.json b/plugins/search-backend-node/package.json index 23234aca2f..3f0cf13f8f 100644 --- a/plugins/search-backend-node/package.json +++ b/plugins/search-backend-node/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-search-backend-node", - "version": "0.1.4", + "version": "0.2.0", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -19,14 +19,14 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/search-common": "^0.1.1", + "@backstage/search-common": "^0.1.2", "winston": "^3.2.1", "lunr": "^2.3.9", "@types/lunr": "^2.3.3" }, "devDependencies": { - "@backstage/backend-common": "^0.8.0", - "@backstage/cli": "^0.6.11" + "@backstage/backend-common": "^0.8.2", + "@backstage/cli": "^0.7.0" }, "files": [ "dist" diff --git a/plugins/search-backend/CHANGELOG.md b/plugins/search-backend/CHANGELOG.md index 9d34d92575..491a1da774 100644 --- a/plugins/search-backend/CHANGELOG.md +++ b/plugins/search-backend/CHANGELOG.md @@ -1,5 +1,91 @@ # @backstage/plugin-search-backend +## 0.2.0 + +### Minor Changes + +- 5aff84759: This release represents a move out of a pre-alpha phase of the Backstage Search + plugin, into an alpha phase. With this release, you gain more control over the + layout of your search page on the frontend, as well as the ability to extend + search on the backend to encompass everything Backstage users may want to find. + + If you are updating to version `v0.4.0` of `@backstage/plugin-search` from a + prior release, you will need to make modifications to your app backend. + + First, navigate to your backend package and install the two related search + backend packages: + + ```sh + cd packages/backend + yarn add @backstage/plugin-search-backend @backstage/plugin-search-backend-node + ``` + + Wire up these new packages into your app backend by first creating a new + `search.ts` file at `src/plugins/search.ts` with contents like the following: + + ```typescript + import { useHotCleanup } from '@backstage/backend-common'; + import { createRouter } from '@backstage/plugin-search-backend'; + import { + IndexBuilder, + LunrSearchEngine, + } from '@backstage/plugin-search-backend-node'; + import { PluginEnvironment } from '../types'; + import { DefaultCatalogCollator } from '@backstage/plugin-catalog-backend'; + + export default async function createPlugin({ + logger, + discovery, + }: PluginEnvironment) { + // Initialize a connection to a search engine. + const searchEngine = new LunrSearchEngine({ logger }); + const indexBuilder = new IndexBuilder({ logger, searchEngine }); + + // Collators are responsible for gathering documents known to plugins. This + // particular collator gathers entities from the software catalog. + indexBuilder.addCollator({ + defaultRefreshIntervalSeconds: 600, + collator: new DefaultCatalogCollator({ discovery }), + }); + + // The scheduler controls when documents are gathered from collators and sent + // to the search engine for indexing. + const { scheduler } = await indexBuilder.build(); + + // A 3 second delay gives the backend server a chance to initialize before + // any collators are executed, which may attempt requests against the API. + setTimeout(() => scheduler.start(), 3000); + useHotCleanup(module, () => scheduler.stop()); + + return await createRouter({ + engine: indexBuilder.getSearchEngine(), + logger, + }); + } + ``` + + Then, ensure the search plugin you configured above is initialized by modifying + your backend's `index.ts` file in the following ways: + + ```diff + +import search from './plugins/search'; + // ... + +const searchEnv = useHotMemoize(module, () => createEnv('search')); + // ... + +apiRouter.use('/search', await search(searchEnv)); + // ... + ``` + +### Patch Changes + +- Updated dependencies [92963779b] +- Updated dependencies [db1c8f93b] +- Updated dependencies [5aff84759] +- Updated dependencies [eda9dbd5f] + - @backstage/backend-common@0.8.2 + - @backstage/search-common@0.1.2 + - @backstage/plugin-search-backend-node@0.2.0 + ## 0.1.5 ### Patch Changes diff --git a/plugins/search-backend/package.json b/plugins/search-backend/package.json index c06f54a266..8b906ea9c2 100644 --- a/plugins/search-backend/package.json +++ b/plugins/search-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-search-backend", - "version": "0.1.5", + "version": "0.2.0", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -19,9 +19,9 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/backend-common": "^0.8.0", - "@backstage/search-common": "^0.1.1", - "@backstage/plugin-search-backend-node": "^0.1.3", + "@backstage/backend-common": "^0.8.2", + "@backstage/search-common": "^0.1.2", + "@backstage/plugin-search-backend-node": "^0.2.0", "@types/express": "^4.17.6", "express": "^4.17.1", "express-promise-router": "^4.1.0", @@ -29,7 +29,7 @@ "yn": "^4.0.0" }, "devDependencies": { - "@backstage/cli": "^0.6.11", + "@backstage/cli": "^0.7.0", "@types/supertest": "^2.0.8", "supertest": "^6.1.3" }, diff --git a/plugins/search/CHANGELOG.md b/plugins/search/CHANGELOG.md index c7a70d39a2..29320a1c79 100644 --- a/plugins/search/CHANGELOG.md +++ b/plugins/search/CHANGELOG.md @@ -1,5 +1,137 @@ # @backstage/plugin-search +## 0.4.0 + +### Minor Changes + +- 5aff84759: This release represents a move out of a pre-alpha phase of the Backstage Search + plugin, into an alpha phase. With this release, you gain more control over the + layout of your search page on the frontend, as well as the ability to extend + search on the backend to encompass everything Backstage users may want to find. + + If you are updating to this version of `@backstage/plugin-search` from a prior + release, you will need to make the following modifications to your App: + + In your app package, create a new `searchPage` component at, for example, + `packages/app/src/components/search/SearchPage.tsx` with contents like the + following: + + ```tsx + import React from 'react'; + import { makeStyles, Theme, Grid, List, Paper } from '@material-ui/core'; + + import { Content, Header, Lifecycle, Page } from '@backstage/core'; + import { CatalogResultListItem } from '@backstage/plugin-catalog'; + import { + SearchBar, + SearchFilter, + SearchResult, + DefaultResultListItem, + } from '@backstage/plugin-search'; + + const useStyles = makeStyles((theme: Theme) => ({ + bar: { + padding: theme.spacing(1, 0), + }, + filters: { + padding: theme.spacing(2), + }, + filter: { + '& + &': { + marginTop: theme.spacing(2.5), + }, + }, + })); + + const SearchPage = () => { + const classes = useStyles(); + + return ( + +
} /> + + + + + + + + + + + + + + + + {({ results }) => ( + + {results.map(({ type, document }) => { + switch (type) { + case 'software-catalog': + return ( + + ); + default: + return ( + + ); + } + })} + + )} + + + + + + ); + }; + + export const searchPage = ; + ``` + + Then in `App.tsx`, import this new `searchPage` component, and set it as a + child of the existing `` route so that it looks like this: + + ```tsx + import { searchPage } from './components/search/SearchPage'; + // ... + }> + {searchPage} + ; + ``` + + You will also need to update your backend. For details, check the changeset for + `v0.2.0` of `@backstage/plugin-search-backend`. + +### Patch Changes + +- db1c8f93b: The ` set of components exported by the Search Plugin are now updated to use the Search Backend API. These will be made available as the default non-"next" versions in a follow-up release. + + The interfaces for decorators and collators in the Search Backend have also seen minor, breaking revisions ahead of a general release. If you happen to be building on top of these interfaces, check and update your implementations accordingly. The APIs will be considered more stable in a follow-up release. + +- Updated dependencies [27a9b503a] +- Updated dependencies [7028ee1ca] +- Updated dependencies [db1c8f93b] + - @backstage/catalog-model@0.8.2 + - @backstage/plugin-catalog-react@0.2.2 + - @backstage/search-common@0.1.2 + ## 0.3.7 ### Patch Changes diff --git a/plugins/search/package.json b/plugins/search/package.json index a74091e497..9d6c81272c 100644 --- a/plugins/search/package.json +++ b/plugins/search/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-search", - "version": "0.3.7", + "version": "0.4.0", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -30,9 +30,9 @@ }, "dependencies": { "@backstage/core": "^0.7.11", - "@backstage/catalog-model": "^0.8.0", - "@backstage/plugin-catalog-react": "^0.2.0", - "@backstage/search-common": "^0.1.1", + "@backstage/catalog-model": "^0.8.2", + "@backstage/plugin-catalog-react": "^0.2.2", + "@backstage/search-common": "^0.1.2", "@backstage/config": "^0.1.5", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", @@ -47,7 +47,7 @@ "react-use": "^17.2.4" }, "devDependencies": { - "@backstage/cli": "^0.6.14", + "@backstage/cli": "^0.7.0", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/sentry/package.json b/plugins/sentry/package.json index b028963bc3..efaac81188 100644 --- a/plugins/sentry/package.json +++ b/plugins/sentry/package.json @@ -31,9 +31,9 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/catalog-model": "^0.8.0", + "@backstage/catalog-model": "^0.8.2", "@backstage/core": "^0.7.11", - "@backstage/plugin-catalog-react": "^0.2.0", + "@backstage/plugin-catalog-react": "^0.2.2", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", @@ -46,7 +46,7 @@ "timeago.js": "^4.0.2" }, "devDependencies": { - "@backstage/cli": "^0.6.14", + "@backstage/cli": "^0.7.0", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/shortcuts/package.json b/plugins/shortcuts/package.json index c778cad93a..7614c2aedb 100644 --- a/plugins/shortcuts/package.json +++ b/plugins/shortcuts/package.json @@ -35,7 +35,7 @@ "zen-observable": "^0.8.15" }, "devDependencies": { - "@backstage/cli": "^0.6.14", + "@backstage/cli": "^0.7.0", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/sonarqube/package.json b/plugins/sonarqube/package.json index 0f4f800d57..2f986f7e53 100644 --- a/plugins/sonarqube/package.json +++ b/plugins/sonarqube/package.json @@ -32,8 +32,8 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/catalog-model": "^0.8.0", - "@backstage/plugin-catalog-react": "^0.2.0", + "@backstage/catalog-model": "^0.8.2", + "@backstage/plugin-catalog-react": "^0.2.2", "@backstage/core": "^0.7.11", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", @@ -47,7 +47,7 @@ "react-use": "^17.2.4" }, "devDependencies": { - "@backstage/cli": "^0.6.14", + "@backstage/cli": "^0.7.0", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/splunk-on-call/package.json b/plugins/splunk-on-call/package.json index 22e4811f8b..7a7b9669cc 100644 --- a/plugins/splunk-on-call/package.json +++ b/plugins/splunk-on-call/package.json @@ -30,9 +30,9 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/catalog-model": "^0.8.0", + "@backstage/catalog-model": "^0.8.2", "@backstage/core": "^0.7.11", - "@backstage/plugin-catalog-react": "^0.2.0", + "@backstage/plugin-catalog-react": "^0.2.2", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", @@ -45,7 +45,7 @@ "react-use": "^17.2.4" }, "devDependencies": { - "@backstage/cli": "^0.6.14", + "@backstage/cli": "^0.7.0", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/tech-radar/package.json b/plugins/tech-radar/package.json index 73134fb45d..82f749a03e 100644 --- a/plugins/tech-radar/package.json +++ b/plugins/tech-radar/package.json @@ -43,7 +43,7 @@ "react-use": "^17.2.4" }, "devDependencies": { - "@backstage/cli": "^0.6.14", + "@backstage/cli": "^0.7.0", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/techdocs-backend/package.json b/plugins/techdocs-backend/package.json index a26af556f9..e6f7e00109 100644 --- a/plugins/techdocs-backend/package.json +++ b/plugins/techdocs-backend/package.json @@ -30,8 +30,8 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/backend-common": "^0.8.0", - "@backstage/catalog-model": "^0.8.0", + "@backstage/backend-common": "^0.8.2", + "@backstage/catalog-model": "^0.8.2", "@backstage/config": "^0.1.5", "@backstage/errors": "^0.1.1", "@backstage/techdocs-common": "^0.6.3", @@ -45,7 +45,7 @@ "winston": "^3.2.1" }, "devDependencies": { - "@backstage/cli": "^0.6.13", + "@backstage/cli": "^0.7.0", "@types/dockerode": "^3.2.1", "supertest": "^6.1.3" }, diff --git a/plugins/techdocs/package.json b/plugins/techdocs/package.json index 747c44488d..76bcfd8b0d 100644 --- a/plugins/techdocs/package.json +++ b/plugins/techdocs/package.json @@ -32,11 +32,11 @@ }, "dependencies": { "@backstage/config": "^0.1.5", - "@backstage/catalog-model": "^0.8.1", + "@backstage/catalog-model": "^0.8.2", "@backstage/core": "^0.7.12", - "@backstage/integration": "^0.5.5", - "@backstage/integration-react": "^0.1.2", - "@backstage/plugin-catalog-react": "^0.2.1", + "@backstage/integration": "^0.5.6", + "@backstage/integration-react": "^0.1.3", + "@backstage/plugin-catalog-react": "^0.2.2", "@backstage/theme": "^0.2.8", "@backstage/errors": "^0.1.1", "@material-ui/core": "^4.11.0", @@ -51,7 +51,7 @@ "sanitize-html": "^2.3.2" }, "devDependencies": { - "@backstage/cli": "^0.6.14", + "@backstage/cli": "^0.7.0", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/todo-backend/package.json b/plugins/todo-backend/package.json index 180b05ae6b..a49bd8e408 100644 --- a/plugins/todo-backend/package.json +++ b/plugins/todo-backend/package.json @@ -24,12 +24,12 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/backend-common": "^0.8.0", - "@backstage/catalog-client": "^0.3.12", - "@backstage/catalog-model": "^0.8.0", + "@backstage/backend-common": "^0.8.2", + "@backstage/catalog-client": "^0.3.13", + "@backstage/catalog-model": "^0.8.2", "@backstage/config": "^0.1.5", "@backstage/errors": "^0.1.1", - "@backstage/integration": "^0.5.4", + "@backstage/integration": "^0.5.6", "@types/express": "^4.17.6", "cross-fetch": "^3.0.6", "express": "^4.17.1", @@ -39,7 +39,7 @@ "yn": "^4.0.0" }, "devDependencies": { - "@backstage/cli": "^0.6.13", + "@backstage/cli": "^0.7.0", "@types/supertest": "^2.0.8", "msw": "^0.21.2", "supertest": "^6.1.3" diff --git a/plugins/todo/package.json b/plugins/todo/package.json index ada0afb5e2..f003bfa8e9 100644 --- a/plugins/todo/package.json +++ b/plugins/todo/package.json @@ -26,11 +26,11 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/catalog-model": "^0.8.0", - "@backstage/core-components": "^0.1.0", - "@backstage/core-plugin-api": "^0.1.0", + "@backstage/catalog-model": "^0.8.2", + "@backstage/core-components": "^0.1.2", + "@backstage/core-plugin-api": "^0.1.2", "@backstage/errors": "^0.1.1", - "@backstage/plugin-catalog-react": "^0.2.0", + "@backstage/plugin-catalog-react": "^0.2.2", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", @@ -40,8 +40,8 @@ "react-use": "^17.2.4" }, "devDependencies": { - "@backstage/cli": "^0.6.14", - "@backstage/core-app-api": "^0.1.0", + "@backstage/cli": "^0.7.0", + "@backstage/core-app-api": "^0.1.2", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/user-settings/package.json b/plugins/user-settings/package.json index f9e1bfe5f3..7fed36532e 100644 --- a/plugins/user-settings/package.json +++ b/plugins/user-settings/package.json @@ -41,7 +41,7 @@ "react-use": "^17.2.4" }, "devDependencies": { - "@backstage/cli": "^0.6.14", + "@backstage/cli": "^0.7.0", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/welcome/package.json b/plugins/welcome/package.json index e803b37059..bb0c56b198 100644 --- a/plugins/welcome/package.json +++ b/plugins/welcome/package.json @@ -41,7 +41,7 @@ "react-use": "^17.2.4" }, "devDependencies": { - "@backstage/cli": "^0.6.14", + "@backstage/cli": "^0.7.0", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", From 8ed49a306c4d80d05a27ee8f9a5693bf7802ebd0 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Thu, 10 Jun 2021 14:32:46 +0200 Subject: [PATCH 14/62] create-app: fix release version to 0.3.25 Signed-off-by: Patrik Oldsberg --- packages/create-app/CHANGELOG.md | 2 +- packages/create-app/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/create-app/CHANGELOG.md b/packages/create-app/CHANGELOG.md index 1627f35d6e..13f2bcb5ab 100644 --- a/packages/create-app/CHANGELOG.md +++ b/packages/create-app/CHANGELOG.md @@ -1,6 +1,6 @@ # @backstage/create-app -## 1.0.0 +## 0.3.25 ### Patch Changes diff --git a/packages/create-app/package.json b/packages/create-app/package.json index 1373c52c71..d5adcba510 100644 --- a/packages/create-app/package.json +++ b/packages/create-app/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/create-app", "description": "Create app package for Backstage", - "version": "1.0.0", + "version": "0.3.25", "private": false, "publishConfig": { "access": "public" From d2c31b132ed67efd883f2217ac3e1a36f02ee89a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Thu, 10 Jun 2021 11:00:34 +0200 Subject: [PATCH 15/62] Add Title prop in SupportButton MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Victor Perera Signed-off-by: Fredrik Adelöw --- .changeset/tall-bears-taste.md | 5 ++++ .../SupportButton/SupportButton.test.tsx | 9 ++++++- .../SupportButton/SupportButton.tsx | 26 ++++++++++++------- 3 files changed, 29 insertions(+), 11 deletions(-) create mode 100644 .changeset/tall-bears-taste.md diff --git a/.changeset/tall-bears-taste.md b/.changeset/tall-bears-taste.md new file mode 100644 index 0000000000..050c47867c --- /dev/null +++ b/.changeset/tall-bears-taste.md @@ -0,0 +1,5 @@ +--- +'@backstage/core-components': patch +--- + +Add title prop in SupportButton component diff --git a/packages/core-components/src/components/SupportButton/SupportButton.test.tsx b/packages/core-components/src/components/SupportButton/SupportButton.test.tsx index 6d6b9fd477..7c6cab99c1 100644 --- a/packages/core-components/src/components/SupportButton/SupportButton.test.tsx +++ b/packages/core-components/src/components/SupportButton/SupportButton.test.tsx @@ -21,8 +21,9 @@ import { RenderResult, waitFor, fireEvent, + screen, } from '@testing-library/react'; -import { wrapInTestApp } from '@backstage/test-utils'; +import { wrapInTestApp, renderInTestApp } from '@backstage/test-utils'; import { SupportButton } from './SupportButton'; const SUPPORT_BUTTON_ID = 'support-button'; @@ -41,6 +42,12 @@ describe('', () => { ); }); + it('supports passing a title', async () => { + await renderInTestApp(); + fireEvent.click(screen.getByTestId(SUPPORT_BUTTON_ID)); + expect(screen.getByText('Custom title')).toBeInTheDocument(); + }); + it('shows popover on click', async () => { let renderResult: RenderResult; diff --git a/packages/core-components/src/components/SupportButton/SupportButton.tsx b/packages/core-components/src/components/SupportButton/SupportButton.tsx index 6c6de8abe3..96cc308f74 100644 --- a/packages/core-components/src/components/SupportButton/SupportButton.tsx +++ b/packages/core-components/src/components/SupportButton/SupportButton.tsx @@ -24,19 +24,18 @@ import { ListItem, ListItemIcon, ListItemText, + Typography, makeStyles, Popover, } from '@material-ui/core'; -import React, { - Fragment, - MouseEventHandler, - PropsWithChildren, - useState, -} from 'react'; +import React, { Fragment, MouseEventHandler, useState } from 'react'; import { SupportItem, SupportItemLink, useSupportConfig } from '../../hooks'; import { Link } from '../Link'; -type Props = {}; +type SupportButtonProps = { + title?: string; + children?: React.ReactNode; +}; const useStyles = makeStyles({ popoverList: { @@ -78,7 +77,7 @@ const SupportListItem = ({ item }: { item: SupportItem }) => { ); }; -export const SupportButton = ({ children }: PropsWithChildren) => { +export const SupportButton = ({ title, children }: SupportButtonProps) => { const { items } = useSupportConfig(); const [popoverOpen, setPopoverOpen] = useState(false); @@ -121,13 +120,20 @@ export const SupportButton = ({ children }: PropsWithChildren) => { onClose={popoverCloseHandler} > + {title && ( + + {title} + + )} {React.Children.map(children, (child, i) => ( - + {child} ))} {items && - items.map((item, i) => )} + items.map((item, i) => ( + + ))}