Skip to content

refactor(pluginpresets): create a dedicated PluginSpec#2000

Open
IvoGoman wants to merge 2 commits into
mainfrom
feat/split-pluginSpec
Open

refactor(pluginpresets): create a dedicated PluginSpec#2000
IvoGoman wants to merge 2 commits into
mainfrom
feat/split-pluginSpec

Conversation

@IvoGoman
Copy link
Copy Markdown
Contributor

Description

Some fields (ClusterName, WaitFor) of the PluginSpec are not used by the PluginPreset With the upcoming changes of moving expression evaluation to the PluginPreset controller this will also effect the PluginOptionValues.

This change brings a dedicated PluginSpec for PluginPresets and prepares the types for PluginOptionValues. The usage of the new PluginPresetPluginOptionValue will be implemented separately. Fields such as ClusterName, WaitFor are removed, both from types and webhook validation.

What type of PR is this? (check all applicable)

  • 🍕 Feature
  • 🐛 Bug Fix
  • 📝 Documentation Update
  • 🎨 Style
  • 🧑‍💻 Code Refactor
  • 🔥 Performance Improvements
  • ✅ Test
  • 🤖 Build
  • 🔁 CI
  • 📦 Chore (Release)
  • ⏩ Revert

Related Tickets & Documents

Added tests?

  • 👍 yes
  • 🙅 no, because they aren't needed
  • 🙋 no, because I need help
  • Separate ticket for tests # (issue/pr)

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Added to documentation?

  • 📜 README.md
  • 🤝 Documentation pages updated
  • 🙅 no documentation needed
  • (if applicable) generated OpenAPI docs for CRD changes

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes

Copilot AI review requested due to automatic review settings May 20, 2026 09:57
@IvoGoman IvoGoman requested review from a team as code owners May 20, 2026 09:57
@IvoGoman IvoGoman changed the title refactor(pluginpreset): create a dedicated PluginSpec refactor(pluginpresets): create a dedicated PluginSpec May 20, 2026
@github-actions github-actions Bot added size/XL documentation Improvements or additions to documentation and removed size/L labels May 20, 2026
Copy link
Copy Markdown
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

Refactors the PluginPreset API to use a dedicated PluginPresetPluginSpec (instead of reusing PluginSpec), removing clusterName/waitFor from the embedded preset plugin spec and adjusting controller/webhook/tests accordingly. This also updates API/CRD documentation to deprecate expression/ref usage on standalone Plugin resources.

Changes:

  • Introduces PluginPresetPluginSpec on PluginPresetSpec and updates controller logic to map it into a PluginSpec when creating/updating Plugin resources.
  • Updates webhook validation and multiple test suites to reflect the new PluginPreset spec shape (removing clusterName checks, updating types).
  • Regenerates CRDs / TypeScript schema output and updates option value docs with deprecation notes for standalone plugins.

Reviewed changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
types/typescript/schema.d.ts Regenerated OpenAPI TypeScript types output.
internal/webhook/v1alpha1/pluginpreset_webhook.go Removes webhook validation tied to removed clusterName in preset plugin spec.
internal/webhook/v1alpha1/pluginpreset_webhook_test.go Updates admission tests to new PluginPresetPluginSpec and removes clusterName test coverage.
internal/test/resources.go Updates test helper to populate PluginPreset.Spec.Plugin via field mapping.
internal/controller/plugin/pluginpreset_controller.go Uses a mapping helper to build PluginSpec from PluginPreset + cluster name.
internal/controller/plugin/pluginpreset_controller_test.go Updates tests to construct presets with PluginPresetPluginSpec.
internal/cmd/plugin_template_test.go Updates CLI/template tests to use PluginPresetPluginSpec.
charts/manager/crds/greenhouse.sap_plugins.yaml Regenerated Plugin CRD (includes updated option field descriptions).
charts/manager/crds/greenhouse.sap_pluginpresets.yaml Regenerated PluginPreset CRD reflecting dedicated preset plugin spec.
api/v1alpha1/zz_generated.deepcopy.go Regenerated deepcopy methods for new API types.
api/v1alpha1/pluginpreset_types.go Introduces PluginPresetPluginSpec and related new API types.
api/v1alpha1/plugin_types.go Adds deprecation notes to expression/ref fields for standalone plugins.
Files not reviewed (1)
  • api/v1alpha1/zz_generated.deepcopy.go: Language not supported
Comments suppressed due to low confidence (2)

charts/manager/crds/greenhouse.sap_plugins.yaml:7

  • This CRD header lost the SPDX license lines, and the controller-gen annotation regressed to v0.20.0 while the repo pins CONTROLLER_TOOLS_VERSION ?= 0.20.1 in Makefile. Please regenerate with the pinned controller-gen version and keep the SPDX header to avoid REUSE/license and consistency issues (other CRDs still use v0.20.1).
# SPDX-FileCopyrightText: 2026 SAP SE or an SAP affiliate company and Greenhouse contributors
# SPDX-License-Identifier: Apache-2.0

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:

charts/manager/crds/greenhouse.sap_pluginpresets.yaml:7

  • This CRD header lost the SPDX license lines, and the controller-gen annotation regressed to v0.20.0 while the repo pins CONTROLLER_TOOLS_VERSION ?= 0.20.1 in Makefile. Please regenerate with the pinned controller-gen version and keep the SPDX header to avoid REUSE/license and consistency issues (other CRDs still use v0.20.1).
# SPDX-FileCopyrightText: 2026 SAP SE or an SAP affiliate company and Greenhouse contributors
# SPDX-License-Identifier: Apache-2.0

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:

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

Comment thread internal/test/resources.go
Comment thread internal/controller/plugin/pluginpreset_controller.go
Comment thread internal/controller/plugin/pluginpreset_controller.go Outdated
Comment thread api/v1alpha1/pluginpreset_types.go
Zaggy21
Zaggy21 previously approved these changes May 20, 2026
Some fields (ClusterName, WaitFor) of the PluginSpec are not used by the PluginPreset
With the upcoming changes of moving expression evaluation to the PluginPreset controller this will also effect the PluginOptionValues.

This change brings a dedicated PluginSpec for PluginPresets and prepares the types for PluginOptionValues. The usage of the new PluginPresetPluginOptionValue will be implemented separately.
Fields such as ClusterName, WaitFor are removed, both from types and webhook validation.

Signed-off-by: Ivo Gosemann <ivo.gosemann@sap.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core-apis documentation Improvements or additions to documentation feature helm-charts size/XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants