[FR] [DaC] Add fine-grained bypass env var for ES|QL keep and metadata validation#5869
Open
eric-forte-elastic wants to merge 7 commits intomainfrom
Open
Conversation
Contributor
Enhancement - GuidelinesThese guidelines serve as a reminder set of considerations when addressing adding a feature to the code. Documentation and Context
Code Standards and Practices
Testing
Additional Checks
|
keep validationkeep validation and metadata
keep validation and metadatakeep and metadata validation
Mikaayenson
approved these changes
Mar 23, 2026
Contributor
Mikaayenson
left a comment
There was a problem hiding this comment.
lgtm w/unit test and ci passing.
q: any thoughts on adding a param to the config?
Contributor
Author
I think this is a good idea, will add shortly. I expect many users will want to bypass this. Will also add the other bypass env vars to the config as well, so that they can be used in a more fine grain way. |
Contributor
Author
terrancedejesus
approved these changes
Mar 24, 2026
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.

Pull Request
Issue link(s): Resolves #5868
Related to: elastic/DaC-Reference#53
Summary - What I changed
Introduces a fine-grained environment variable to skip only the local ES|QL
keepvalidation inESQLRuleData.validates_esql_data(presence of| keepand_id/_version/_indexinkeepfor non-aggregate queries). Other checks in that method (for exampleFROM … METADATAfor non-aggregate queries) also now can be bypassed.The variable is included in
set_all_validation_bypass(), sobypass_optional_elastic_validation: truein_config.yamlalso enables this bypass.How To Test
Run the Unit Tests or test with a single rule.
Example:
source env/detection-rules-build/bin/activate python -m pytest tests/test_schemas.py::TestESQLValidation -v --tb=shortOr, a single rule test:
Checklist
bug,enhancement,schema,maintenance,Rule: New,Rule: Deprecation,Rule: Tuning,Hunt: New, orHunt: Tuningso guidelines can be generatedmeta:rapid-mergelabel if planning to merge within 24 hoursContributor checklist