chore(plugins): remove deprecated plugin integration and expression evaluation#2102
chore(plugins): remove deprecated plugin integration and expression evaluation#2102k-fabryczny wants to merge 33 commits into
Conversation
Signed-off-by: Klaudiusz Fabryczny <klaudiusz.fabryczny@sap.com>
There was a problem hiding this comment.
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.Refresolution helpers (including CEL evaluation and tracking annotation updates) fromplugin_values_resolver.go. - Deleted unit/integration tests that covered the removed helper behavior.
- Simplified
computeReleaseValuesin 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
computeReleaseValuesno longer handles option values that useExpressionorValueFrom.Ref: the loop now returnsoption value %s has no value or valueFrom setfor those cases, even though these fields are still part ofPluginOptionValue(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.
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>
There was a problem hiding this comment.
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_PluginPresetFeaturesno longer covers the common cases whereexpressionEvaluationEnabledis explicitlyfalseor where thepluginPresetkey exists but does not includeexpressionEvaluationEnabled. 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,
},
}
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>
There was a problem hiding this comment.
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/NewCELResolverare no longer referenced anywhere in the repo (onlyBuildTemplateDatais used). With golangci-lintunusedenabled, these exported-but-unused symbols will cause CI to fail; remove them and keepBuildTemplateDataas 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) {
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>
Description
Cleanup after moving CEL evaluation from plugin to PluginPreset
What type of PR is this? (check all applicable)
Related Tickets & Documents
Added tests?
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?
Checklist