Skip to content

Feature: [Catalog] Optionally remove entities from old EntityProviders#28971

Merged
Rugvip merged 7 commits intobackstage:masterfrom
UsainBloot:catalog/evict-orphaned-entity-provider
Feb 27, 2025
Merged

Feature: [Catalog] Optionally remove entities from old EntityProviders#28971
Rugvip merged 7 commits intobackstage:masterfrom
UsainBloot:catalog/evict-orphaned-entity-provider

Conversation

@UsainBloot
Copy link
Copy Markdown
Member

@UsainBloot UsainBloot commented Feb 25, 2025

Context

When switching between different catalog providers, entities related to that provider will remain in the catalog unless manually removed or a custom cleanup provider is created.

This change enables the ability to automatically clean up entities that belong to entity providers which are no longer configured, the next time the catalog is started.

Fixes #18067

💬 Let me know if you would like me to change some of the names of the config, variables and functions to better fit the catalog terminology.

Changes

  • Removes all entities from entity providers which are no longer added to the catalog
  • Adds opt-in catalog.orphanProviderStrategy: delete to enable feature

✔️ Checklist

  • A changeset describing the change and affected packages. (more info)
  • Added or updated documentation
  • Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)
  • All your commits have a Signed-off-by line in the message. (more info)

…ovider

Signed-off-by: Jack Palmer <jackpalmer@spotify.com>
Signed-off-by: Jack Palmer <jackpalmer@spotify.com>
@UsainBloot UsainBloot requested review from a team as code owners February 25, 2025 20:37
@github-actions github-actions Bot added area:catalog Related to the Catalog Project Area domain:docs labels Feb 25, 2025
@backstage-goalie
Copy link
Copy Markdown
Contributor

backstage-goalie Bot commented Feb 25, 2025

Important

This PR includes changes that affect public-facing API. Please ensure you are adding/updating documentation for new features or behavior.

Changed Packages

Package Name Package Path Changeset Bump Current Version
@backstage/plugin-catalog-backend plugins/catalog-backend minor v1.31.1-next.0

Signed-off-by: Jack Palmer <jackpalmer@spotify.com>
Signed-off-by: Jack Palmer <jackpalmer@spotify.com>
Copy link
Copy Markdown
Member

@Rugvip Rugvip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! 👍, couple of things

Comment thread plugins/catalog-backend/src/database/DefaultProviderDatabase.ts
Comment thread plugins/catalog-backend/config.d.ts Outdated
Comment thread .changeset/young-carpets-love.md Outdated
Comment thread .changeset/young-carpets-love.md Outdated
Signed-off-by: Jack Palmer <jackpalmer@spotify.com>
Signed-off-by: Jack Palmer <jackpalmer@spotify.com>
@UsainBloot UsainBloot requested a review from Rugvip February 26, 2025 12:17
Copy link
Copy Markdown
Member

@Rugvip Rugvip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! 👍

Minor bit on the ordering but otherwise I think it looks good. @freben wanna have a final look as well before merge?

Comment thread plugins/catalog-backend/src/service/CatalogBuilder.ts Outdated
Copy link
Copy Markdown
Member

@freben freben left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep looks great. 🙏 Agree that we could do the cleanup before connect.

Signed-off-by: Jack Palmer <jackpalmer@spotify.com>
@Rugvip Rugvip merged commit a852584 into backstage:master Feb 27, 2025
@github-actions
Copy link
Copy Markdown
Contributor

Thank you for contributing to Backstage! The changes in this pull request will be part of the 1.37.0 release, scheduled for Tue, 18 Mar 2025.

@freben freben changed the title Feature: [Catalog] Remove entities from old EntityProviders by default Feature: [Catalog] Optionally remove entities from old EntityProviders Feb 27, 2025
@UsainBloot UsainBloot deleted the catalog/evict-orphaned-entity-provider branch February 27, 2025 11:42
@freben freben mentioned this pull request Mar 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:catalog Related to the Catalog Project Area domain:docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🚀 Feature: Remove entities from old EntityProviders by default

3 participants