@backstage/plugin-catalog-backend 0.23.1 → 0.24.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,54 @@
1
1
  # @backstage/plugin-catalog-backend
2
2
 
3
+ ## 0.24.0-next.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 66ba5d9023: **BREAKING**: Removed `GitLabDiscoveryProcessor`, which now instead should be imported from `@backstage/plugin-catalog-backend-module-gitlab`. NOTE THAT this processor was part of the default set of processors in the catalog backend, and if you are a user of discovery on GitLab, you MUST now add it manually in the catalog initialization code of your backend.
8
+
9
+ ```diff
10
+ // In packages/backend/src/plugins/catalog.ts
11
+ +import { GitLabDiscoveryProcessor } from '@backstage/plugin-catalog-backend-module-gitlab';
12
+
13
+ export default async function createPlugin(
14
+ env: PluginEnvironment,
15
+ ): Promise<Router> {
16
+ const builder = await CatalogBuilder.create(env);
17
+ + builder.addProcessor(
18
+ + GitLabDiscoveryProcessor.fromConfig(env.config, { logger: env.logger })
19
+ + );
20
+ ```
21
+
22
+ **BREAKING**: Removed `AzureDevOpsDiscoveryProcessor`, which now instead should be imported from `@backstage/plugin-catalog-backend-module-azure`. This processor was not part of the set of default processors. If you were using it, you should already have a reference to it in your backend code and only need to update the import.
23
+
24
+ - f115a7f8fd: **BREAKING**: Removed `AwsS3DiscoveryProcessor`, which now instead should be imported from `@backstage/plugin-catalog-backend-module-aws`.
25
+ - 55150919ed: - **BREAKING**: Support for `backstage.io/v1beta2` Software Templates has been removed. Please migrate your legacy templates to the new `scaffolder.backstage.io/v1beta3` `apiVersion` by following the [migration guide](https://backstage.io/docs/features/software-templates/migrating-from-v1beta2-to-v1beta3)
26
+
27
+ ### Patch Changes
28
+
29
+ - ab7cd7d70e: Do some groundwork for supporting the `better-sqlite3` driver, to maybe eventually replace `@vscode/sqlite3` (#9912)
30
+ - e0a69ba49f: build(deps): bump `fs-extra` from 9.1.0 to 10.0.1
31
+ - 616f02ade2: support Bitbucket Cloud's code search to discover catalog files (multiple per repo, Location entities for existing files only)
32
+ - e421d77536: **BREAKING**:
33
+
34
+ - Removed the previously deprecated `runPeriodically` export. Please use the `@backstage/backend-tasks` package instead, or copy [the actual implementation](https://github.com/backstage/backstage/blob/02875d4d56708c60f86f6b0a5b3da82e24988354/plugins/catalog-backend/src/util/runPeriodically.ts#L29) into your own code if you explicitly do not want coordination of task runs across your worker nodes.
35
+ - Removed the previously deprecated `CatalogProcessorLocationResult.optional` field. Please set the corresponding `LocationSpec.presence` field to `'optional'` instead.
36
+ - Related to the previous point, the `processingResult.location` function no longer has a second boolean `optional` argument. Please set the corresponding `LocationSpec.presence` field to `'optional'` instead.
37
+ - Removed the previously deprecated `StaticLocationProcessor`. It has not been in use for some time; its functionality is covered by `ConfigLocationEntityProvider` instead.
38
+
39
+ - 3c2bc73901: Use `setupRequestMockHandlers` from `@backstage/backend-test-utils`
40
+ - c1168bb440: Fixed display of the location in the log message that is printed when entity envelope validation fails.
41
+ - b1aacbf96a: Applied the fix for the `/alpha` entry point resolution that was part of the `v0.70.1` release of Backstage.
42
+ - 3e54f6c436: Use `@backstage/plugin-search-common` package instead of `@backstage/search-common`.
43
+ - Updated dependencies
44
+ - @backstage/backend-common@0.13.0-next.0
45
+ - @backstage/plugin-scaffolder-common@0.3.0-next.0
46
+ - @backstage/catalog-model@0.13.0-next.0
47
+ - @backstage/plugin-catalog-common@0.2.2-next.0
48
+ - @backstage/plugin-search-common@0.3.1-next.0
49
+ - @backstage/catalog-client@0.9.0-next.0
50
+ - @backstage/plugin-permission-node@0.5.4-next.0
51
+
3
52
  ## 0.23.1
4
53
 
5
54
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-catalog-backend",
3
- "version": "0.23.1",
3
+ "version": "0.24.0-next.0",
4
4
  "main": "../dist/index.cjs.js",
5
5
  "types": "../dist/index.alpha.d.ts"
6
6
  }
@@ -13,7 +13,7 @@ import { CompoundEntityRef } from '@backstage/catalog-model';
13
13
  import { ConditionalPolicyDecision } from '@backstage/plugin-permission-node';
14
14
  import { Conditions } from '@backstage/plugin-permission-node';
15
15
  import { Config } from '@backstage/config';
16
- import { DocumentCollatorFactory } from '@backstage/search-common';
16
+ import { DocumentCollatorFactory } from '@backstage/plugin-search-common';
17
17
  import { Entity } from '@backstage/catalog-model';
18
18
  import { EntityPolicy } from '@backstage/catalog-model';
19
19
  import express from 'express';
@@ -77,7 +77,7 @@ export declare type AnalyzeLocationExistingEntity = {
77
77
  * enough info for the frontend to know what form data to show to the user
78
78
  * for overriding/completing the info.
79
79
  * @public
80
- * */
80
+ */
81
81
  export declare type AnalyzeLocationGenerateEntity = {
82
82
  entity: RecursivePartial<Entity>;
83
83
  fields: AnalyzeLocationEntityField[];
@@ -115,45 +115,6 @@ export declare class AnnotateScmSlugEntityProcessor implements CatalogProcessor
115
115
  preProcessEntity(entity: Entity, location: LocationSpec): Promise<Entity>;
116
116
  }
117
117
 
118
- /** @public */
119
- export declare class AwsS3DiscoveryProcessor implements CatalogProcessor {
120
- private readonly reader;
121
- constructor(reader: UrlReader);
122
- getProcessorName(): string;
123
- readLocation(location: LocationSpec, optional: boolean, emit: CatalogProcessorEmit, parser: CatalogProcessorParser): Promise<boolean>;
124
- private doRead;
125
- }
126
-
127
- /**
128
- * Extracts repositories out of an Azure DevOps org.
129
- *
130
- * The following will create locations for all projects which have a catalog-info.yaml
131
- * on the default branch. The first is shorthand for the second.
132
- *
133
- * target: "https://dev.azure.com/org/project"
134
- * or
135
- * target: https://dev.azure.com/org/project?path=/catalog-info.yaml
136
- *
137
- * You may also explicitly specify a single repo:
138
- *
139
- * target: https://dev.azure.com/org/project/_git/repo
140
- *
141
- * @public
142
- **/
143
- export declare class AzureDevOpsDiscoveryProcessor implements CatalogProcessor {
144
- private readonly integrations;
145
- private readonly logger;
146
- static fromConfig(config: Config, options: {
147
- logger: Logger;
148
- }): AzureDevOpsDiscoveryProcessor;
149
- constructor(options: {
150
- integrations: ScmIntegrationRegistry;
151
- logger: Logger;
152
- });
153
- getProcessorName(): string;
154
- readLocation(location: LocationSpec, _optional: boolean, emit: CatalogProcessorEmit): Promise<boolean>;
155
- }
156
-
157
118
  /** @public */
158
119
  export declare class BitbucketDiscoveryProcessor implements CatalogProcessor {
159
120
  private readonly integrations;
@@ -163,6 +124,7 @@ export declare class BitbucketDiscoveryProcessor implements CatalogProcessor {
163
124
  parser?: (options: {
164
125
  integration: BitbucketIntegration;
165
126
  target: string;
127
+ presence?: 'optional' | 'required';
166
128
  logger: Logger;
167
129
  }) => AsyncIterable<CatalogProcessorResult>;
168
130
  logger: Logger;
@@ -172,6 +134,7 @@ export declare class BitbucketDiscoveryProcessor implements CatalogProcessor {
172
134
  parser?: (options: {
173
135
  integration: BitbucketIntegration;
174
136
  target: string;
137
+ presence?: 'optional' | 'required';
175
138
  logger: Logger;
176
139
  }) => AsyncIterable<CatalogProcessorResult>;
177
140
  logger: Logger;
@@ -189,6 +152,7 @@ export declare class BitbucketDiscoveryProcessor implements CatalogProcessor {
189
152
  export declare type BitbucketRepositoryParser = (options: {
190
153
  integration: BitbucketIntegration;
191
154
  target: string;
155
+ presence?: 'optional' | 'required';
192
156
  logger: Logger;
193
157
  }) => AsyncIterable<CatalogProcessorResult>;
194
158
 
@@ -424,7 +388,7 @@ export declare interface CatalogProcessingEngine {
424
388
  /**
425
389
  * Responsible for executing the individual processing steps in order to fully process an entity.
426
390
  * @public
427
- * */
391
+ */
428
392
  export declare interface CatalogProcessingOrchestrator {
429
393
  process(request: EntityProcessingRequest): Promise<EntityProcessingResult>;
430
394
  }
@@ -539,8 +503,6 @@ export declare type CatalogProcessorErrorResult = {
539
503
  export declare type CatalogProcessorLocationResult = {
540
504
  type: 'location';
541
505
  location: LocationSpec;
542
- /** @deprecated Set `location.presence = 'optional'` instead */
543
- optional?: boolean;
544
506
  };
545
507
 
546
508
  /**
@@ -818,7 +780,7 @@ export declare class DefaultCatalogRulesEnforcer implements CatalogRulesEnforcer
818
780
  /**
819
781
  * Entities that are not yet processed.
820
782
  * @public
821
- * */
783
+ */
822
784
  export declare type DeferredEntity = {
823
785
  entity: Entity;
824
786
  locationKey?: string;
@@ -1192,23 +1154,6 @@ export declare class GithubOrgReaderProcessor implements CatalogProcessor {
1192
1154
  private createClient;
1193
1155
  }
1194
1156
 
1195
- /**
1196
- * Extracts repositories out of an GitLab instance.
1197
- * @public
1198
- */
1199
- export declare class GitLabDiscoveryProcessor implements CatalogProcessor {
1200
- private readonly integrations;
1201
- private readonly logger;
1202
- private readonly cache;
1203
- static fromConfig(config: Config, options: {
1204
- logger: Logger;
1205
- }): GitLabDiscoveryProcessor;
1206
- private constructor();
1207
- getProcessorName(): string;
1208
- readLocation(location: LocationSpec, _optional: boolean, emit: CatalogProcessorEmit): Promise<boolean>;
1209
- private updateLastActivity;
1210
- }
1211
-
1212
1157
  /**
1213
1158
  * @public
1214
1159
  * @deprecated import the processingResult symbol instead and use its fields
@@ -1219,7 +1164,7 @@ declare function inputError(atLocation: LocationSpec, message: string): CatalogP
1219
1164
  * @public
1220
1165
  * @deprecated import the processingResult symbol instead and use its fields
1221
1166
  */
1222
- declare function location_2(newLocation: LocationSpec, optional?: boolean): CatalogProcessorResult;
1167
+ declare function location_2(newLocation: LocationSpec, _optional?: boolean): CatalogProcessorResult;
1223
1168
 
1224
1169
  /** @public */
1225
1170
  export declare type LocationAnalyzer = {
@@ -1299,7 +1244,8 @@ export declare type LocationSpec = {
1299
1244
 
1300
1245
  /**
1301
1246
  * Interacts with the database to manage locations.
1302
- * @public */
1247
+ * @public
1248
+ */
1303
1249
  export declare interface LocationStore {
1304
1250
  createLocation(location: LocationInput): Promise<Location_2>;
1305
1251
  listLocations(): Promise<Location_2[]>;
@@ -1391,7 +1337,7 @@ export declare const processingResult: Readonly<{
1391
1337
  readonly notFoundError: (atLocation: LocationSpec, message: string) => CatalogProcessorResult;
1392
1338
  readonly inputError: (atLocation: LocationSpec, message: string) => CatalogProcessorResult;
1393
1339
  readonly generalError: (atLocation: LocationSpec, message: string) => CatalogProcessorResult;
1394
- readonly location: (newLocation: LocationSpec, optional?: boolean | undefined) => CatalogProcessorResult;
1340
+ readonly location: (newLocation: LocationSpec) => CatalogProcessorResult;
1395
1341
  readonly entity: (atLocation: LocationSpec, newEntity: Entity) => CatalogProcessorResult;
1396
1342
  readonly relation: (spec: EntityRelationSpec) => CatalogProcessorResult;
1397
1343
  }>;
@@ -1467,31 +1413,6 @@ export declare interface RouterOptions {
1467
1413
  permissionIntegrationRouter?: express.Router;
1468
1414
  }
1469
1415
 
1470
- /**
1471
- * Runs a function repeatedly, with a fixed wait between invocations.
1472
- *
1473
- * Supports async functions, and silently ignores exceptions and rejections.
1474
- *
1475
- * @param fn - The function to run. May return a Promise.
1476
- * @param delayMs - The delay between a completed function invocation and the
1477
- * next.
1478
- * @returns A function that, when called, stops the invocation loop.
1479
- * @deprecated use \@backstage/backend-tasks package instead.
1480
- * @public
1481
- */
1482
- export declare function runPeriodically(fn: () => any, delayMs: number): () => void;
1483
-
1484
- /**
1485
- * @deprecated no longer in use, replaced by the ConfigLocationEntityProvider.
1486
- * @public
1487
- */
1488
- export declare class StaticLocationProcessor implements StaticLocationProcessor {
1489
- private readonly staticLocations;
1490
- static fromConfig(config: Config): StaticLocationProcessor;
1491
- constructor(staticLocations: LocationSpec[]);
1492
- readLocation(location: LocationSpec, _optional: boolean, emit: CatalogProcessorEmit): Promise<boolean>;
1493
- }
1494
-
1495
1416
  /** @public */
1496
1417
  export declare class UrlReaderProcessor implements CatalogProcessor {
1497
1418
  private readonly options;
@@ -13,7 +13,7 @@ import { CompoundEntityRef } from '@backstage/catalog-model';
13
13
  import { ConditionalPolicyDecision } from '@backstage/plugin-permission-node';
14
14
  import { Conditions } from '@backstage/plugin-permission-node';
15
15
  import { Config } from '@backstage/config';
16
- import { DocumentCollatorFactory } from '@backstage/search-common';
16
+ import { DocumentCollatorFactory } from '@backstage/plugin-search-common';
17
17
  import { Entity } from '@backstage/catalog-model';
18
18
  import { EntityPolicy } from '@backstage/catalog-model';
19
19
  import express from 'express';
@@ -77,7 +77,7 @@ export declare type AnalyzeLocationExistingEntity = {
77
77
  * enough info for the frontend to know what form data to show to the user
78
78
  * for overriding/completing the info.
79
79
  * @public
80
- * */
80
+ */
81
81
  export declare type AnalyzeLocationGenerateEntity = {
82
82
  entity: RecursivePartial<Entity>;
83
83
  fields: AnalyzeLocationEntityField[];
@@ -115,45 +115,6 @@ export declare class AnnotateScmSlugEntityProcessor implements CatalogProcessor
115
115
  preProcessEntity(entity: Entity, location: LocationSpec): Promise<Entity>;
116
116
  }
117
117
 
118
- /** @public */
119
- export declare class AwsS3DiscoveryProcessor implements CatalogProcessor {
120
- private readonly reader;
121
- constructor(reader: UrlReader);
122
- getProcessorName(): string;
123
- readLocation(location: LocationSpec, optional: boolean, emit: CatalogProcessorEmit, parser: CatalogProcessorParser): Promise<boolean>;
124
- private doRead;
125
- }
126
-
127
- /**
128
- * Extracts repositories out of an Azure DevOps org.
129
- *
130
- * The following will create locations for all projects which have a catalog-info.yaml
131
- * on the default branch. The first is shorthand for the second.
132
- *
133
- * target: "https://dev.azure.com/org/project"
134
- * or
135
- * target: https://dev.azure.com/org/project?path=/catalog-info.yaml
136
- *
137
- * You may also explicitly specify a single repo:
138
- *
139
- * target: https://dev.azure.com/org/project/_git/repo
140
- *
141
- * @public
142
- **/
143
- export declare class AzureDevOpsDiscoveryProcessor implements CatalogProcessor {
144
- private readonly integrations;
145
- private readonly logger;
146
- static fromConfig(config: Config, options: {
147
- logger: Logger;
148
- }): AzureDevOpsDiscoveryProcessor;
149
- constructor(options: {
150
- integrations: ScmIntegrationRegistry;
151
- logger: Logger;
152
- });
153
- getProcessorName(): string;
154
- readLocation(location: LocationSpec, _optional: boolean, emit: CatalogProcessorEmit): Promise<boolean>;
155
- }
156
-
157
118
  /** @public */
158
119
  export declare class BitbucketDiscoveryProcessor implements CatalogProcessor {
159
120
  private readonly integrations;
@@ -163,6 +124,7 @@ export declare class BitbucketDiscoveryProcessor implements CatalogProcessor {
163
124
  parser?: (options: {
164
125
  integration: BitbucketIntegration;
165
126
  target: string;
127
+ presence?: 'optional' | 'required';
166
128
  logger: Logger;
167
129
  }) => AsyncIterable<CatalogProcessorResult>;
168
130
  logger: Logger;
@@ -172,6 +134,7 @@ export declare class BitbucketDiscoveryProcessor implements CatalogProcessor {
172
134
  parser?: (options: {
173
135
  integration: BitbucketIntegration;
174
136
  target: string;
137
+ presence?: 'optional' | 'required';
175
138
  logger: Logger;
176
139
  }) => AsyncIterable<CatalogProcessorResult>;
177
140
  logger: Logger;
@@ -189,6 +152,7 @@ export declare class BitbucketDiscoveryProcessor implements CatalogProcessor {
189
152
  export declare type BitbucketRepositoryParser = (options: {
190
153
  integration: BitbucketIntegration;
191
154
  target: string;
155
+ presence?: 'optional' | 'required';
192
156
  logger: Logger;
193
157
  }) => AsyncIterable<CatalogProcessorResult>;
194
158
 
@@ -411,7 +375,7 @@ export declare interface CatalogProcessingEngine {
411
375
  /**
412
376
  * Responsible for executing the individual processing steps in order to fully process an entity.
413
377
  * @public
414
- * */
378
+ */
415
379
  export declare interface CatalogProcessingOrchestrator {
416
380
  process(request: EntityProcessingRequest): Promise<EntityProcessingResult>;
417
381
  }
@@ -526,8 +490,6 @@ export declare type CatalogProcessorErrorResult = {
526
490
  export declare type CatalogProcessorLocationResult = {
527
491
  type: 'location';
528
492
  location: LocationSpec;
529
- /** @deprecated Set `location.presence = 'optional'` instead */
530
- optional?: boolean;
531
493
  };
532
494
 
533
495
  /**
@@ -776,7 +738,7 @@ export declare class DefaultCatalogRulesEnforcer implements CatalogRulesEnforcer
776
738
  /**
777
739
  * Entities that are not yet processed.
778
740
  * @public
779
- * */
741
+ */
780
742
  export declare type DeferredEntity = {
781
743
  entity: Entity;
782
744
  locationKey?: string;
@@ -1150,23 +1112,6 @@ export declare class GithubOrgReaderProcessor implements CatalogProcessor {
1150
1112
  private createClient;
1151
1113
  }
1152
1114
 
1153
- /**
1154
- * Extracts repositories out of an GitLab instance.
1155
- * @public
1156
- */
1157
- export declare class GitLabDiscoveryProcessor implements CatalogProcessor {
1158
- private readonly integrations;
1159
- private readonly logger;
1160
- private readonly cache;
1161
- static fromConfig(config: Config, options: {
1162
- logger: Logger;
1163
- }): GitLabDiscoveryProcessor;
1164
- private constructor();
1165
- getProcessorName(): string;
1166
- readLocation(location: LocationSpec, _optional: boolean, emit: CatalogProcessorEmit): Promise<boolean>;
1167
- private updateLastActivity;
1168
- }
1169
-
1170
1115
  /**
1171
1116
  * @public
1172
1117
  * @deprecated import the processingResult symbol instead and use its fields
@@ -1177,7 +1122,7 @@ declare function inputError(atLocation: LocationSpec, message: string): CatalogP
1177
1122
  * @public
1178
1123
  * @deprecated import the processingResult symbol instead and use its fields
1179
1124
  */
1180
- declare function location_2(newLocation: LocationSpec, optional?: boolean): CatalogProcessorResult;
1125
+ declare function location_2(newLocation: LocationSpec, _optional?: boolean): CatalogProcessorResult;
1181
1126
 
1182
1127
  /** @public */
1183
1128
  export declare type LocationAnalyzer = {
@@ -1257,7 +1202,8 @@ export declare type LocationSpec = {
1257
1202
 
1258
1203
  /**
1259
1204
  * Interacts with the database to manage locations.
1260
- * @public */
1205
+ * @public
1206
+ */
1261
1207
  export declare interface LocationStore {
1262
1208
  createLocation(location: LocationInput): Promise<Location_2>;
1263
1209
  listLocations(): Promise<Location_2[]>;
@@ -1336,7 +1282,7 @@ export declare const processingResult: Readonly<{
1336
1282
  readonly notFoundError: (atLocation: LocationSpec, message: string) => CatalogProcessorResult;
1337
1283
  readonly inputError: (atLocation: LocationSpec, message: string) => CatalogProcessorResult;
1338
1284
  readonly generalError: (atLocation: LocationSpec, message: string) => CatalogProcessorResult;
1339
- readonly location: (newLocation: LocationSpec, optional?: boolean | undefined) => CatalogProcessorResult;
1285
+ readonly location: (newLocation: LocationSpec) => CatalogProcessorResult;
1340
1286
  readonly entity: (atLocation: LocationSpec, newEntity: Entity) => CatalogProcessorResult;
1341
1287
  readonly relation: (spec: EntityRelationSpec) => CatalogProcessorResult;
1342
1288
  }>;
@@ -1412,31 +1358,6 @@ export declare interface RouterOptions {
1412
1358
  permissionIntegrationRouter?: express.Router;
1413
1359
  }
1414
1360
 
1415
- /**
1416
- * Runs a function repeatedly, with a fixed wait between invocations.
1417
- *
1418
- * Supports async functions, and silently ignores exceptions and rejections.
1419
- *
1420
- * @param fn - The function to run. May return a Promise.
1421
- * @param delayMs - The delay between a completed function invocation and the
1422
- * next.
1423
- * @returns A function that, when called, stops the invocation loop.
1424
- * @deprecated use \@backstage/backend-tasks package instead.
1425
- * @public
1426
- */
1427
- export declare function runPeriodically(fn: () => any, delayMs: number): () => void;
1428
-
1429
- /**
1430
- * @deprecated no longer in use, replaced by the ConfigLocationEntityProvider.
1431
- * @public
1432
- */
1433
- export declare class StaticLocationProcessor implements StaticLocationProcessor {
1434
- private readonly staticLocations;
1435
- static fromConfig(config: Config): StaticLocationProcessor;
1436
- constructor(staticLocations: LocationSpec[]);
1437
- readLocation(location: LocationSpec, _optional: boolean, emit: CatalogProcessorEmit): Promise<boolean>;
1438
- }
1439
-
1440
1361
  /** @public */
1441
1362
  export declare class UrlReaderProcessor implements CatalogProcessor {
1442
1363
  private readonly options;