@backstage/plugin-catalog-backend 0.21.5 → 0.22.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,115 @@
1
1
  # @backstage/plugin-catalog-backend
2
2
 
3
+ ## 0.22.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 209fd128e6: The `CodeOwnersProcessor` no longer supports the deprecated SCM-specific location types like `'github/api'`. This is a breaking change but it is unlikely to have an impact, as these location types haven't been supported by the rest of the catalog for a long time.
8
+ - 9876e7f172: **BREAKING**: Removed unused `durationText` utility.
9
+ - 25e97e7242: **BREAKING**: Removed `AwsOrganizationCloudAccountProcessor` from the default
10
+ set of builtin processors, and instead moved it into its own module
11
+ `@backstage/plugin-catalog-backend-module-aws`.
12
+
13
+ If you were using this processor, through making use of the location type
14
+ `aws-cloud-accounts` and/or using the configuration key
15
+ `catalog.processors.awsOrganization`, you will from now on have to add the
16
+ processor manually to your catalog.
17
+
18
+ First, add the `@backstage/plugin-catalog-backend-module-aws` dependency to your
19
+ `packages/backend` package.
20
+
21
+ Then, in `packages/backend/src/plugins/catalog.ts`:
22
+
23
+ ```diff
24
+ +import { AwsOrganizationCloudAccountProcessor } from '@backstage/plugin-catalog-backend-module-aws';
25
+
26
+ export default async function createPlugin(
27
+ env: PluginEnvironment,
28
+ ): Promise<Router> {
29
+ const builder = await CatalogBuilder.create(env);
30
+ + builder.addProcessor(
31
+ + AwsOrganizationCloudAccountProcessor.fromConfig(
32
+ + env.config,
33
+ + { logger: env.logger }
34
+ + )
35
+ + );
36
+ // ...
37
+ ```
38
+
39
+ - e9cf0dd03e: Made the `GitLabDiscoveryProcessor.updateLastActivity` method private, as it was accidentally exposed. It has also been fixed to properly operate in its own cache namespace to avoid collisions with other processors.
40
+ - df61ca71dd: Updated all processors to implement `getProcessorName`.
41
+
42
+ **BREAKING**: The `CatalogProcessor` interface now require that the `CatalogProcessor` class implements `getProcessorName()`.
43
+ The processor name has previously defaulted processor class name. It's therefore _recommended_ to keep your return the same name as the class name if you did not implement this method previously.
44
+
45
+ For example:
46
+
47
+ ```ts
48
+ class CustomProcessor implements CatalogProcessor {
49
+ getProcessorName() {
50
+ // Use the same name as the class name if this method was not previously implemented.
51
+ return 'CustomProcessor';
52
+ }
53
+ }
54
+ ```
55
+
56
+ ### Patch Changes
57
+
58
+ - 919cf2f836: The catalog API now returns entity relations that have three fields: The old
59
+ `type` and `target` fields, as well as a new `targetRef` field. The last one is
60
+ the stringified form of the second one.
61
+
62
+ **DEPRECATION**: The `target` field is hereby deprecated, both as seen from the
63
+ catalog API as well as from the `@backstage/catalog-model` package. Both
64
+ `target` and `targetRef` will be produced for some time, but eventually,
65
+ `target` will be removed entirely. Please update your readers to stop consuming
66
+ the `relations.[].target` field from the catalog API as soon as possible.
67
+
68
+ - 957cb4cb20: Deprecated the `runPeriodically` function which is no longer in use.
69
+ - 01e124ea60: Added an `/entity-facets` endpoint, which lets you query the distribution of
70
+ possible values for fields of entities.
71
+
72
+ This can be useful for example when populating a dropdown in the user interface,
73
+ such as listing all tag values that are actually being used right now in your
74
+ catalog instance, along with putting the most common ones at the top.
75
+
76
+ - 082c32f948: Deprecated the second parameter of `results.location()` that determines whether an emitted location is optional. In cases where this is currently being set to `false`, the parameter can simply be dropped, as that is the default. Usage where this was being set to `true` should be migrated to set the `presence` option of the emitted location to `optional`. For example:
77
+
78
+ ```ts
79
+ results.location(
80
+ {
81
+ type: 'url',
82
+ target: 'http://example.com/foo',
83
+ },
84
+ true,
85
+ );
86
+
87
+ // migrated to
88
+
89
+ results.location({
90
+ type: 'url',
91
+ target: 'http://example.com/foo',
92
+ presence: 'optional',
93
+ });
94
+ ```
95
+
96
+ - ed09ad8093: Added `LocationSpec`, which was moved over from `@backstage/catalog-model`.
97
+
98
+ Added `LocationInput`, which replaced `LocationSpec` where it was used in the `LocationService` and `LocationStore` interfaces. The `LocationInput` type deprecates the `presence` field, which was not being used in those contexts.
99
+
100
+ - 6d994fd9da: Cleanup catalog-backend API report.
101
+ - 7010349c9a: Added `EntityRelationSpec`, which was moved over from `@backstage/catalog-model`.
102
+ - 6e1cbc12a6: Updated according to the new `getEntityFacets` catalog API method
103
+ - 420f8d710f: Removed the `processors.githubOrg` config section which is unused and has been replaced by the integrations config.
104
+ - b1296f1f57: Deprecated `StaticLocationProcessor` which is unused and replaced by `ConfigLocationEntityProvider`.
105
+ - Updated dependencies
106
+ - @backstage/backend-common@0.11.0
107
+ - @backstage/plugin-scaffolder-common@0.2.2
108
+ - @backstage/catalog-model@0.11.0
109
+ - @backstage/catalog-client@0.7.2
110
+ - @backstage/plugin-permission-node@0.5.2
111
+ - @backstage/integration@0.7.5
112
+
3
113
  ## 0.21.5
4
114
 
5
115
  ### Patch Changes
@@ -784,16 +894,16 @@
784
894
 
785
895
  ### Minor Changes
786
896
 
787
- - 8bfc0571c: Add a default catalog value for BitBucketDiscoveryProcessor. This allows to have a target like so: https://bitbucket.mycompany.com/projects/backstage/repos/service-*
788
- which will be expanded to https://bitbucket.mycompany.com/projects/backstage/repos/service-a/catalog-info.yaml given that repository 'service-a' exists.
897
+ - 8bfc0571c: Add a default catalog value for BitBucketDiscoveryProcessor. This allows to have a target like so: `https://bitbucket.mycompany.com/projects/backstage/repos/service-*`
898
+ which will be expanded to `https://bitbucket.mycompany.com/projects/backstage/repos/service-a/catalog-info.yaml` given that repository 'service-a' exists.
789
899
 
790
900
  ## Migration
791
901
 
792
902
  If you are using a custom [Bitbucket parser](https://backstage.io/docs/integrations/bitbucket/discovery#custom-repository-processing) and your `bitbucket-discovery` target (e.g. in your app-config.yaml) omits the catalog path in any of the following ways:
793
903
 
794
- - https://bitbucket.mycompany.com/projects/backstage/repos/service-*
795
- - https://bitbucket.mycompany.com/projects/backstage/repos/*
796
- - https://bitbucket.mycompany.com/projects/backstage/repos/*/
904
+ - `https://bitbucket.mycompany.com/projects/backstage/repos/service-*`
905
+ - `https://bitbucket.mycompany.com/projects/backstage/repos/*`
906
+ - `https://bitbucket.mycompany.com/projects/backstage/repos/*/`
797
907
 
798
908
  then you will be affected by this change.
799
909
  The 'target' input to your parser before this commit would be '/', and after this commit it will be '/catalog-info.yaml', and as such needs to be handled to maintain the same functionality.
@@ -1111,7 +1221,7 @@
1111
1221
 
1112
1222
  - 0fd4ea443: Updates the `GithubCredentialsProvider` to return the token type, it can either be `token` or `app` depending on the authentication method.
1113
1223
 
1114
- Update the `GithubOrgReaderProcessor` NOT to query for email addresses if GitHub Apps is used for authentication, this is due to inconsistencies in the GitHub API when using server to server communications and installation tokens. https://github.community/t/api-v4-unable-to-retrieve-email-resource-not-accessible-by-integration/13831/4 for more info.
1224
+ Update the `GithubOrgReaderProcessor` NOT to query for email addresses if GitHub Apps is used for authentication, this is due to inconsistencies in the GitHub API when using server to server communications and installation tokens. See [this community discussion](https://github.community/t/api-v4-unable-to-retrieve-email-resource-not-accessible-by-integration/13831/4) for more info.
1115
1225
 
1116
1226
  **Removes** deprecated GithubOrgReaderProcessor provider configuration(`catalog.processors.githubOrg`). If you're using the deprecated config section make sure to migrate to [integrations](https://backstage.io/docs/integrations/github/locations) instead.
1117
1227
 
package/config.d.ts CHANGED
@@ -14,8 +14,6 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import { JsonValue } from '@backstage/config';
18
-
19
17
  export interface Config {
20
18
  /**
21
19
  * Configuration options for the catalog plugin.
@@ -112,39 +110,6 @@ export interface Config {
112
110
  * List of processor-specific options and attributes
113
111
  */
114
112
  processors?: {
115
- /**
116
- * GithubOrgReaderProcessor configuration
117
- *
118
- * @deprecated Configure a GitHub integration instead.
119
- */
120
- githubOrg?: {
121
- /**
122
- * The configuration parameters for each single GitHub org provider.
123
- */
124
- providers: Array<{
125
- /**
126
- * The prefix of the target that this matches on, e.g.
127
- * "https://github.com", with no trailing slash.
128
- */
129
- target: string;
130
- /**
131
- * The base URL of the API of this provider, e.g.
132
- * "https://api.github.com", with no trailing slash.
133
- *
134
- * May be omitted specifically for GitHub; then it will be deduced.
135
- */
136
- apiBaseUrl?: string;
137
- /**
138
- * The authorization token to use for requests to this provider.
139
- *
140
- * If no token is specified, anonymous access is used.
141
- *
142
- * @visibility secret
143
- */
144
- token?: string;
145
- }>;
146
- };
147
-
148
113
  /**
149
114
  * GithubMultiOrgReaderProcessor configuration
150
115
  */
@@ -172,19 +137,6 @@ export interface Config {
172
137
  userNamespace?: string;
173
138
  }>;
174
139
  };
175
-
176
- /**
177
- * AwsOrganizationCloudAccountProcessor configuration
178
- */
179
- awsOrganization?: {
180
- provider: {
181
- /**
182
- * The role to be assumed by this processor
183
- *
184
- */
185
- roleArn?: string;
186
- };
187
- };
188
140
  };
189
141
  };
190
142
  }