Fix dashboard create (copy, from file)#68
Conversation
davideschiera
commented
Jan 9, 2019
- Scope is expected to be a string (no longer an object)
- Public sharing is disabled
- Old grouping configuration and scope support removed
- Patch dashboard format to fix UI custom scope warning
1. Scope is expected to be a string (no longer an object) 2. Public sharing is disabled 3. Old grouping configuration and scope support removed 4. Patch dashboard format to fix UI custom scope warning
| for sentry in scope: | ||
| baseconfid = baseconfid + str(list(sentry.keys())[0]) | ||
| baseconfid = baseconfid + str(list(sentry.values())[0]) | ||
| def create_dashboard_from_template(self, dashboard_name, template, scope, shared=False, annotations={}): |
There was a problem hiding this comment.
don't we need the scope validation logic anymore?
There was a problem hiding this comment.
If you look at the old code, it seems that the logic assumes that the scope string is always a list of anded expressions, each with = operator. Also, the logic was then applied to use the obsolete JSON structure for the filter.
I trust the backend validation more than this obsolete logic.
|
@nagsubram @alexgallotta how does this PR look? Thanks! |
nagsubram
left a comment
There was a problem hiding this comment.
Pls confirm that you tested the modified script and copying dashboard works correctly.
|
If I'm not mistaken, the function I changed is used by 3 API functions: I tested the one used by the example "copy dashboard", and it was working properly. I expect the other 2 functions to work fine as well. |