-
Notifications
You must be signed in to change notification settings - Fork 43
Fix dashboard create (copy, from file) #68
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't we need the scope validation logic anymore?
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.
If you look at the old code, it seems that the logic assumes that the scope string is always a list of and
ed 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! |
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.
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. |