Skip to content

[ES|QL] Displays the available options when editing an existing variable control#239315

Merged
stratoula merged 1 commit intoelastic:mainfrom
stratoula:fix-esql-variables-editing-bug
Oct 16, 2025
Merged

[ES|QL] Displays the available options when editing an existing variable control#239315
stratoula merged 1 commit intoelastic:mainfrom
stratoula:fix-esql-variables-editing-bug

Conversation

@stratoula
Copy link
Contributor

@stratoula stratoula commented Oct 16, 2025

Summary

Regression caused from this PR #231690

When you have an existing control and edit it, the query doesnt run to get the available options. As a result the UX is kinda broken.

Checklist

@stratoula stratoula added Feature:ES|QL ES|QL related features in Kibana Team:ESQL ES|QL related features in Kibana t// v9.2.0 v9.3.0 backport:version Backport to applied version labels labels Oct 16, 2025
@stratoula stratoula changed the title [ES|QL] Runs control query in edit Oct 16, 2025
@stratoula stratoula marked this pull request as ready for review October 16, 2025 11:23
@stratoula stratoula requested a review from a team as a code owner October 16, 2025 11:23
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-esql (Team:ESQL)

@stratoula stratoula enabled auto-merge (squash) October 16, 2025 11:37
Copy link
Contributor

@sddonne sddonne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (only code review)

} else if (valuesRetrieval) {
const queryForValues = `FROM ${getIndexPatternFromESQLQuery(
queryString
)} | STATS BY ${valuesRetrieval}`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be handy to use appendStatsByToQuery? it has some safe wards in case the query already ends with STATS BY.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah it's using getIndexPatternFromESQLQuery, so it will never end with STATS BY

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes different use case

@stratoula stratoula merged commit 84ad1f3 into elastic:main Oct 16, 2025
29 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 9.2

https://github.com/elastic/kibana/actions/runs/18562661269

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 16, 2025
…ble control (elastic#239315)

## Summary

Regression caused from this PR
elastic#231690

When you have an existing control and edit it, the query doesnt run to
get the available options. As a result the UX is kinda broken.

### Checklist

- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

(cherry picked from commit 84ad1f3)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
9.2

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Oct 17, 2025
… variable control (#239315) (#239350)

# Backport

This will backport the following commits from `main` to `9.2`:
- [[ES|QL] Displays the available options when editing an existing
variable control
(#239315)](#239315)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT
[{"author":{"name":"Stratou","email":"efstratia.kalafateli@elastic.co"},"sourceCommit":{"committedDate":"2025-10-16T13:19:40Z","message":"[ES|QL]
Displays the available options when editing an existing variable control
(#239315)\n\n## Summary\n\nRegression caused from this
PR\nhttps://github.com//pull/231690\n\nWhen you have an
existing control and edit it, the query doesnt run to\nget the available
options. As a result the UX is kinda broken.\n\n### Checklist\n\n- [ ]
[Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common
scenarios","sha":"84ad1f31553c96fd09f9baa8bc74ba6a6a17eea6","branchLabelMapping":{"^v9.3.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["regression","release_note:fix","Feature:ES|QL","Team:ESQL","backport:version","v9.2.0","v9.3.0"],"title":"[ES|QL]
Displays the available options when editing an existing variable
control","number":239315,"url":"https://github.com/elastic/kibana/pull/239315","mergeCommit":{"message":"[ES|QL]
Displays the available options when editing an existing variable control
(#239315)\n\n## Summary\n\nRegression caused from this
PR\nhttps://github.com//pull/231690\n\nWhen you have an
existing control and edit it, the query doesnt run to\nget the available
options. As a result the UX is kinda broken.\n\n### Checklist\n\n- [ ]
[Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common
scenarios","sha":"84ad1f31553c96fd09f9baa8bc74ba6a6a17eea6"}},"sourceBranch":"main","suggestedTargetBranches":["9.2"],"targetPullRequestStates":[{"branch":"9.2","label":"v9.2.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.3.0","branchLabelMappingKey":"^v9.3.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/239315","number":239315,"mergeCommit":{"message":"[ES|QL]
Displays the available options when editing an existing variable control
(#239315)\n\n## Summary\n\nRegression caused from this
PR\nhttps://github.com//pull/231690\n\nWhen you have an
existing control and edit it, the query doesnt run to\nget the available
options. As a result the UX is kinda broken.\n\n### Checklist\n\n- [ ]
[Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common
scenarios","sha":"84ad1f31553c96fd09f9baa8bc74ba6a6a17eea6"}}]}]
BACKPORT-->

Co-authored-by: Stratou <efstratia.kalafateli@elastic.co>
nickpeihl pushed a commit to nickpeihl/kibana that referenced this pull request Oct 23, 2025
…ble control (elastic#239315)

## Summary

Regression caused from this PR
elastic#231690

When you have an existing control and edit it, the query doesnt run to
get the available options. As a result the UX is kinda broken.

### Checklist

- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
NicholasPeretti pushed a commit to NicholasPeretti/kibana that referenced this pull request Oct 27, 2025
…ble control (elastic#239315)

## Summary

Regression caused from this PR
elastic#231690

When you have an existing control and edit it, the query doesnt run to
get the available options. As a result the UX is kinda broken.

### Checklist

- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels Feature:ES|QL ES|QL related features in Kibana regression release_note:fix Team:ESQL ES|QL related features in Kibana t// v9.2.0 v9.3.0

5 participants