Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Console Monaco Migration] Fix variable replacement #188994

Merged

Conversation

ElenaStoeva
Copy link
Contributor

@ElenaStoeva ElenaStoeva commented Jul 23, 2024

Fixes #185999

Summary

This PR fixes the variable replacement when the variable contains an object value .

How to test:

  1. Go to Console and create the following variables:
    var1: {"match_all": {}}
    var2: index
    var3: match_all
  2. Test using an object variable inside the request data:
GET _search
{
  "query": "${var1}"
}

should be sent as query: {match_all: {}} in the payload.
3. Test using a variable in the URL:
PUT /test-${var2} should be sent as PUT /test-index in the payload.
4. Test using a string variable in the request data:

GET _search
{
  "query": {
    "${var3}": {}
  }
}

should be sent as query: {match_all: {}} in the payload.
5. Test using undefined variables:

GET _search
{
  "query": {
    "${var4}": {}
  }
}

or PUT /test-${var5}
Both should be sent as they are.

@ElenaStoeva ElenaStoeva added Feature:Console Dev Tools Console Feature Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more release_note:skip Skip the PR/issue when compiling release notes labels Jul 23, 2024
@ElenaStoeva ElenaStoeva self-assigned this Jul 23, 2024
@ElenaStoeva ElenaStoeva marked this pull request as ready for review July 24, 2024 09:56
@ElenaStoeva ElenaStoeva requested a review from a team as a code owner July 24, 2024 09:56
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-management (Team:Kibana Management)

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
console 457.2KB 457.3KB +99.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @ElenaStoeva

@yuliacech yuliacech self-requested a review July 26, 2024 14:31
Copy link
Contributor

@yuliacech yuliacech left a comment

Choose a reason for hiding this comment

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

Thanks a lot for fixing this bug, @ElenaStoeva! Verified locally

@ElenaStoeva ElenaStoeva merged commit 7e5907e into elastic:main Jul 26, 2024
19 checks passed
@ElenaStoeva ElenaStoeva deleted the console/fix-variable-replacement branch July 26, 2024 15:42
@kibanamachine kibanamachine added v8.16.0 backport:skip This commit does not require backporting labels Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:Console Dev Tools Console Feature release_note:skip Skip the PR/issue when compiling release notes Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more v8.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Console Monaco migration] Variables in request body
5 participants