@backstage/plugin-catalog-backend 0.21.3 → 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 +175 -6
- package/config.d.ts +0 -48
- package/dist/index.cjs.js +221 -192
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +357 -165
- package/migrations/20220222164811_reprocess_for_relation_refs.js +31 -0
- package/package.json +30 -27
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,174 @@
|
|
|
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
|
+
|
|
113
|
+
## 0.21.5
|
|
114
|
+
|
|
115
|
+
### Patch Changes
|
|
116
|
+
|
|
117
|
+
- Fix for the previous release with missing type declarations.
|
|
118
|
+
- Updated dependencies
|
|
119
|
+
- @backstage/backend-common@0.10.9
|
|
120
|
+
- @backstage/catalog-client@0.7.1
|
|
121
|
+
- @backstage/catalog-model@0.10.1
|
|
122
|
+
- @backstage/config@0.1.15
|
|
123
|
+
- @backstage/errors@0.2.2
|
|
124
|
+
- @backstage/integration@0.7.4
|
|
125
|
+
- @backstage/search-common@0.2.4
|
|
126
|
+
- @backstage/types@0.1.3
|
|
127
|
+
- @backstage/plugin-catalog-common@0.1.4
|
|
128
|
+
- @backstage/plugin-permission-common@0.5.1
|
|
129
|
+
- @backstage/plugin-permission-node@0.5.1
|
|
130
|
+
- @backstage/plugin-scaffolder-common@0.2.1
|
|
131
|
+
|
|
132
|
+
## 0.21.4
|
|
133
|
+
|
|
134
|
+
### Patch Changes
|
|
135
|
+
|
|
136
|
+
- 379da9fb1d: The following processors now properly accept an `ScmIntegrationRegistry` (an
|
|
137
|
+
interface) instead of an `ScmIntegrations` (which is a concrete class).
|
|
138
|
+
|
|
139
|
+
- `AzureDevOpsDiscoveryProcessor`
|
|
140
|
+
- `CodeOwnersProcessor`
|
|
141
|
+
- `GitLabDiscoveryProcessor`
|
|
142
|
+
- `GithubDiscoveryProcessor`
|
|
143
|
+
- `GithubMultiOrgReaderProcessor`
|
|
144
|
+
- `GithubOrgReaderProcessor`
|
|
145
|
+
|
|
146
|
+
- 1ed305728b: Bump `node-fetch` to version 2.6.7 and `cross-fetch` to version 3.1.5
|
|
147
|
+
- c77c5c7eb6: Added `backstage.role` to `package.json`
|
|
148
|
+
- 538ca90790: Use updated type names from `@backstage/catalog-client`
|
|
149
|
+
- ca1d6c1788: Support "dependencyOf" relation in Resource entities
|
|
150
|
+
- 244d24ebc4: Import `Location` from the `@backstage/catalog-client` package.
|
|
151
|
+
- e483dd6c72: Update internal `Location` validation.
|
|
152
|
+
- 216725b434: Updated to use new names for `parseLocationRef` and `stringifyLocationRef`
|
|
153
|
+
- e72d371296: Use `TemplateEntityV1beta2` from `@backstage/plugin-scaffolder-common` instead
|
|
154
|
+
of `@backstage/catalog-model`.
|
|
155
|
+
- 27eccab216: Replaces use of deprecated catalog-model constants.
|
|
156
|
+
- 7aeb491394: Replace use of deprecated `ENTITY_DEFAULT_NAMESPACE` constant with `DEFAULT_NAMESPACE`.
|
|
157
|
+
- b590e9b58d: Optimized entity provider mutations with large numbers of new additions, such as big initial startup commits
|
|
158
|
+
- Updated dependencies
|
|
159
|
+
- @backstage/plugin-scaffolder-common@0.2.0
|
|
160
|
+
- @backstage/backend-common@0.10.8
|
|
161
|
+
- @backstage/catalog-client@0.7.0
|
|
162
|
+
- @backstage/errors@0.2.1
|
|
163
|
+
- @backstage/integration@0.7.3
|
|
164
|
+
- @backstage/plugin-permission-common@0.5.0
|
|
165
|
+
- @backstage/catalog-model@0.10.0
|
|
166
|
+
- @backstage/config@0.1.14
|
|
167
|
+
- @backstage/search-common@0.2.3
|
|
168
|
+
- @backstage/types@0.1.2
|
|
169
|
+
- @backstage/plugin-catalog-common@0.1.3
|
|
170
|
+
- @backstage/plugin-permission-node@0.5.0
|
|
171
|
+
|
|
3
172
|
## 0.21.3
|
|
4
173
|
|
|
5
174
|
### Patch Changes
|
|
@@ -725,16 +894,16 @@
|
|
|
725
894
|
|
|
726
895
|
### Minor Changes
|
|
727
896
|
|
|
728
|
-
- 8bfc0571c: Add a default catalog value for BitBucketDiscoveryProcessor. This allows to have a target like so: https://bitbucket.mycompany.com/projects/backstage/repos/service
|
|
729
|
-
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.
|
|
730
899
|
|
|
731
900
|
## Migration
|
|
732
901
|
|
|
733
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:
|
|
734
903
|
|
|
735
|
-
- https://bitbucket.mycompany.com/projects/backstage/repos/service
|
|
736
|
-
- https://bitbucket.mycompany.com/projects/backstage/repos
|
|
737
|
-
- 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/*/`
|
|
738
907
|
|
|
739
908
|
then you will be affected by this change.
|
|
740
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.
|
|
@@ -1052,7 +1221,7 @@
|
|
|
1052
1221
|
|
|
1053
1222
|
- 0fd4ea443: Updates the `GithubCredentialsProvider` to return the token type, it can either be `token` or `app` depending on the authentication method.
|
|
1054
1223
|
|
|
1055
|
-
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.
|
|
1056
1225
|
|
|
1057
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.
|
|
1058
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
|
}
|