-
Notifications
You must be signed in to change notification settings - Fork 37
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
feat: Description fetched from ontap docs via cli #2454
Conversation
if strings.Contains(expr, "/") || strings.Contains(expr, "*") || strings.Contains(expr, "+") || strings.Contains(expr, "-") { | ||
// This indicates expressions with arithmetic operations, After adding appropriate description, this will be uncommented. | ||
//t.Errorf(`dashboard=%s panel="%s" has many expressions`, dashPath, value.Get("title").String()) | ||
fmt.Printf(`dashboard=%s panel="%s" has many expressions \n`, dashPath, title) |
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.
we want t.errorf and not fmt.
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.
yes, those are the cases for category 2 and 3.
t.errorf will be uncommented after the implementation of them later, else it will error out.
} else { | ||
// This indicates table/timeseries with more than 1 expressions, After deciding next steps, this will be uncommented. | ||
//t.Errorf(`dashboard=%s panel="%s" has many expressions`, dashPath, value.Get("title").String()) | ||
fmt.Printf(`dashboard=%s panel="%s" has many expressions \n`, dashPath, title) |
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.
we want t.errorf and not fmt.
func VisitAllPanels(data []byte, handle func(path string, key gjson.Result, value gjson.Result)) { | ||
visitPanels(data, "panels", "", handle) | ||
} | ||
|
||
func visitPanels(data []byte, panelPath string, pathPrefix string, handle func(path string, key gjson.Result, value gjson.Result)) { |
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.
Why do we want to move these methods here? See if you can keep them in original file.
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.
Earlier it was in dashboard_test.go file, and need to use in other non-test files as well.
Thought would be non-test file should not use the method from test class, whereas reverse would be fine.
Added hidden cli in generate, which would fetched metrics details from ontap and update the map of description with panels and later update the dashboards from the map.
Note: This is applicable only for category 1 where panel contains only 1 expression.