Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes Pipeline Rule Builder failures when numeric condition values exceed 999 by preventing Freemarker locale-specific thousand separators from being inserted into generated rule source and condition/action titles.
Changes:
- Configure Rule Builder Freemarker
Configurationinstances to usenumberFormat("computer")(no thousand separators). - Add regression tests ensuring generated fragments and titles for values > 999 contain no separators.
- Add an unreleased changelog entry for the fix.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
graylog2-server/src/main/java/org/graylog/plugins/pipelineprocessor/rulebuilder/parser/RuleBuilderService.java |
Sets Freemarker number format to computer for title template rendering. |
graylog2-server/src/main/java/org/graylog/plugins/pipelineprocessor/rulebuilder/RuleBuilderRegistry.java |
Sets Freemarker number format to computer for fragment template rendering used in rule source generation. |
graylog2-server/src/test/java/org/graylog/plugins/pipelineprocessor/rulebuilder/parser/ParserUtilTest.java |
Adds config + test asserting fragment rendering doesn’t introduce thousand separators for large numbers. |
graylog2-server/src/test/java/org/graylog/plugins/pipelineprocessor/rulebuilder/parser/RuleBuilderServiceTest.java |
Adds test asserting title rendering doesn’t introduce thousand separators for large numbers. |
changelog/unreleased/issue-23541.toml |
Adds release note entry for issue #23541. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Resolves #23541
Description
Details
The SecureFreemarkerConfigProvider is a Guice Provider that acts as a factory — each call to get() returns a new Configuration instance. This is a deliberate design choice: different consumers (rule builder, email templates, etc.) can customize their instance without affecting others. That's why the fix is safe — setting numberFormat("computer") on the rule builder's instance doesn't change how email templates format numbers.
The two separate Configurations matter: RuleBuilderRegistry owns the config for generating rule source code (fragment templates like to_long($message.$ {field}) <= ${fieldValue}). RuleBuilderService owns a separate config for generating display titles (like Field 'bytes' greater than or equal '10000'). Both needed the fix independently because they create their own Configuration instances from SecureFreemarkerConfigProvider.get().
Test
Types of changes
Checklist: