Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
chore: use the expression string as source of truth (#6718)
Danny Xuf9e4ffbd0627
diff --git a/backend/runner/approval/runner.go b/backend/runner/approval/runner.goindex 5cdf41b706..69da8ebbf9 100644--- a/backend/runner/approval/runner.go+++ b/backend/runner/approval/runner.go@@ -302,10 +302,14 @@ func getApprovalTemplate(approvalSetting *storepb.WorkspaceApprovalSetting, riskreturn nil, err}for _, rule := range approvalSetting.Rules {- if rule.Expression == nil || rule.Expression.Expr == nil {+ if rule.Condition == nil || rule.Condition.Expression == "" {continue}- ast := cel.ParsedExprToAst(rule.Expression)+ ast, issues := e.Compile(rule.Condition.Expression)+ if issues != nil && issues.Err() != nil {+ return nil, issues.Err()+ }+prg, err := e.Program(ast)if err != nil {return nil, errors.Wrap(err, "failed to compile expression")