Skip to content

Conversation

@lucasgoral
Copy link
Contributor

What this PR does / why we need it:

When editing MCP custom 'crossplane' providers should be preserved

Copilot AI review requested due to automatic review settings December 19, 2025 08:18
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes an issue where custom crossplane providers were not being preserved when editing a Managed Control Plane (MCP). The solution introduces an explicit isProvider field to the ComponentsListItem interface and implements logic to preserve custom providers from the initial selection that may no longer be in the available components list.

Key changes:

  • Added isProvider boolean field to ComponentsListItem interface to replace string-matching logic for identifying providers
  • Implemented preservation logic for custom providers from initialSelection that don't exist in the available components list
  • Centralized component sorting logic in useComponentsSelectionData hook to ensure providers are consistently positioned after crossplane

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/lib/api/types/crate/createManagedControlPlane.ts Added isProvider field to ComponentsListItem interface and updated filter logic to use the new field instead of string matching
src/components/Wizards/CreateManagedControlPlane/useComponentsSelectionData.ts Set isProvider field when building components list, added logic to preserve custom providers from initialSelection, and implemented sorting to position providers after crossplane
src/components/ComponentsSelection/ComponentsSelection.tsx Removed local isProvider callback and sorting logic in favor of using pre-sorted data with component.isProvider field; also alphabetically sorted imports

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@andreaskienle andreaskienle left a comment

Choose a reason for hiding this comment

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

Tested it, fixes the issue.

Here's a follow-up task to clean things up: openmcp-project/backlog#399

@lucasgoral lucasgoral merged commit 53715a3 into main Dec 19, 2025
5 checks passed
@lucasgoral lucasgoral deleted the providers-edit-fix branch December 19, 2025 12:02
@lucasgoral lucasgoral restored the providers-edit-fix branch December 22, 2025 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants