Skip to content

chore(plugins): remove deprecated plugin integration and expression evaluation#2102

Open
k-fabryczny wants to merge 33 commits into
mainfrom
chore/plugin-cleanup
Open

chore(plugins): remove deprecated plugin integration and expression evaluation#2102
k-fabryczny wants to merge 33 commits into
mainfrom
chore/plugin-cleanup

Conversation

@k-fabryczny

Copy link
Copy Markdown
Contributor

Description

Cleanup after moving CEL evaluation from plugin to PluginPreset

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
  • 🧹 Cleanup

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

Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
@k-fabryczny k-fabryczny requested a review from a team as a code owner June 29, 2026 13:05
Copilot AI review requested due to automatic review settings June 29, 2026 13:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Cleanup PR intended to remove now-unused plugin-side CEL/external reference resolution after moving evaluation responsibilities to PluginPreset.

Changes:

  • Removed ValueFrom.Ref resolution helpers (including CEL evaluation and tracking annotation updates) from plugin_values_resolver.go.
  • Deleted unit/integration tests that covered the removed helper behavior.
  • Simplified computeReleaseValues in the Flux plugin controller path by removing expression/ref resolution logic.

Reviewed changes

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

File Description
internal/controller/plugin/plugin_values_resolver.go Removes external reference/CEL resolution and related tracking-annotation helpers, leaving only untracking cleanup logic.
internal/controller/plugin/plugin_values_resolver_test.go Removes unit tests that covered the deleted helper functions.
internal/controller/plugin/plugin_integration/plugin_integration_test.go Removes integration specs covering external ref resolution + tracking behavior (file now effectively has only setup/cleanup).
internal/controller/plugin/plugin_controller_flux.go Drops expression/ref handling from computeReleaseValues and keeps integration tracking cleanup flow.
Comments suppressed due to low confidence (1)

internal/controller/plugin/plugin_controller_flux.go:482

  • computeReleaseValues no longer handles option values that use Expression or ValueFrom.Ref: the loop now returns option value %s has no value or valueFrom set for those cases, even though these fields are still part of PluginOptionValue (and are used elsewhere, e.g. option checksum calculation and e2e plugin integration scenarios). This will break reconciliation for Plugins that rely on expression evaluation or external references, and the error message is misleading.

Either restore expression/ref resolution here (or earlier in helm.GetPluginOptionValuesForPlugin), or explicitly reject these fields with a clear error and update validation/webhooks + tests accordingly.

	for _, v := range optionValues {
		switch {
		case v.Value != nil:
			// noop, direct values are already set
			continue

		case v.ValueFrom != nil && v.ValueFrom.Secret != nil:
			// noop, secret refs are not resolved here
			continue
		default:
			return nil, fmt.Errorf("option value %s has no value or valueFrom set", v.Name)
		}

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

Comment thread internal/controller/plugin/plugin_controller_flux.go Outdated
Comment thread internal/controller/plugin/plugin_integration/plugin_integration_test.go Outdated
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
@github-actions github-actions Bot added size/XXL and removed size/XL labels Jun 30, 2026
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Comment thread internal/controller/plugin/plugin_controller_flux.go Outdated
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated 5 comments.

Comment thread internal/controller/plugin/plugin_controller_flux.go
Comment thread cmd/greenhouse/controllers.go
Comment thread internal/features/features_test.go Outdated
Comment thread internal/features/features_test.go Outdated
Comment thread e2e/plugin/e2e_test.go
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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

Comments suppressed due to low confidence (1)

internal/features/features_test.go:216

  • Test_PluginPresetFeatures no longer covers the common cases where expressionEvaluationEnabled is explicitly false or where the pluginPreset key exists but does not include expressionEvaluationEnabled. Keeping these cases helps ensure the default/disabled behavior remains stable (and distinct from the ConfigMap-not-found path).
	testCases := []testCase{
		{
			name:                         "it should return true when expressionEvaluationEnabled is true",
			configMapData:                map[string]string{PluginPresetFeatureKey: "expressionEvaluationEnabled: true\n"},
			expectedExpressionEvaluation: true,
		},
		{
			name:                         "it should return false when feature-flags cm is not found",
			getError:                     apierrors.NewNotFound(schema.GroupResource{}, "configmap not found"),
			expectedExpressionEvaluation: false,
		},
		{
			name:                         "it should return false when flag is malformed in feature-flags cm",
			configMapData:                map[string]string{PluginPresetFeatureKey: "expressionEvaluationEnabled:: invalid_yaml"},
			expectedExpressionEvaluation: false,
		},
	}

Comment thread internal/features/features_test.go
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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

Comment thread internal/controller/plugin/plugin_controller_flux.go Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 31 out of 33 changed files in this pull request and generated 3 comments.

Files not reviewed (1)
  • api/v1alpha1/zz_generated.deepcopy.go: Generated file

Comment thread api/v1alpha1/plugin_types.go
Comment thread charts/manager/crds/greenhouse.sap_plugins.yaml
Comment thread internal/webhook/v1alpha1/pluginpreset_webhook.go
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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

Files not reviewed (1)
  • api/v1alpha1/zz_generated.deepcopy.go: Generated file

Comment thread internal/webhook/v1alpha1/pluginpreset_webhook.go
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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

Files not reviewed (1)
  • api/v1alpha1/zz_generated.deepcopy.go: Generated file

Comment thread internal/webhook/v1alpha1/pluginpreset_webhook.go
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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

Files not reviewed (1)
  • api/v1alpha1/zz_generated.deepcopy.go: Generated file
Comments suppressed due to low confidence (1)

internal/helm/cel.go:18

  • CELResolver / NewCELResolver are no longer referenced anywhere in the repo (only BuildTemplateData is used). With golangci-lint unused enabled, these exported-but-unused symbols will cause CI to fail; remove them and keep BuildTemplateData as the remaining helper.
type CELResolver struct {
	templateData map[string]any
}

// NewCELResolver creates a new CELResolver for a given Plugin.
func NewCELResolver(optionValues []greenhousev1alpha1.PluginOptionValue) (*CELResolver, error) {

Comment thread internal/webhook/v1alpha1/pluginpreset_webhook.go

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 31 out of 33 changed files in this pull request and generated 3 comments.

Files not reviewed (1)
  • api/v1alpha1/zz_generated.deepcopy.go: Generated file

Comment thread internal/webhook/v1alpha1/pluginpreset_webhook.go
Comment thread internal/webhook/v1alpha1/pluginpreset_webhook.go
Comment thread internal/webhook/v1alpha1/plugin_webhook.go
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
@k-fabryczny k-fabryczny requested a review from Copilot July 8, 2026 13:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 31 out of 33 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • api/v1alpha1/zz_generated.deepcopy.go: Generated file

Comment thread internal/webhook/v1alpha1/plugin_webhook.go
Comment thread internal/webhook/v1alpha1/pluginpreset_webhook.go
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
@k-fabryczny k-fabryczny requested a review from Zaggy21 July 9, 2026 09:14
Comment thread internal/controller/plugin/plugin_values_resolver.go Outdated
Comment thread api/v1alpha1/plugin_types.go Outdated
Comment thread charts/manager/templates/webhook/webhooks.yaml
Comment thread e2e/plugin/e2e_test.go Outdated
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
@k-fabryczny k-fabryczny changed the title chore(plugins): remove unused code chore(plugins): remove deprecated plugin integration and expression evaluation Jul 13, 2026
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 helm-charts size/XXL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants