Conversation
…olean Reorder `schema.oneOf` in `SimplifiedVarsSchema` so `schema.string()` is matched before `schema.boolean()`, preventing string values like "true" and "false" from being coerced to booleans. Adds unit tests to cover this behavior. Made-with: Cursor
Contributor
|
Pinging @elastic/fleet (Team:Fleet) |
florent-leborgne
approved these changes
Mar 4, 2026
Contributor
|
Starting backport for target branches: 8.19, 9.2, 9.3 https://github.com/elastic/kibana/actions/runs/22682448218 |
Contributor
💚 Build Succeeded
Metrics [docs]
History
cc @nchaulet |
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this pull request
Mar 4, 2026
…olean (elastic#256047) (cherry picked from commit cd7eb3d)
Contributor
💔 Some backports could not be created
Note: Successful backport PRs will be merged automatically after passing CI. Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
Member
Author
|
Only backported to 9.3 as the code is too different in 8.19 |
kibanamachine
added a commit
that referenced
this pull request
Mar 4, 2026
… to boolean (#256047) (#256069) # Backport This will backport the following commits from `main` to `9.3`: - [[Fleet] Fix SimplifiedVarsSchema coercing string "true"/"false" to boolean (#256047)](#256047) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Nicolas Chaulet","email":"nicolas.chaulet@elastic.co"},"sourceCommit":{"committedDate":"2026-03-04T18:03:13Z","message":"[Fleet] Fix SimplifiedVarsSchema coercing string \"true\"/\"false\" to boolean (#256047)","sha":"cd7eb3dbf9ab0e6bbe0dc0aa9a4e8300f7ac38a8","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","backport:version","v9.4.0","v8.19.13","v9.2.7","v9.3.2"],"title":"[Fleet] Fix SimplifiedVarsSchema coercing string \"true\"/\"false\" to boolean","number":256047,"url":"https://github.com/elastic/kibana/pull/256047","mergeCommit":{"message":"[Fleet] Fix SimplifiedVarsSchema coercing string \"true\"/\"false\" to boolean (#256047)","sha":"cd7eb3dbf9ab0e6bbe0dc0aa9a4e8300f7ac38a8"}},"sourceBranch":"main","suggestedTargetBranches":["8.19","9.2","9.3"],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/256047","number":256047,"mergeCommit":{"message":"[Fleet] Fix SimplifiedVarsSchema coercing string \"true\"/\"false\" to boolean (#256047)","sha":"cd7eb3dbf9ab0e6bbe0dc0aa9a4e8300f7ac38a8"}},{"branch":"8.19","label":"v8.19.13","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.2","label":"v9.2.7","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.3","label":"v9.3.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> --------- Co-authored-by: Nicolas Chaulet <nicolas.chaulet@elastic.co>
SoniaSanzV
pushed a commit
to SoniaSanzV/kibana
that referenced
this pull request
Mar 5, 2026
rbrtj
pushed a commit
to rbrtj/kibana
that referenced
this pull request
Mar 5, 2026
DennisKo
pushed a commit
to DennisKo/kibana
that referenced
this pull request
Mar 6, 2026
qn895
pushed a commit
to qn895/kibana
that referenced
this pull request
Mar 11, 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.
Description
Resolve #255976
Fix SimplifiedVarsSchema coercing string variable values like "true" and "false" to booleans.
The
schema.oneOfvalidator matches the first passing schema in order. Previouslyschema.boolean()came beforeschema.string(),causing string values of "true"/"false" to be coerced to boolean true/false. This reorders the validators soschema.string()is tried first.Tests
Added unit tests for SimplifiedVarsSchema
You can try to use the package policy API to pass "true" in a select variable