-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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(pkger): add parser support for notification rules #16297
Conversation
jsteenb2
commented
Dec 19, 2019
•
edited
Loading
edited
- CHANGELOG.md updated with a link to the PR (not the Issue)
- Well-formatted commit messages
- Rebased/mergeable
- Tests pass
8d198ed
to
5986436
Compare
5986436
to
13fd740
Compare
return strings.Title(k.String()) | ||
pieces := strings.Split(string(k), "_") | ||
for i := range pieces { | ||
pieces[i] = strings.Title(pieces[i]) |
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.
heh, didn't know this was in strings
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.
strings
actually has a ton of useful funcs. Has stuff for map
, 'trim`ing, and a boat load of other goodies that come up quite often
if c.statusMessage == "" { | ||
vErrs = append(vErrs, validationErr{ | ||
Field: fieldCheckStatusMessageTemplate, | ||
Msg: `must provide a template; ex. "Check: ${ r._check_name } is: ${ r._level }"`, | ||
}) | ||
} | ||
if status := c.Status(); status != influxdb.Active && status != influxdb.Inactive { |
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.
demorgans law 👍
} | ||
|
||
func (r *notificationRule) Status() influxdb.Status { | ||
if r.status == "" { |
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.
When would status be unset for notification rules?
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.
good question. After speaking with @russorat, we decided that in pkger, you don't have to provide a status, it'll just default to active
if not provided.
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.
got it, that makes sense
tests failing upstream b/c of go vendor issue. This is not related to this PR work. Should not have any affect on any upstream stuffs, no new vendored code here, nor any changes to existing stuffs being used by idpe |