Skip to content

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

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

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

Conversation

@k-fabryczny

@k-fabryczny k-fabryczny commented Jun 29, 2026

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

@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
@github-actions github-actions Bot added size/XXL and removed size/XL labels Jun 30, 2026
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 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

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

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 17 out of 17 changed files in this pull request and generated 2 comments.

Comment thread cmd/greenhouse/controllers.go
Comment thread internal/controller/plugin/plugin_controller_flux.go
@k-fabryczny
k-fabryczny requested a review from a team as a code owner July 3, 2026 12:29
@github-actions github-actions Bot added documentation Improvements or additions to documentation core-apis labels Jul 3, 2026
@k-fabryczny
k-fabryczny requested a review from Copilot July 3, 2026 13:59

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 32 out of 34 changed files in this pull request and generated 6 comments.

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

Comment thread internal/webhook/v1alpha1/pluginpreset_webhook_test.go Outdated
Comment thread internal/webhook/v1alpha1/pluginpreset_webhook_test.go Outdated
Comment thread internal/webhook/v1alpha1/plugin_webhook.go Outdated
Comment thread internal/webhook/v1alpha1/pluginpreset_webhook.go
Comment thread internal/webhook/v1alpha1/plugin_webhook_test.go Outdated
Comment thread internal/webhook/v1alpha1/plugin_webhook_test.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 4 comments.

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

Comment thread internal/webhook/v1alpha1/pluginpreset_webhook.go Outdated
Comment thread internal/webhook/v1alpha1/pluginpreset_webhook.go Outdated
Comment thread internal/webhook/v1alpha1/pluginpreset_webhook.go Outdated
Comment thread internal/webhook/v1alpha1/pluginpreset_webhook.go Outdated
k-fabryczny and others added 28 commits July 20, 2026 14:43
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>
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>
…esetToPluginOptionValues

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>
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>
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>
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 force-pushed the chore/plugin-cleanup branch from df99276 to a428357 Compare July 20, 2026 13:02

@Zaggy21 Zaggy21 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.

The PR looks clean now.

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.

4 participants