-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
[Monitoring] Fix rison error #83987
Merged
chrisronline
merged 2 commits into
elastic:master
from
chrisronline:monitoring/rison_Fix
Nov 25, 2020
Merged
[Monitoring] Fix rison error #83987
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically rison should already cast strings for us, I don't know why we even have to do this
But if we must, we should first check to see if it's already wrapped in quotes (or, you'll keep adding quotes to the value over and over again). So we should also add the following checks like this:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where are you seeing the double quotes happening? I'm trying to reproduce it locally but can't seem to find the right UI flow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is an example: https://demo.elastic.co/app/monitoring#/home
...(cluster_uuid:C7AppFTyQfWdUL3ldutLjQ,
...(cluster_uuid:'0f0rwRiWTjaJPTrORm4PoA',
Since, we don't take "checking first" into account we run the risk of adding unwanted quotes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I'm a little confused sorry. Why are you testing this PR on the demo site? Are you connecting your local Kibana instance to that cluster or something?
Locally, with two clusters setup, I get from clicking on one cluster:
https://localhost:5601/app/monitoring#/overview?_g=(ccs:Monitoring,cluster_uuid:'1sO4J1fWQEq8AU628IoBGw',refreshInterval:(pause:!t,value:10000),time:(from:now-1h,to:now))
Then, I see https://localhost:5601/app/monitoring#/overview?_g=(refreshInterval:(pause:!t,value:10000),time:(from:now-1h,to:now),cluster_uuid:'TpRkL2e-QVaJisp084RwzQ') when clicking the other.
I can see in the code how we could be double quoting it, but I can't seem to find the use case of it actually happening (so I can verify the fix works)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see it now "globalState" here is not actually the globalState we're use to, more of a way to override parameters (since we only use it in one place).
In which case, why not just pass the following cluster_uuid already as a quoted string here:
kibana/x-pack/plugins/monitoring/public/components/cluster/listing/listing.js
Line 82 in 3f97872
This way we don't have to check which key is which and how to cast it.
Might be more of nit/preference on my end, so I'm fine if you decide to keep it. Let me know and I'll approve it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough. I worry that requiring the consumer to provide the
'
will lead to us forgetting to do that. I'm not sure if there is a better way right now though.