Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: bump up cel code size to 1M (#7865)

Danny Xu071bccd095fe
diff --git a/backend/common/convert.go b/backend/common/convert.go
index b55788025c..13d52293ba 100644
--- a/backend/common/convert.go
+++ b/backend/common/convert.go
@@ -9,6 +9,8 @@ import (
"google.golang.org/grpc/status"
)
+const celLimit = 1024 * 1024
+
// RiskFactors are the variables when evaluating the risk level.
var RiskFactors = []cel.EnvOption{
// string factors
@@ -30,6 +32,7 @@ var RiskFactors = []cel.EnvOption{
var ApprovalFactors = []cel.EnvOption{
cel.Variable("level", cel.IntType),
cel.Variable("source", cel.IntType),
+ cel.ParserExpressionSizeLimit(celLimit),
}
// QueryExportPolicyCELAttributes are the variables when evaluating query and export permissions.
@@ -41,6 +44,7 @@ var QueryExportPolicyCELAttributes = []cel.EnvOption{
cel.Variable("resource.database", cel.StringType),
cel.Variable("resource.schema", cel.StringType),
cel.Variable("resource.table", cel.StringType),
+ cel.ParserExpressionSizeLimit(celLimit),
}
// MaskingRulePolicyCELAttributes are the variables when evaluating masking rule.
@@ -52,6 +56,7 @@ var MaskingRulePolicyCELAttributes = []cel.EnvOption{
cel.Variable("schema_name", cel.StringType),
cel.Variable("table_name", cel.StringType),
cel.Variable("column_classification_level", cel.StringType),
+ cel.ParserExpressionSizeLimit(celLimit),
}
// MaskingExceptionPolicyCELAttributes are the variables when evaluating masking exception.
@@ -62,6 +67,7 @@ var MaskingExceptionPolicyCELAttributes = []cel.EnvOption{
cel.Variable("resource.schema_name", cel.StringType),
cel.Variable("resource.column_name", cel.StringType),
cel.Variable("request.time", cel.TimestampType),
+ cel.ParserExpressionSizeLimit(celLimit),
}
// ConvertParsedRisk converts parsed risk to unparsed format.
diff --git a/scripts/.air.toml b/scripts/.air.toml
index 79778f81e3..3e03fab8e7 100644
--- a/scripts/.air.toml
+++ b/scripts/.air.toml
@@ -10,7 +10,7 @@ tmp_dir = ".air"
--tags "" \
-o ./.air/bytebase ./backend/bin/server/main.go"""
delay = 500
- exclude_dir = [".air", "vendor", "frontend", "docs"]
+ exclude_dir = [".air", "bytebase-build", "docs", "frontend", "helm-charts", "proto", "quickstart", "scripts", "vendor"]
exclude_file = []
exclude_regex = []
exclude_unchanged = false