Apply ingestion Groovy policy consistently - #19235
Open
xiangfu0 wants to merge 1 commit into
Open
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #19235 +/- ##
============================================
+ Coverage 66.97% 67.03% +0.06%
- Complexity 1423 1432 +9
============================================
Files 3453 3457 +4
Lines 218936 219292 +356
Branches 34802 34843 +41
============================================
+ Hits 146638 147011 +373
+ Misses 60588 60570 -18
- Partials 11710 11711 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
xiangfu0
force-pushed
the
xiangfu0/schema-field-groovy-policy
branch
2 times, most recently
from
August 14, 2026 05:02
3f7c3a2 to
29dc265
Compare
xiangfu0
force-pushed
the
xiangfu0/schema-field-groovy-policy
branch
from
August 14, 2026 06:18
29dc265 to
48b62ca
Compare
xiangfu0
requested review from
Jackie-Jiang,
deepthi912,
noob-se7en and
yashmayya
August 14, 2026 06:18
Schema FieldSpec transforms bypassed the existing ingestion Groovy policy during validation and runtime evaluator construction. Centralize the policy and propagate it through server and segment-generation paths so persisted schemas fail closed when Groovy is disabled.
xiangfu0
force-pushed
the
xiangfu0/schema-field-groovy-policy
branch
from
August 14, 2026 08:29
48b62ca to
c15263a
Compare
xiangfu0
marked this pull request as ready for review
August 14, 2026 08:32
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.
Summary
Root cause
The existing ingestion Groovy setting was enforced for table-config validation, but schema FieldSpec validation and several runtime evaluator-construction paths did not receive or apply the same policy. A schema persisted by an older deployment could therefore also reach ingestion-time evaluator construction without the controller-side check.
This change makes evaluator construction the common enforcement boundary and retains explicit checks at validation and runtime call sites as defense in depth.
How to reproduce
controller.disable.ingestion.groovyunset, which uses the disabled default.falsepreserves the existing opt-in behavior.Behavior
controller.disable.ingestion.groovy=falseenables ingestion Groovy.Rolling upgrade and rollback
Upgrade an API-serving controller before servers and minions. The first API-serving controller atomically publishes the resolved policy to the cluster config; once present, that cluster value is authoritative for controller, server, and minion processes.
For a legacy cluster where ingestion Groovy is intentionally enabled, configure API-serving controllers consistently with
controller.disable.ingestion.groovy=falsebefore upgrading them. If a new server or minion must start before an upgraded controller publishes the cluster value, temporarily configure the same explicit opt-in on that instance. An unconfigured new runtime process fails closed while the cluster value is absent.Coordinate later policy changes through the cluster configuration before restarting services. Rolling back runtime roles removes the new defense-in-depth enforcement from those older processes, so keep the cluster policy consistent and verify persisted schemas before rollback.
SPI compatibility
This change adds an immutable
IngestionGroovyPolicyvalue and aRecordEnricherCreationContextfor policy-aware enricher construction.RecordEnricherFactoryretains the existing creation method; the new context-aware overload delegates to it by default, and the new security-policy hook is also a default method. Existing enricher implementations therefore require no source changes, while policy-sensitive implementations can opt into the new context and validation hook.Test coverage
Targeted tests cover:
Affected-module formatting, checkstyle, license-format, and license checks pass. The JDK 25 warning-enabled affected-module compile passes with
-Xlint:all,-deprecation.The exact JDK 25
-Xlint:allinvocation remains blocked on current master becausezstd-jnireferences its provided JetBrains@NotNulldependency from the unchangedZstandardDecompressorsource.Scope
This change does not alter authorization actions or query-time Groovy policy. This PR is ready for coordinated review.