@backstage/plugin-catalog-backend 0.13.8 → 0.17.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 +134 -0
- package/dist/index.cjs.js +3025 -2546
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +663 -534
- package/migrations/20210925102509_add_refresh_state_input_hash.js +38 -0
- package/package.json +12 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,139 @@
|
|
|
1
1
|
# @backstage/plugin-catalog-backend
|
|
2
2
|
|
|
3
|
+
## 0.17.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 9fb9256e50: This continues the deprecation of classes used by the legacy catalog engine. New deprecations can be viewed in this [PR](https://github.com/backstage/backstage/pull/7500) or in the API reference documentation.
|
|
8
|
+
|
|
9
|
+
The `batchAddOrUpdateEntities` method of the `EntitiesCatalog` interface has been marked as optional and is being deprecated. It is still implemented and required to be implemented by the legacy catalog classes, but was never implemented in the new catalog.
|
|
10
|
+
|
|
11
|
+
This change is only relevant if you are consuming the `EntitiesCatalog` interface directly, in which case you will get a type error that you need to resolve. It can otherwise be ignored.
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 3b59bb915e: Fixes a bug in the catalog where entities were not being marked as orphaned.
|
|
16
|
+
- 55ff928d50: This change refactors the internal package structure to remove the `next` catalog folder that was used during the implementation and testing phase of the new catalog engine. The implementation is now the default and is therefore restructured to no longer be packaged under `next/`. This refactor does not change catalog imports from other parts of the project.
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
- @backstage/integration@0.6.8
|
|
19
|
+
|
|
20
|
+
## 0.16.0
|
|
21
|
+
|
|
22
|
+
### Minor Changes
|
|
23
|
+
|
|
24
|
+
- 2c5bab2f82: Errors emitted from processors are now considered a failure during entity processing and will prevent entities from being updated. The impact of this change is that when errors are emitted while for example reading a location, then ingestion effectively stops there. If you emit a number of entities along with just one error, then the error will be persisted on the current entity but the emitted entities will _not_ be stored. This fixes [a bug](https://github.com/backstage/backstage/issues/6973) where entities would get marked as orphaned rather than put in an error state when the catalog failed to read a location.
|
|
25
|
+
|
|
26
|
+
In previous versions of the catalog, an emitted error was treated as a less severe problem than an exception thrown by the processor. We are now ensuring that the behavior is consistent for these two cases. Even though both thrown and emitted errors are treated the same, emitted errors stay around as they allow you to highlight multiple errors related to an entity at once. An emitted error will also only prevent the writing of the processing result, while a thrown error will skip the rest of the processing steps.
|
|
27
|
+
|
|
28
|
+
### Patch Changes
|
|
29
|
+
|
|
30
|
+
- 957e4b3351: Updated dependencies
|
|
31
|
+
- f66c38148a: Avoid duplicate logging of entity processing errors.
|
|
32
|
+
- 426d5031a6: A number of classes and types, that were part of the old catalog engine implementation, are now formally marked as deprecated. They will be removed entirely from the code base in a future release.
|
|
33
|
+
|
|
34
|
+
After upgrading to this version, it is recommended that you take a look inside your `packages/backend/src/plugins/catalog.ts` file (using a code editor), to see if you are using any functionality that it marks as deprecated. If you do, please migrate away from it at your earliest convenience.
|
|
35
|
+
|
|
36
|
+
Migrating to using the new engine implementation is typically a matter of calling `CatalogBuilder.create({ ... })` instead of `new CatalogBuilder({ ... })`.
|
|
37
|
+
|
|
38
|
+
If you are seeing deprecation warnings for `createRouter`, you can either use the `router` field from the return value from updated catalog builder, or temporarily call `createNextRouter`. The latter will however also be deprecated at a later time.
|
|
39
|
+
|
|
40
|
+
- 7b78dd17e6: Replace slash stripping regexp with trimEnd to remove CodeQL warning
|
|
41
|
+
- Updated dependencies
|
|
42
|
+
- @backstage/catalog-model@0.9.4
|
|
43
|
+
- @backstage/backend-common@0.9.6
|
|
44
|
+
- @backstage/catalog-client@0.5.0
|
|
45
|
+
- @backstage/integration@0.6.7
|
|
46
|
+
|
|
47
|
+
## 0.15.0
|
|
48
|
+
|
|
49
|
+
### Minor Changes
|
|
50
|
+
|
|
51
|
+
- 1572d02b63: Introduced a new `CatalogProcessorCache` that is available to catalog processors. It allows arbitrary values to be saved that will then be visible during the next run. The cache is scoped to each individual processor and entity, but is shared across processing steps in a single processor.
|
|
52
|
+
|
|
53
|
+
The cache is available as a new argument to each of the processing steps, except for `validateEntityKind` and `handleError`.
|
|
54
|
+
|
|
55
|
+
This also introduces an optional `getProcessorName` to the `CatalogProcessor` interface, which is used to provide a stable identifier for the processor. While it is currently optional it will move to be required in the future.
|
|
56
|
+
|
|
57
|
+
The breaking part of this change is the modification of the `state` field in the `EntityProcessingRequest` and `EntityProcessingResult` types. This is unlikely to have any impact as the `state` field was previously unused, but could require some minor updates.
|
|
58
|
+
|
|
59
|
+
- c1836728e0: Add `/entities/by-name/:kind/:namespace/:name/ancestry` to get the "processing parents" lineage of an entity.
|
|
60
|
+
|
|
61
|
+
This involves a breaking change of adding the method `entityAncestry` to `EntitiesCatalog`.
|
|
62
|
+
|
|
63
|
+
### Patch Changes
|
|
64
|
+
|
|
65
|
+
- 3d10360c82: When issuing a `full` update from an entity provider, entities with updates are now properly persisted.
|
|
66
|
+
- 9ea4565b00: Fixed a bug where internal references within the catalog were broken when new entities where added through entity providers, such as registering a new location or adding one in configuration. These broken references then caused some entities to be incorrectly marked as orphaned and prevented refresh from working properly.
|
|
67
|
+
- Updated dependencies
|
|
68
|
+
- @backstage/backend-common@0.9.5
|
|
69
|
+
- @backstage/integration@0.6.6
|
|
70
|
+
|
|
71
|
+
## 0.14.0
|
|
72
|
+
|
|
73
|
+
### Minor Changes
|
|
74
|
+
|
|
75
|
+
- d6f90e934d: #### Enforcing catalog rules
|
|
76
|
+
|
|
77
|
+
Apply the catalog rules enforcer, based on origin location.
|
|
78
|
+
|
|
79
|
+
This is a breaking change, in the sense that this was not properly checked in earlier versions of the new catalog engine. You may see ingestion of certain entities start to be rejected after this update, if the following conditions apply to you:
|
|
80
|
+
|
|
81
|
+
- You are using the configuration key `catalog.rules.[].allow`, and
|
|
82
|
+
- Your registered locations point (directly or transitively) to entities whose kinds are not listed in `catalog.rules.[].allow`
|
|
83
|
+
|
|
84
|
+
and/or
|
|
85
|
+
|
|
86
|
+
- You are using the configuration key `catalog.locations.[].rules.[].allow`
|
|
87
|
+
- The config locations point (directly or transitively) to entities whose kinds are not listed neither `catalog.rules.[].allow`, nor in the corresponding `.rules.[].allow` of that config location
|
|
88
|
+
|
|
89
|
+
This is an example of what the configuration might look like:
|
|
90
|
+
|
|
91
|
+
```yaml
|
|
92
|
+
catalog:
|
|
93
|
+
# These do not list Template as a valid kind; users are therefore unable to
|
|
94
|
+
# manually register entities of the Template kind
|
|
95
|
+
rules:
|
|
96
|
+
- allow:
|
|
97
|
+
- Component
|
|
98
|
+
- API
|
|
99
|
+
- Resource
|
|
100
|
+
- Group
|
|
101
|
+
- User
|
|
102
|
+
- System
|
|
103
|
+
- Domain
|
|
104
|
+
- Location
|
|
105
|
+
locations:
|
|
106
|
+
# This lists Template as valid only for that specific config location
|
|
107
|
+
- type: file
|
|
108
|
+
target: ../../plugins/scaffolder-backend/sample-templates/all-templates.yaml
|
|
109
|
+
rules:
|
|
110
|
+
- allow: [Template]
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
If you are not using any of those `rules` section, you should not be affected by this change.
|
|
114
|
+
|
|
115
|
+
If you do use any of those `rules` sections, make sure that they are complete and list all of the kinds that are in active use in your Backstage installation.
|
|
116
|
+
|
|
117
|
+
#### Other
|
|
118
|
+
|
|
119
|
+
Also, the class `CatalogRulesEnforcer` was renamed to `DefaultCatalogRulesEnforcer`, implementing the type `CatalogRulesEnforcer`.
|
|
120
|
+
|
|
121
|
+
- 501ce92f9c: Bitbucket Cloud Discovery support
|
|
122
|
+
- 89fd81a1ab: Add API endpoint for requesting a catalog refresh at `/refresh`, which is activated if a `RefreshService` is passed to `createRouter`.
|
|
123
|
+
|
|
124
|
+
The new method is used to trigger a refresh of an entity in an as localized was as possible, usually by refreshing the parent location.
|
|
125
|
+
|
|
126
|
+
### Patch Changes
|
|
127
|
+
|
|
128
|
+
- 9ef2987a83: Update `createLocation` to optionally return `exists` to signal that the location already exists, this is only returned for dry runs.
|
|
129
|
+
- febddedcb2: Bump `lodash` to remediate `SNYK-JS-LODASH-590103` security vulnerability
|
|
130
|
+
- Updated dependencies
|
|
131
|
+
- @backstage/integration@0.6.5
|
|
132
|
+
- @backstage/catalog-client@0.4.0
|
|
133
|
+
- @backstage/catalog-model@0.9.3
|
|
134
|
+
- @backstage/backend-common@0.9.4
|
|
135
|
+
- @backstage/config@0.1.10
|
|
136
|
+
|
|
3
137
|
## 0.13.8
|
|
4
138
|
|
|
5
139
|
### Patch Changes
|