Skip to content

Migrate gomplate v4 and fix eval ports - #181

Merged
moshloop merged 28 commits into
mainfrom
gomplate-v4-and-eval-fixes-dmjta83mik4w
Nov 13, 2026
Merged

moshloop merged 28 commits into
mainfrom
gomplate-v4-and-eval-fixes-dmjta83mik4w

Conversation

@moshloop

@moshloop moshloop commented Nov 1, 2026

Copy link
Copy Markdown
Member

What

  • Fix eval-server port conflicts by selecting an available loopback port and keeping Vite's proxy aligned with it
  • Force dependency re-optimization when serving from the sibling clicky-ui source
  • Update pnpm to 11.22.0 and the Go toolchain to 1.26.1
  • Refresh Go modules and upgrade @flanksource/clicky-ui to 0.3.54
  • Migrate gomplate to v4 and cel.dev/cel-go, upgrading CEL to v0.32.0
  • Apply verified Go and DOMPurify security fixes

Notes

  • Breaking change: gomplate is imported via github.com/flanksource/gomplate/v4 and CEL types via cel.dev/cel-go
  • Configures separate main/v4 and 3.x/security release lines
  • Draft: inherited clicky-ui v0.3.54 imports a missing optional ai peer, which blocks the playground production build
  • Validation: full Go tests, lint, ceval build and smoke, web typechecks and tests, and workflow checks passed; post-update govulncheck and production pnpm audit are clean

@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 174 files, which is 74 over the limit of 100.

To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch.

Upgrade to a paid plan to raise the limit.

This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f266a5b7-ef2c-44fd-a278-2efaf285023b
Commits

Reviewing files that changed from the base of the PR and between 98ef53e and 595e4d5.

Files ignored due to path filters: 5

  • go.sum is excluded by !**/*.sum
  • web/packages/lang/src/generated/conformance.json is excluded by !**/generated/**
  • web/packages/lang/src/generated/languages.json is excluded by !**/generated/**
  • web/packages/lang/src/generated/spec.json is excluded by !**/generated/**
  • web/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Files selected for processing: 174

  • .github/workflows/benchmark.yml
  • Dockerfile
  • Dockerfile.integration
  • GO_TEMPLATE.md
  • Makefile
  • README.md
  • cel.go
  • cel_collections.go
  • cel_collections_spec_test.go
  • cel_decimal.go
  • cel_equivalents_spec_test.go
  • cel_expression.go
  • cel_fold.go
  • cel_foundation_spec_test.go
  • cel_functions.go
  • cel_functions_spec_test.go
  • cel_input_spec_test.go
  • cel_native.go
  • cel_native_test.go
  • cel_result.go
  • cel_tracker.go
  • cel_tracker_test.go
  • cel_v031_bench_test.go
  • celext/README.md
  • celext/cost_models.go
  • celext/doc.go
  • celext/encoders.go
  • celext/formatting.go
  • celext/formatting_v2.go
  • celext/guards.go
  • celext/internal/sync/main.go
  • celext/internal/sync/sets-receiver.patch
  • celext/internal/sync/source.go
  • celext/lists.go
  • celext/math.go
  • celext/parity_spec_test.go
  • celext/sets.go
  • celext/source_version.go
  • celext/source_version_spec_test.go
  • celext/strings.go
  • celext/suite_test.go
  • celvalues/README.md
  • celvalues/adapter.go
  • celvalues/celvalues_test.go
  • celvalues/commons_money_test.go
  • celvalues/date.go
  • celvalues/doc.go
  • celvalues/equivalence_test.go
  • celvalues/integration_test.go
  • celvalues/library.go
  • celvalues/money.go
  • celvalues/money_arithmetic.go
  • celvalues/native_test.go
  • celvalues/struct.go
  • cmd/ceval/main.go
  • cmd/gencel.go
  • cmd/gencel_test.go
  • cmd/genmonarch/main.go
  • cmd/playground/main.go
  • coll/coll.go
  • coll/json.go
  • coll/json_test.go
  • conv/conv.go
  • data/data.go
  • docs/content/installing.md
  • funcs.go
  • funcs/aws.go
  • funcs/base64.go
  • funcs/base64_gen.go
  • funcs/business_hours_cel.go
  • funcs/cast.go
  • funcs/cel_exports.go
  • funcs/coll.go
  • funcs/coll_gen.go
  • funcs/common.go
  • funcs/conv.go
  • funcs/conv_gen.go
  • funcs/crypto_gen.go
  • funcs/data.go
  • funcs/data_gen.go
  • funcs/encode_gen.go
  • funcs/filepath.go
  • funcs/filepath_gen.go
  • funcs/k8s.go
  • funcs/k8s_gen.go
  • funcs/math.go
  • funcs/math_gen.go
  • funcs/net_gen.go
  • funcs/path.go
  • funcs/path_gen.go
  • funcs/random.go
  • funcs/random_gen.go
  • funcs/regexp.go
  • funcs/regexp_gen.go
  • funcs/strings.go
  • funcs/strings_gen.go
  • funcs/test.go
  • funcs/test_gen.go
  • funcs/time.go
  • funcs/time_cel.go
  • funcs/time_gen.go
  • funcs/uuid.go
  • funcs/uuid_gen.go
  • gencel/generator.go
  • gencel/generator_test.go
  • genmonarch/build.go
  • genmonarch/conformance.go
  • genmonarch/conformance_validate.go
  • genmonarch/grammar/cel_test.go
  • genmonarch/grammar/gotemplate.go
  • genmonarch/lang_cel.go
  • genmonarch/vocab_cel.go
  • genmonarch/vocab_gotemplate.go
  • go.mod
  • hack/hostplayground/main.go
  • internal/releasepolicy/benchmark_test.go
  • kubernetes/cel_export.go
  • kubernetes/format.go
  • kubernetes/health.go
  • kubernetes/lists.go
  • kubernetes/quantity.go
  • kubernetes/regex.go
  • kubernetes/topology.go
  • kubernetes/url.go
  • nilsafe/nilsafe.go
  • nilsafe/nilsafe_test.go
  • nilsafe/zeroval.go
  • playground/eval.go
  • playground/eval_test.go
  • playground/server.go
  • run_expression_bench_test.go
  • run_expression_functions_bench_test.go
  • serialize.go
  • serialize_bench_test.go
  • strings/bytes.go
  • strings/cel_gen_exports.go
  • strings/duration.go
  • strings/duration_gen.go
  • strings/strings.go
  • template.go
  • template_test.go
  • template_values.go
  • template_values_test.go
  • tests/cel_test.go
  • tests/gomplate_test.go
  • tests/javascript_test.go
  • tests/serialize_test.go
  • texttemplate/LICENSE
  • texttemplate/README.md
  • texttemplate/doc.go
  • texttemplate/example_test.go
  • texttemplate/examplefiles_test.go
  • texttemplate/examplefunc_test.go
  • texttemplate/exec.go
  • texttemplate/exec_test.go
  • texttemplate/funcs.go
  • texttemplate/helper.go
  • texttemplate/internal/fmtsort/sort.go
  • texttemplate/multi_test.go
  • texttemplate/option.go
  • texttemplate/template.go
  • texttemplate/testdata/file1.tmpl
  • texttemplate/testdata/file2.tmpl
  • texttemplate/testdata/tmpl1.tmpl
  • texttemplate/testdata/tmpl2.tmpl
  • texttemplate/values.go
  • texttemplate/values_test.go
  • tmpl/tmpl.go
  • tmpl/tmpl_test.go
  • web/apps/playground/package.json
  • web/apps/playground/plugins/eval-server.ts
  • web/apps/playground/test/viteConfig.test.ts
  • web/apps/playground/vite.config.ts
  • web/package.json

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Nov 1, 2026
@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Benchstat

Base: 98ef53e781df8f56e5c360ddfc82c946f06b2ccd
Head: 595e4d56148269268aa42e13fb3dc326ececfcf1

50 regression(s) detected (threshold: >5%)

Benchmark Metric Base Head Change p-value
Serialize_NoNativeTypes/items=100/native_values=false-4 B/op 3.68e+04 B/op 1.06e+05 B/op +189.53% 0.000
Serialize_NoNativeTypes/items=1000/native_values=false-4 B/op 3.67e+05 B/op 1.06e+06 B/op +187.90% 0.000
Serialize_NoNativeTypes/items=10000/native_values=false-4 B/op 3.68e+06 B/op 1.06e+07 B/op +187.14% 0.000
RunExpressionNativeInput/input=map-4 B/op 808 B/op 1.41e+03 B/op +74.26% 0.000
CELProgramEvaluation/expression=list_optional_regex/optimized=true-4 B/op 740 B/op 1.18e+03 B/op +58.74% 0.000
Serialize_NoNativeTypes/items=10000/native_values=false-4 sec/op 7.26 ms/op 11 ms/op +50.95% 0.000
CELProgramEvaluation/expression=scalar/optimized=false-4 B/op 64 B/op 96 B/op +50.00% 0.000
CELProgramEvaluation/expression=scalar/optimized=true-4 B/op 64 B/op 96 B/op +50.00% 0.000
CELEnvExtend/variables=1/functions=0-4 B/op 3.43e+03 B/op 4.58e+03 B/op +33.57% 0.000
CELEnvExtend/variables=1/functions=0-4 sec/op 3.45 us/op 4.61 us/op +33.40% 0.000
RunExpressionNativeInput/input=map-4 allocs/op 27 allocs/op 36 allocs/op +33.33% 0.000
CELProgramEvaluation/expression=list_optional_regex/optimized=true-4 sec/op 967 ns/op 1.29 us/op +33.07% 0.000
Serialize_NoNativeTypes/items=100/native_values=false-4 allocs/op 1.32e+03 allocs/op 1.72e+03 allocs/op +30.87% 0.000
CELProgramEvaluation/expression=list_optional_regex/optimized=true-4 allocs/op 23 allocs/op 30 allocs/op +30.43% 0.000
Serialize_NoNativeTypes/items=100/native_values=false-4 sec/op 80.8 us/op 105 us/op +29.78% 0.000
Serialize_NoNativeTypes/items=1000/native_values=false-4 allocs/op 1.38e+04 allocs/op 1.78e+04 allocs/op +29.12% 0.000
Serialize_NoNativeTypes/items=10000/native_values=false-4 allocs/op 1.4e+05 allocs/op 1.8e+05 allocs/op +28.62% 0.000
RunExpressionNativeInput/input=native_struct-4 B/op 1e+03 B/op 1.28e+03 B/op +28.00% 0.000
RunExpressionContext/cache=hit/environment=small-4 B/op 664 B/op 840 B/op +26.51% 0.000
CELEnvExtend/variables=10/functions=0-4 sec/op 4.73 us/op 5.9 us/op +24.76% 0.000
CELEnvExtend/variables=10/functions=0-4 B/op 5.15e+03 B/op 6.3e+03 B/op +22.36% 0.000
Serialize_NoNativeTypes/items=1000/native_values=false-4 sec/op 829 us/op 1.01 ms/op +21.89% 0.000
CELEnvExtend/variables=1/functions=0-4 allocs/op 60 allocs/op 72 allocs/op +20.00% 0.000
RunExpressionNativeInput/input=map-4 sec/op 1.9 us/op 2.25 us/op +18.30% 0.001
CELEnvExtend/variables=10/functions=0-4 allocs/op 79 allocs/op 91 allocs/op +15.19% 0.000
CELProgramEvaluation/expression=comprehension/optimized=true-4 B/op 2.5e+03 B/op 2.86e+03 B/op +14.74% 0.000
CELEnvExtendCustomFunction-4 allocs/op 100 allocs/op 112 allocs/op +12.00% 0.000
RunExpressionNativeInput/input=native_struct-4 allocs/op 26 allocs/op 29 allocs/op +11.54% 0.000
RunExpressionNativeInput/input=native_struct-4 sec/op 2.05 us/op 2.27 us/op +10.78% 0.000
CELEnvExtendCustomFunction-4 sec/op 56.1 us/op 62 us/op +10.48% 0.000
RunExpressionContextCompile/cache=miss/environment=small-4 sec/op 223 us/op 245 us/op +10.12% 0.000
CELProgramEvaluation/expression=comprehension/optimized=false-4 B/op 2.89e+03 B/op 3.14e+03 B/op +8.55% 0.000
RunExpressionContextCompile/cache=miss/environment=small-4 B/op 2.08e+05 B/op 2.24e+05 B/op +7.68% 0.000
CELEnvExtend/variables=100/functions=0-4 sec/op 16.2 us/op 17.4 us/op +7.22% 0.000
RunExpressionContextCompile/cache=miss/environment=large-4 B/op 2.1e+05 B/op 2.25e+05 B/op +6.76% 0.000
CELEnvExtend/variables=100/functions=0-4 allocs/op 181 allocs/op 193 allocs/op +6.63% 0.000
CELProgramEvaluation/expression=comprehension/optimized=true-4 allocs/op 82 allocs/op 87 allocs/op +6.10% 0.000
RunExpressionContextCompile/cache=miss/environment=large-4 sec/op 231 us/op 245 us/op +5.86% 0.000
CELEnvExtend/variables=100/functions=0-4 B/op 2.3e+04 B/op 2.42e+04 B/op +5.00% 0.000
RunExpressionContextCompile/cache=miss/environment=small-4 allocs/op 2.26e+03 allocs/op 2.36e+03 allocs/op +4.65% 0.000
Serialize/items=10/native_values=true-4 B/op 3.43e+04 B/op 3.52e+04 B/op +2.56% 0.000
CELEnvExtendCustomFunction-4 B/op 4.63e+04 B/op 4.74e+04 B/op +2.49% 0.000
Serialize/items=10/native_values=true-4 allocs/op 417 allocs/op 424 allocs/op +1.68% 0.000
RunExpressionContextCompile/cache=miss/environment=large-4 allocs/op 2.34e+03 allocs/op 2.37e+03 allocs/op +1.15% 0.000
Serialize/items=100/native_values=true-4 B/op 3.09e+05 B/op 3.12e+05 B/op +0.81% 0.000
Serialize/items=10/native_values=true-4 sec/op 28.7 us/op 28.9 us/op +0.78% 0.027
Serialize/items=1000/native_values=true-4 B/op 3.07e+06 B/op 3.09e+06 B/op +0.56% 0.000
Serialize/items=10000/native_values=true-4 B/op 3.07e+07 B/op 3.09e+07 B/op +0.54% 0.000
Serialize/items=100/native_values=true-4 allocs/op 3.84e+03 allocs/op 3.84e+03 allocs/op +0.18% 0.000
Serialize/items=1000/native_values=true-4 allocs/op 3.95e+04 allocs/op 3.95e+04 allocs/op +0.02% 0.000
19 improvement(s)
Benchmark Metric Base Head Change p-value
RunTemplate_LargeEnv/items=10000-4 sec/op 26.9 ms/op 3.65 us/op -99.99% 0.000
RunTemplate_LargeEnv/items=10000-4 allocs/op 2.63e+05 allocs/op 39 allocs/op -99.99% 0.000
RunTemplate_LargeEnv/items=10000-4 B/op 1.02e+07 B/op 5.4e+03 B/op -99.95% 0.000
RunTemplate_LargeEnv/items=1000-4 allocs/op 2.58e+04 allocs/op 39 allocs/op -99.85% 0.000
RunTemplate_LargeEnv/items=1000-4 sec/op 2.31 ms/op 3.78 us/op -99.84% 0.000
RunTemplate_LargeEnv/items=1000-4 B/op 9.77e+05 B/op 5.4e+03 B/op -99.45% 0.000
RunTemplate_LargeEnv/items=10-4 allocs/op 302 allocs/op 39 allocs/op -87.09% 0.000
RunTemplate_LargeEnv/items=10-4 sec/op 28.7 us/op 3.81 us/op -86.72% 0.000
RunExpressionContext/cache=hit/environment=large-4 sec/op 7.67 us/op 1.4 us/op -81.76% 0.000
RunExpressionContext/cache=hit/environment=large-4 allocs/op 101 allocs/op 23 allocs/op -77.23% 0.000
RunTemplate_LargeEnv/items=10-4 B/op 1.64e+04 B/op 5.4e+03 B/op -67.14% 0.000
RunExpressionContext/cache=hit/environment=large-4 B/op 2.5e+03 B/op 936 B/op -62.62% 0.000
CELProgramEvaluation/expression=list_optional_regex/optimized=false-4 allocs/op 105 allocs/op 79 allocs/op -24.76% 0.000
CELProgramEvaluation/expression=list_optional_regex/optimized=false-4 sec/op 3.83 us/op 3.56 us/op -7.04% 0.000
CELProgramEvaluation/expression=list_optional_regex/optimized=false-4 B/op 4.57e+03 B/op 4.34e+03 B/op -4.95% 0.000
CELProgramEvaluation/expression=scalar/optimized=true-4 sec/op 144 ns/op 137 ns/op -4.25% 0.000
CELProgramEvaluation/expression=scalar/optimized=false-4 sec/op 143 ns/op 138 ns/op -3.94% 0.000
CELProgramEvaluation/expression=comprehension/optimized=false-4 sec/op 4.82 us/op 4.68 us/op -2.89% 0.001
CELProgramEvaluation/expression=comprehension/optimized=false-4 allocs/op 92 allocs/op 91 allocs/op -1.09% 0.000
Full benchstat output
goos: linux
goarch: amd64
cpu: AMD EPYC 9V74 80-Core Processor                
                                                                         │  bench-base.txt  │            bench-head.txt            │
                                                                         │      sec/op      │    sec/op     vs base                │
CELEnvExtendCustomFunction-4                                                   56.10µ ±  1%    61.98µ ± 1%  +10.48% (p=0.000 n=10)
CELProgramEvaluation/expression=scalar/optimized=false-4                       143.2n ±  1%    137.6n ± 0%   -3.94% (p=0.000 n=10)
CELProgramEvaluation/expression=scalar/optimized=true-4                        143.5n ±  3%    137.4n ± 1%   -4.25% (p=0.000 n=10)
CELProgramEvaluation/expression=list_optional_regex/optimized=false-4          3.831µ ±  1%    3.561µ ± 1%   -7.04% (p=0.000 n=10)
CELProgramEvaluation/expression=list_optional_regex/optimized=true-4           966.8n ±  1%   1286.5n ± 1%  +33.07% (p=0.000 n=10)
CELProgramEvaluation/expression=comprehension/optimized=false-4                4.819µ ±  2%    4.679µ ± 1%   -2.89% (p=0.001 n=10)
CELProgramEvaluation/expression=comprehension/optimized=true-4                 4.547µ ±  5%    4.510µ ± 1%        ~ (p=0.138 n=10)
RunExpressionNativeInput/input=map-4                                           1.902µ ±  1%    2.250µ ± 1%  +18.30% (p=0.001 n=10)
RunExpressionNativeInput/input=native_struct-4                                 2.050µ ±  3%    2.272µ ± 1%  +10.78% (p=0.000 n=10)
RunExpressionContext/cache=hit/environment=small-4                             1.286µ ±  1%    1.300µ ± 1%        ~ (p=0.086 n=10)
RunExpressionContext/cache=hit/environment=large-4                             7.675µ ±  1%    1.400µ ± 1%  -81.76% (p=0.000 n=10)
RunExpressionContextCompile/cache=miss/environment=small-4                     222.8µ ±  2%    245.3µ ± 1%  +10.12% (p=0.000 n=10)
RunExpressionContextCompile/cache=miss/environment=large-4                     231.1µ ±  2%    244.7µ ± 1%   +5.86% (p=0.000 n=10)
CELEnvExtend/variables=1/functions=0-4                                         3.454µ ±  2%    4.607µ ± 1%  +33.40% (p=0.000 n=10)
CELEnvExtend/variables=10/functions=0-4                                        4.729µ ±  2%    5.900µ ± 1%  +24.76% (p=0.000 n=10)
CELEnvExtend/variables=100/functions=0-4                                       16.19µ ±  2%    17.36µ ± 1%   +7.22% (p=0.000 n=10)
Serialize/items=10/native_values=true-4                                        28.72µ ±  1%    28.94µ ± 2%   +0.78% (p=0.027 n=10)
Serialize/items=100/native_values=true-4                                       249.2µ ±  1%    248.8µ ± 2%        ~ (p=0.912 n=10)
Serialize/items=1000/native_values=true-4                                      2.506m ±  2%    2.510m ± 2%        ~ (p=0.796 n=10)
Serialize/items=10000/native_values=true-4                                     28.00m ±  2%    28.27m ± 2%        ~ (p=0.247 n=10)
Serialize_NoNativeTypes/items=100/native_values=false-4                        80.76µ ±  1%   104.81µ ± 0%  +29.78% (p=0.000 n=10)
Serialize_NoNativeTypes/items=1000/native_values=false-4                       828.9µ ±  1%   1010.3µ ± 3%  +21.89% (p=0.000 n=10)
Serialize_NoNativeTypes/items=10000/native_values=false-4                      7.257m ±  1%   10.955m ± 3%  +50.95% (p=0.000 n=10)
RunTemplate_LargeEnv/items=10-4                                               28.669µ ±  1%    3.808µ ± 3%  -86.72% (p=0.000 n=10)
RunTemplate_LargeEnv/items=1000-4                                           2310.760µ ±  1%    3.784µ ± 3%  -99.84% (p=0.000 n=10)
RunTemplate_LargeEnv/items=10000-4                                         26856.582µ ± 12%    3.653µ ± 4%  -99.99% (p=0.000 n=10)
RunExpressionContextFunctions/celFunctions/cache=hit/environment=large-4                       3.074µ ± 1%
RunExpressionContextFunctions/functions/cache=hit/environment=large-4                          3.098µ ± 1%
geomean                                                                        35.57µ          16.31µ       -47.89%

                                                                         │ bench-base.txt  │             bench-head.txt             │
                                                                         │      B/op       │     B/op       vs base                 │
CELEnvExtendCustomFunction-4                                                  45.19Ki ± 0%    46.31Ki ± 0%    +2.49% (p=0.000 n=10)
CELProgramEvaluation/expression=scalar/optimized=false-4                        64.00 ± 0%      96.00 ± 0%   +50.00% (p=0.000 n=10)
CELProgramEvaluation/expression=scalar/optimized=true-4                         64.00 ± 0%      96.00 ± 0%   +50.00% (p=0.000 n=10)
CELProgramEvaluation/expression=list_optional_regex/optimized=false-4         4.462Ki ± 0%    4.241Ki ± 0%    -4.95% (p=0.000 n=10)
CELProgramEvaluation/expression=list_optional_regex/optimized=true-4            740.5 ± 0%     1175.5 ± 0%   +58.74% (p=0.000 n=10)
CELProgramEvaluation/expression=comprehension/optimized=false-4               2.822Ki ± 0%    3.063Ki ± 0%    +8.55% (p=0.000 n=10)
CELProgramEvaluation/expression=comprehension/optimized=true-4                2.438Ki ± 0%    2.798Ki ± 0%   +14.74% (p=0.000 n=10)
RunExpressionNativeInput/input=map-4                                            808.0 ± 0%     1408.0 ± 0%   +74.26% (p=0.000 n=10)
RunExpressionNativeInput/input=native_struct-4                                 1000.0 ± 0%     1280.0 ± 0%   +28.00% (p=0.000 n=10)
RunExpressionContext/cache=hit/environment=small-4                              664.0 ± 0%      840.0 ± 0%   +26.51% (p=0.000 n=10)
RunExpressionContext/cache=hit/environment=large-4                             2504.0 ± 0%      936.0 ± 0%   -62.62% (p=0.000 n=10)
RunExpressionContextCompile/cache=miss/environment=small-4                    203.5Ki ± 0%    219.1Ki ± 0%    +7.68% (p=0.000 n=10)
RunExpressionContextCompile/cache=miss/environment=large-4                    205.5Ki ± 0%    219.4Ki ± 0%    +6.76% (p=0.000 n=10)
CELEnvExtend/variables=1/functions=0-4                                        3.352Ki ± 0%    4.477Ki ± 0%   +33.57% (p=0.000 n=10)
CELEnvExtend/variables=10/functions=0-4                                       5.031Ki ± 0%    6.156Ki ± 0%   +22.36% (p=0.000 n=10)
CELEnvExtend/variables=100/functions=0-4                                      22.50Ki ± 0%    23.63Ki ± 0%    +5.00% (p=0.000 n=10)
Serialize/items=10/native_values=true-4                                       33.53Ki ± 0%    34.39Ki ± 0%    +2.56% (p=0.000 n=10)
Serialize/items=100/native_values=true-4                                      302.1Ki ± 0%    304.6Ki ± 0%    +0.81% (p=0.000 n=10)
Serialize/items=1000/native_values=true-4                                     2.929Mi ± 0%    2.946Mi ± 0%    +0.56% (p=0.000 n=10)
Serialize/items=10000/native_values=true-4                                    29.30Mi ± 0%    29.45Mi ± 0%    +0.54% (p=0.000 n=10)
Serialize_NoNativeTypes/items=100/native_values=false-4                       35.91Ki ± 0%   103.96Ki ± 0%  +189.53% (p=0.000 n=10)
Serialize_NoNativeTypes/items=1000/native_values=false-4                      358.1Ki ± 0%   1031.1Ki ± 0%  +187.90% (p=0.000 n=10)
Serialize_NoNativeTypes/items=10000/native_values=false-4                     3.508Mi ± 0%   10.074Mi ± 0%  +187.14% (p=0.000 n=10)
RunTemplate_LargeEnv/items=10-4                                              16.050Ki ± 0%    5.273Ki ± 0%   -67.14% (p=0.000 n=10)
RunTemplate_LargeEnv/items=1000-4                                           953.942Ki ± 0%    5.273Ki ± 0%   -99.45% (p=0.000 n=10)
RunTemplate_LargeEnv/items=10000-4                                         9928.918Ki ± 1%    5.273Ki ± 0%   -99.95% (p=0.000 n=10)
RunExpressionContextFunctions/celFunctions/cache=hit/environment=large-4                      2.297Ki ± 0%
RunExpressionContextFunctions/functions/cache=hit/environment=large-4                         2.359Ki ± 0%
geomean                                                                       23.58Ki         14.79Ki        -27.70%

                                                                         │ bench-base.txt │            bench-head.txt             │
                                                                         │   allocs/op    │  allocs/op   vs base                  │
CELEnvExtendCustomFunction-4                                                   100.0 ± 0%    112.0 ± 0%  +12.00% (p=0.000 n=10)
CELProgramEvaluation/expression=scalar/optimized=false-4                       3.000 ± 0%    3.000 ± 0%        ~ (p=1.000 n=10) ¹
CELProgramEvaluation/expression=scalar/optimized=true-4                        3.000 ± 0%    3.000 ± 0%        ~ (p=1.000 n=10) ¹
CELProgramEvaluation/expression=list_optional_regex/optimized=false-4         105.00 ± 0%    79.00 ± 0%  -24.76% (p=0.000 n=10)
CELProgramEvaluation/expression=list_optional_regex/optimized=true-4           23.00 ± 0%    30.00 ± 0%  +30.43% (p=0.000 n=10)
CELProgramEvaluation/expression=comprehension/optimized=false-4                92.00 ± 0%    91.00 ± 0%   -1.09% (p=0.000 n=10)
CELProgramEvaluation/expression=comprehension/optimized=true-4                 82.00 ± 0%    87.00 ± 0%   +6.10% (p=0.000 n=10)
RunExpressionNativeInput/input=map-4                                           27.00 ± 0%    36.00 ± 0%  +33.33% (p=0.000 n=10)
RunExpressionNativeInput/input=native_struct-4                                 26.00 ± 0%    29.00 ± 0%  +11.54% (p=0.000 n=10)
RunExpressionContext/cache=hit/environment=small-4                             20.00 ± 0%    20.00 ± 0%        ~ (p=1.000 n=10) ¹
RunExpressionContext/cache=hit/environment=large-4                            101.00 ± 0%    23.00 ± 0%  -77.23% (p=0.000 n=10)
RunExpressionContextCompile/cache=miss/environment=small-4                    2.258k ± 0%   2.363k ± 0%   +4.65% (p=0.000 n=10)
RunExpressionContextCompile/cache=miss/environment=large-4                    2.341k ± 0%   2.368k ± 0%   +1.15% (p=0.000 n=10)
CELEnvExtend/variables=1/functions=0-4                                         60.00 ± 0%    72.00 ± 0%  +20.00% (p=0.000 n=10)
CELEnvExtend/variables=10/functions=0-4                                        79.00 ± 0%    91.00 ± 0%  +15.19% (p=0.000 n=10)
CELEnvExtend/variables=100/functions=0-4                                       181.0 ± 0%    193.0 ± 0%   +6.63% (p=0.000 n=10)
Serialize/items=10/native_values=true-4                                        417.0 ± 0%    424.0 ± 0%   +1.68% (p=0.000 n=10)
Serialize/items=100/native_values=true-4                                      3.837k ± 0%   3.844k ± 0%   +0.18% (p=0.000 n=10)
Serialize/items=1000/native_values=true-4                                     39.52k ± 0%   39.53k ± 0%   +0.02% (p=0.000 n=10)
Serialize/items=10000/native_values=true-4                                    399.5k ± 0%   399.5k ± 0%   +0.00% (p=0.000 n=10)
Serialize_NoNativeTypes/items=100/native_values=false-4                       1.315k ± 0%   1.721k ± 0%  +30.87% (p=0.000 n=10)
Serialize_NoNativeTypes/items=1000/native_values=false-4                      13.76k ± 0%   17.77k ± 0%  +29.12% (p=0.000 n=10)
Serialize_NoNativeTypes/items=10000/native_values=false-4                     139.8k ± 0%   179.8k ± 0%  +28.62% (p=0.000 n=10)
RunTemplate_LargeEnv/items=10-4                                               302.00 ± 0%    39.00 ± 0%  -87.09% (p=0.000 n=10)
RunTemplate_LargeEnv/items=1000-4                                           25814.00 ± 0%    39.00 ± 0%  -99.85% (p=0.000 n=10)
RunTemplate_LargeEnv/items=10000-4                                         262913.50 ± 0%    39.00 ± 0%  -99.99% (p=0.000 n=10)
RunExpressionContextFunctions/celFunctions/cache=hit/environment=large-4                     44.00 ± 0%
RunExpressionContextFunctions/functions/cache=hit/environment=large-4                        48.00 ± 0%
geomean                                                                        498.5         228.6       -48.11%
¹ all samples are equal

@socket-security

socket-security Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

@moshloop
moshloop marked this pull request as ready for review November 10, 2026 16:28
Select an available loopback port when the preferred evaluation-server port is occupied, while keeping Vite's proxy aligned with the selected port. Force dependency re-optimization when serving from the sibling clicky-ui source to prevent stale package paths.
…atest releases

Bumps the Go toolchain to 1.26.1 and refreshes direct and indirect modules (flanksource commons and is-healthy, ginkgo, gomega, otel, golang.org/x packages, and others) to newer releases. Removes indirect requirements no longer in the build graph, such as cert-manager, gateway-api, and apiextensions-apiserver. Upgrades @flanksource/clicky-ui in the playground to 0.3.54, which adds @tanstack/react-virtual and country-flag-icons, moves tailwind-merge to v3, and drops tailwindcss v3 from its peer range.
BREAKING CHANGE: import gomplate through github.com/flanksource/gomplate/v4 and CEL types through cel.dev/cel-go. Upgrade CEL to v0.32.0 and update generator templates and language fixtures.

Configure separate main/v4 and 3.x/security release lines and guard downstream v3 updates. Apply verified Go and DOMPurify security fixes and document migration.

Validation: full Go tests, lint, ceval build and smoke, generated-language checks, web typechecks/tests, release analyzer and workflow syntax checks passed. Post-update govulncheck and production pnpm audit are clean.

Known limitation: inherited clicky-ui v0.3.54 exports chat code importing a missing optional ai peer, which blocks the playground production build. Keep this PR as a draft.

Claude-Session-Id: 01a19670-c76b-7953-a4da-f9c1568eb9a2
Serialize previously used alt.Alter, which rewrites the input map in place, so reused environment values (e.g. a *time.Time) were replaced by their decomposed map form after a single expression evaluation. Switching to alt.Decompose keeps the caller's data intact, and adding a ref.Val case ensures CEL values are converted rather than passed through unchanged.
…val mode

Expression results were routed through structpb, so every number widened to float64 and integers beyond 2^53, native typed values and CEL values nested in caller maps lost fidelity. CELValue now unwraps CEL aggregates directly.

The new celvalues package lets Date and Money values compare against strings, timestamps and numbers in either operand position, evaluating each operand once while keeping stock CEL error and unknown semantics intact.

Add groupBy/distinctBy/latestBy/joinBy/one macros plus an exact decimal sum() for string lists to support aggregate checks without JSON round trips, and a Strict template mode whose cached env stays separate from the nil-safe environment.

BREAKING CHANGE: Strict templates no longer get nil-safe operators, environment variables are declared as dyn instead of any, and sum() over a string list returns a decimal string rather than a JSON number.
Money previously supported only comparisons, so templates had to fall back to numbers and lose exactness.

bigdecimal.Money now supports +, -, *, / with numbers and same-currency Money, plus unary negation, keeping the result as Money in the operand's currency; doubles are read via their shortest decimal form so decimal results stay exact.

Multiplying or dividing two Money values, dividing a number by Money, mixing currencies, and any arithmetic on decimal.Money remain errors at evaluation time.

Claude-Session-Id: 5b22303b-86d9-4d5a-969f-fb488a34dccd
… v1.64.0

Pull in latest upstream fixes and transitive decimal dependencies required by the updated commons module.
Refreshes go.sum, dropping stale indirect version entries left over from prior resolution.

Claude-Session-Id: 5b22303b-86d9-4d5a-969f-fb488a34dccd
@moshloop
moshloop force-pushed the gomplate-v4-and-eval-fixes-dmjta83mik4w branch from b268838 to d2d24e0 Compare November 11, 2026 01:10
gojq cannot traverse []byte, so byte slices passed to JQ failed to be queried as JSON documents. Converting bytes to a string before type conversion lets callers pass raw JSON payloads directly instead of pre-converting them. Adds a test covering querying a field from a byte-encoded JSON document.

Claude-Session-Id: 5b22303b-86d9-4d5a-969f-fb488a34dccd
Captured CEL bytes were dropped when reused as inputs, breaking byte equality checks. Keep []byte values only on the CEL serialization path while preserving existing public Serialize behavior.

Claude-Session-Id: 5b22303b-86d9-4d5a-969f-fb488a34dccd
Claude-Session-Id: 5b22303b-86d9-4d5a-969f-fb488a34dccd
Bump the go directive to 1.27.1 and rebuild the build and integration images on golang:1.27-alpine (digest-pinned). Go 1.27 renamed the text/template/parse delimiter constants from leftDelim/rightDelim to defaultLeftDelim/defaultRightDelim, so the template grammar generator now extracts and reads the new names to keep Monarch's Go template delimiters correct. Also lets the hairyhenderson/yaml requirement be folded into the main require block. No behavior change expected beyond the toolchain update.

Claude-Session-Id: 5b22303b-86d9-4d5a-969f-fb488a34dccd
Aligns go.mod and both Docker build images on Go 1.27.4, refreshing the pinned image digest so builds and CI use the same patched toolchain.

Claude-Session-Id: 5b22303b-86d9-4d5a-969f-fb488a34dccd
…l, and collection helpers

Refresh the generated languages/spec artifacts so tooling and editors surface the new
language surface: yaml.encode/parse, json.parse, base64 URL-safe codecs, list
hasAll/hasAny/hasExactly/hasOnly, one(), and the distinctBy/groupBy/joinBy/latestBy macros.
Also adds string conversions for Money/Date types and sum over decimal strings.
These files are build output, so no hand-written logic changed.

Claude-Session-Id: 5b22303b-86d9-4d5a-969f-fb488a34dccd
Expressions now read structs, maps, lists, UUIDs and unsigned integers on demand instead of eagerly serializing the whole environment, so only the fields an expression touches are converted.

Structs are keyed the way encoding/json names them (tags, omitempty, promoted embedded fields, unexported fields absent), and callers' values are left untouched. Registered native types still use cel-go's own type handling.

Adds celvalues.Plain for obtaining the plain Go form of an adapted value, and removes the internal serializeForCEL helper.

Claude-Session-Id: 5b22303b-86d9-4d5a-969f-fb488a34dccd
cel-go v0.33 recompiles every registered overload cost model on each
Env.configure, so every Env.Extend paid ~16us and ~350 allocations for
ext.Strings/Encoders/Lists/Math/Sets cost models that gomplate never uses.

celext is generated from cel-go's ext package by celext/internal/sync
(go generate / make celext) with a gopatch rewrite that routes each
library's cel.CostModel through a per-library opt-out. By default it
behaves exactly like upstream; a parity spec checks declarations,
evaluation and cost estimates against upstream ext, and SourceVersion
fails the build when cel-go is bumped without regenerating.

Claude-Session-Id: 5b22303b-86d9-4d5a-969f-fb488a34dccd
Templates carrying Functions were never cached because a function value
cannot be keyed on, so every call recompiled (~600us, ~2700 allocs).

Add Template.CelFunctions: functions declared with late bindings whose
implementation is supplied per evaluation via cel.FunctionVars, so no
closure lives in the compiled program. Functions are converted to the
same form. The extended environment is cached by its declarations and
the auto program-cache key includes them; CelEnvs stay uncached. A
declared function without an implementation is an error.

Cache hits for function templates drop to ~4us / 44 allocs. The base
environment now uses celext with cost models disabled.

Claude-Session-Id: 5b22303b-86d9-4d5a-969f-fb488a34dccd
Backs the canary-checker docs' Equivalent functions table: each pair
(lowerAscii/toLower, distinct/uniq, math.abs/math.Abs, lists.range/
math.Seq, json/yaml encode and parse, ...) is evaluated on inputs that
show where the two spellings agree or differ.

Claude-Session-Id: 5b22303b-86d9-4d5a-969f-fb488a34dccd
Moves BenchmarkRunExpressionContextFunctions into its own head-only file because CelFunction does not exist on the benchmark base. The benchmark workflow copies only run_expression_bench_test.go into the base worktree, so this keeps base comparisons from failing to compile. No runtime behavior changes.

Gavel-Issue-Id: 1f3832aa-df27-4d44-a135-b404cd7ab226
Claude-Session-Id: e7d00810-447c-45c7-822f-8b1c786c4389
…rovider and nil-safe access

Vendor the Go text/template execution engine as texttemplate, taken from go1.27.4, so gomplate can run templates with a per-execution ValuesProvider and nil-safe field access without changing text/template behavior for callers using Execute or zero ExecuteOptions. Parsing still uses text/template/parse and internal/fmtsort is vendored. Deviations from upstream are tagged gomplate: for future syncs; the additions live in values.go.

Claude-Session-Id: 9cbaec31-655b-4670-a331-adddc1c8c5d2
Go templates previously serialized the whole environment before execution. Now they read values lazily through a ValuesProvider, and only values the template prints, ranges over, tests, or passes to a function are serialized, matching the previous output. Templates can set a custom ValuesProvider, and nil-safe evaluation applies unless Strict is set.

Claude-Session-Id: 9cbaec31-655b-4670-a331-adddc1c8c5d2
Go templates need to read struct fields using the same keys CEL exposes, so the lookup rules live in one place. Field follows encoding/json naming but keeps zero omitempty fields present, and returns false when a promoted field sits behind a nil embedded pointer. The README documents the template behavior.

Claude-Session-Id: 9cbaec31-655b-4670-a331-adddc1c8c5d2
…stom values providers

Document lazy environment access, nil-safe field and index semantics with the Strict option, and how to supply a custom ValuesProvider. Documentation only; no behaviour changes.

Claude-Session-Id: 9cbaec31-655b-4670-a331-adddc1c8c5d2
Claude-Session-Id: 9cbaec31-655b-4670-a331-adddc1c8c5d2
…r iteration

Serialize rewrites its input in place, so the benchmarks now build fresh input untimed each iteration to avoid timing a no-op walk on older bases. The new RunTemplate benchmark reuses one input so it measures lazy template reads, and the benchmark workflow runs it against base and head.

Claude-Session-Id: 9cbaec31-655b-4670-a331-adddc1c8c5d2
@moshloop
moshloop merged commit af2c9bc into main Nov 13, 2026
9 of 12 checks passed
@moshloop
moshloop deleted the gomplate-v4-and-eval-fixes-dmjta83mik4w branch November 13, 2026 04:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build dependencies documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant