Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(events,catalog,bitbucket-cloud)!: fix new backend system support;…
… migrates to `EventsService` - Fixes the support for the new backend system that was broken entirely (with and without events support). - Migrates the `BitbucketCloudEntityProvider` to use the `EventsService`. Signed-off-by: Patrick Jungermann <Patrick.Jungermann@gmail.com>
- Loading branch information
1 parent
f5ec8a4
commit 155f921
Showing
9 changed files
with
141 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- | ||
'@backstage/plugin-catalog-backend-module-bitbucket-cloud': minor | ||
--- | ||
|
||
BREAKING CHANGE: Migrates the `BitbucketCloudEntityProvider` to use the `EventsService`; fix new backend system support. | ||
|
||
`BitbucketCloudEntityProvider.fromConfig` accepts `events: EventsService` as optional argument to its `options`. | ||
With provided `events`, the event-based updates/refresh will be available. | ||
However, the `EventSubscriber` interface was removed including its `supportsEventTopics()` and `onEvent(params)`. | ||
|
||
The event subscription happens on `connect(connection)` if the `events` is available. | ||
|
||
**Migration:** | ||
|
||
```diff | ||
const bitbucketCloudProvider = BitbucketCloudEntityProvider.fromConfig( | ||
env.config, | ||
{ | ||
catalogApi: new CatalogClient({ discoveryApi: env.discovery }), | ||
+ events: env.events, | ||
logger: env.logger, | ||
scheduler: env.scheduler, | ||
tokenManager: env.tokenManager, | ||
}, | ||
); | ||
- env.eventBroker.subscribe(bitbucketCloudProvider); | ||
``` | ||
|
||
**New Backend System:** | ||
|
||
Before this change, using this module with the new backend system was broken. | ||
Now, you can add the catalog module for Bitbucket Cloud incl. event support backend. | ||
Event support will always be enabled. | ||
However, no updates/refresh will happen without receiving events. | ||
|
||
```ts | ||
backend.add( | ||
import('@backstage/plugin-catalog-backend-module-bitbucket-cloud/alpha'), | ||
); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.