Merge pull request #9979 from backstage/search/betaaaaa
[Search] "Launch" Beta
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
---
|
||||
'@backstage/create-app': patch
|
||||
---
|
||||
|
||||
Postgres-based search is now installed when PG is chosen as the desired database for Backstage.
|
||||
|
||||
There is no need to make this change in an existing Backstage backend. See [supported search engines](https://backstage.io/docs/features/search/search-engines) for details about production-ready search engines.
|
||||
@@ -24,12 +24,12 @@ Backstage ecosystem.
|
||||
|
||||
## Project roadmap
|
||||
|
||||
| Version | Description |
|
||||
| -------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Backstage Search Pre-Alpha ✅ | Search Frontend letting you search through the entities of the software catalog. [See Pre-Alpha Use Cases.](#backstage-search-pre-alpha) |
|
||||
| Backstage Search Alpha ✅ | Basic “out-of-the-box” in-memory indexing process of entities, and their metadata, registered to the Software Catalog. [See Alpha Use Cases](#backstage-search-alpha). |
|
||||
| [Backstage Search Beta ⌛][beta] | At least one production-ready search engine that supports the same use-cases as in the alpha. [See Beta Use Cases](#backstage-search-beta). |
|
||||
| [Backstage Search GA ⌛][ga] | A stable Search API for plugin developers to add search to their plugins, and app integrators to expose that to their users. [See GA Use Cases](#backstage-search-ga). |
|
||||
| Version | Description |
|
||||
| ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Backstage Search Pre-Alpha ✅ | Search Frontend letting you search through the entities of the software catalog. [See Pre-Alpha Use Cases.](#backstage-search-pre-alpha) |
|
||||
| Backstage Search Alpha ✅ | Basic “out-of-the-box” in-memory indexing process of entities, and their metadata, registered to the Software Catalog. [See Alpha Use Cases](#backstage-search-alpha). |
|
||||
| Backstage Search Beta ✅ | At least one production-ready search engine that supports the same use-cases as in the alpha. [See Beta Use Cases](#backstage-search-beta). |
|
||||
| [Backstage Search GA ⌛][ga] | A stable Search API for plugin developers to add search to their plugins, and app integrators to expose that to their users. [See GA Use Cases](#backstage-search-ga). |
|
||||
|
||||
[beta]: https://github.com/backstage/backstage/milestone/27
|
||||
[ga]: https://github.com/backstage/backstage/milestone/28
|
||||
|
||||
@@ -137,9 +137,10 @@ entities are indexed by the search engine.
|
||||
|
||||
For the purposes of this guide, Search Beta version is defined as:
|
||||
|
||||
- **Search Plugin**: At least `v0.x.y`
|
||||
- **Search Backend Plugin**: At least `v0.x.y`
|
||||
- **Search Backend Node**: At least `v0.x.y`
|
||||
- **Search Plugin**: At least `v0.7.2`
|
||||
- **Search Backend Plugin**: At least `v0.4.6`
|
||||
- **Search Backend Node**: At least `v0.5.0`
|
||||
- **Search Common**: At least `v0.3.0`
|
||||
|
||||
In the Beta version, the Search Platform's indexing process has been rewritten
|
||||
as a stream pipeline in order to improve efficiency and performance on large
|
||||
@@ -149,11 +150,14 @@ If you've not yet extended the Search Platform with custom code, and have
|
||||
instead taken advantage of default collators, decorators, and search engines
|
||||
provided by existing plugins, the migration process is fairly straightforward:
|
||||
|
||||
1. Upgrade to at least version `0.x.y` of
|
||||
1. Upgrade to at least version `0.5.0` of
|
||||
`@backstage/plugin-search-backend-node`, as well as any backend plugins whose
|
||||
collators you are using (e.g. at least version `0.x.y` of
|
||||
`@backstage/plugin-catalog-backend` and/or version `0.x.y` of
|
||||
`@backstage/plugin-techdocs-backend`).
|
||||
collators you are using (e.g. at least version `0.23.0` of
|
||||
`@backstage/plugin-catalog-backend` and/or version `0.14.1` of
|
||||
`@backstage/plugin-techdocs-backend`), as well as any search-engine specific
|
||||
plugin you are using (e.g. at least version `0.3.0` of
|
||||
`@backstage/plugin-search-backend-module-pg` or version `0.1.0` of
|
||||
`@backstage/plugin-search-backend-module-elasticsearch`).
|
||||
2. Then, make the following changes to your
|
||||
`/packages/backend/src/plugins/search.ts` file:
|
||||
|
||||
|
||||
@@ -86,6 +86,7 @@
|
||||
"@backstage/plugin-scaffolder-backend": "",
|
||||
"@backstage/plugin-search": "",
|
||||
"@backstage/plugin-search-backend": "",
|
||||
"@backstage/plugin-search-backend-module-pg": "",
|
||||
"@backstage/plugin-search-backend-node": "",
|
||||
"@backstage/plugin-tech-radar": "",
|
||||
"@backstage/plugin-techdocs": "",
|
||||
|
||||
@@ -70,6 +70,7 @@ import { version as pluginScaffolder } from '../../../../plugins/scaffolder/pack
|
||||
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 pluginSearchBackendModulePg } from '../../../../plugins/search-backend-module-pg/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';
|
||||
@@ -113,6 +114,7 @@ export const packageVersions = {
|
||||
'@backstage/plugin-scaffolder-backend': pluginScaffolderBackend,
|
||||
'@backstage/plugin-search': pluginSearch,
|
||||
'@backstage/plugin-search-backend': pluginSearchBackend,
|
||||
'@backstage/plugin-search-backend-module-pg': pluginSearchBackendModulePg,
|
||||
'@backstage/plugin-search-backend-node': pluginSearchBackendNode,
|
||||
'@backstage/plugin-tech-radar': pluginTechRadar,
|
||||
'@backstage/plugin-techdocs': pluginTechdocs,
|
||||
|
||||
@@ -28,6 +28,9 @@
|
||||
"@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'}}",
|
||||
{{#if dbTypePG}}
|
||||
"@backstage/plugin-search-backend-module-pg": "^{{version '@backstage/plugin-search-backend-module-pg'}}",
|
||||
{{/if}}
|
||||
"@backstage/plugin-search-backend-node": "^{{version '@backstage/plugin-search-backend-node'}}",
|
||||
"@backstage/plugin-techdocs-backend": "^{{version '@backstage/plugin-techdocs-backend'}}",
|
||||
"@gitbeaker/node": "^34.6.0",
|
||||
|
||||
+10
@@ -4,6 +4,9 @@ import {
|
||||
IndexBuilder,
|
||||
LunrSearchEngine,
|
||||
} from '@backstage/plugin-search-backend-node';
|
||||
{{#if dbTypePG}}
|
||||
import { PgSearchEngine } from '@backstage/plugin-search-backend-module-pg';
|
||||
{{/if}}
|
||||
import { PluginEnvironment } from '../types';
|
||||
import { DefaultCatalogCollatorFactory } from '@backstage/plugin-catalog-backend';
|
||||
import { DefaultTechDocsCollatorFactory } from '@backstage/plugin-techdocs-backend';
|
||||
@@ -16,7 +19,14 @@ export default async function createPlugin({
|
||||
tokenManager,
|
||||
}: PluginEnvironment) {
|
||||
// Initialize a connection to a search engine.
|
||||
{{#if dbTypeSqlite}}
|
||||
const searchEngine = new LunrSearchEngine({ logger });
|
||||
{{/if}}
|
||||
{{#if dbTypePG}}
|
||||
const searchEngine = (await PgSearchEngine.supported(database))
|
||||
? await PgSearchEngine.from({ database })
|
||||
: new LunrSearchEngine({ logger });
|
||||
{{/if}}
|
||||
const indexBuilder = new IndexBuilder({ logger, searchEngine });
|
||||
|
||||
// Collators are responsible for gathering documents known to plugins. This
|
||||
@@ -420,9 +420,15 @@ async function testBackendStart(appDir: string, isPostgres: boolean) {
|
||||
if (isPostgres) {
|
||||
print('Dropping old DBs');
|
||||
await Promise.all(
|
||||
['catalog', 'scaffolder', 'auth', 'identity', 'proxy', 'techdocs'].map(
|
||||
name => dropDB(`backstage_plugin_${name}`),
|
||||
),
|
||||
[
|
||||
'catalog',
|
||||
'scaffolder',
|
||||
'auth',
|
||||
'identity',
|
||||
'proxy',
|
||||
'techdocs',
|
||||
'search',
|
||||
].map(name => dropDB(`backstage_plugin_${name}`)),
|
||||
);
|
||||
print('Created DBs');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user