From 02c78a19c6e096f2e7997c346aa67f9131525f7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20M=C3=B6hlmann?= Date: Wed, 11 Sep 2024 12:43:44 +0300 Subject: [PATCH] fix(actions-v3): check feature flag on list methods (#8595) # Which Problems Are Solved In actions/v3 there was no check for the feature flag on any of the: - ListExecutionFunctions - ListExecutionMethods - ListExecutionServices In the integration tests `ensureFeatureEnabled` relies on `ListExecutionMethods` to return an error if the feature is not enabled. This fix makes the test wait untill the feature is fully projected. # How the Problems Are Solved Add the feature check to all of the above methods. # Additional Changes - none # Additional Context Flaky introduced in https://github.com/zitadel/zitadel/pull/8407 --- .../grpc/resources/action/v3alpha/execution.go | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/internal/api/grpc/resources/action/v3alpha/execution.go b/internal/api/grpc/resources/action/v3alpha/execution.go index 794827970b..94ad17c2f0 100644 --- a/internal/api/grpc/resources/action/v3alpha/execution.go +++ b/internal/api/grpc/resources/action/v3alpha/execution.go @@ -91,19 +91,28 @@ func conditionToInclude(cond *action.Condition) (string, error) { } } -func (s *Server) ListExecutionFunctions(_ context.Context, _ *action.ListExecutionFunctionsRequest) (*action.ListExecutionFunctionsResponse, error) { +func (s *Server) ListExecutionFunctions(ctx context.Context, _ *action.ListExecutionFunctionsRequest) (*action.ListExecutionFunctionsResponse, error) { + if err := checkActionsEnabled(ctx); err != nil { + return nil, err + } return &action.ListExecutionFunctionsResponse{ Functions: s.ListActionFunctions(), }, nil } -func (s *Server) ListExecutionMethods(_ context.Context, _ *action.ListExecutionMethodsRequest) (*action.ListExecutionMethodsResponse, error) { +func (s *Server) ListExecutionMethods(ctx context.Context, _ *action.ListExecutionMethodsRequest) (*action.ListExecutionMethodsResponse, error) { + if err := checkActionsEnabled(ctx); err != nil { + return nil, err + } return &action.ListExecutionMethodsResponse{ Methods: s.ListGRPCMethods(), }, nil } -func (s *Server) ListExecutionServices(_ context.Context, _ *action.ListExecutionServicesRequest) (*action.ListExecutionServicesResponse, error) { +func (s *Server) ListExecutionServices(ctx context.Context, _ *action.ListExecutionServicesRequest) (*action.ListExecutionServicesResponse, error) { + if err := checkActionsEnabled(ctx); err != nil { + return nil, err + } return &action.ListExecutionServicesResponse{ Services: s.ListGRPCServices(), }, nil