[fix] allow long threshold expr when binding many monitors - #4330
Open
orangeCatDeveloper wants to merge 1 commit into
Open
[fix] allow long threshold expr when binding many monitors#4330orangeCatDeveloper wants to merge 1 commit into
orangeCatDeveloper wants to merge 1 commit into
Conversation
orangeCatDeveloper
force-pushed
the
fix/issue-4171-expr-length
branch
from
August 17, 2026 12:13
a5a8100 to
b31d988
Compare
Binding monitors appends an equals(__instance__, ...) clause per monitor to the threshold expr, so the 2048-char limit capped bindings at ~30. Widen expr to a lob with a 65535 validation cap (V182).
orangeCatDeveloper
force-pushed
the
fix/issue-4171-expr-length
branch
from
August 18, 2026 06:22
b31d988 to
69547ff
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4171
Binding more than ~30 monitors to one alert rule fails with a validation error, because each bound monitor appends an
equals(__instance__, "...")clause (~65 chars) to the thresholdexpr, and the field was capped at 2048 characters — 2048 / 65 ≈ 30 bindings.The fix widens
AlertDefine.exprfrom@Size(2048)/@Column(2048)to@Lobwith a@Size(65535)validation cap — the same pattern the codebase already uses forNoticeTemplate.content. MigrationV182alters the column on all three vendors (mysqllongtextwith an INFORMATION_SCHEMA idempotency guard matching V172/V180, postgresqlTEXT, h2CLOB); widening is lossless for existing rows. The custom validation message was deliberately dropped so the default hibernate-validator message stays localized.Backward compatible: previously valid input remains valid, the new 65535 cap still rejects runaway payloads, and
expris admin-authored config so no new trust boundary.Verified end-to-end against a real backend (fresh H2,
Successfully applied 7 migrations ... now at version v182):