-
Notifications
You must be signed in to change notification settings - Fork 576
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
Fix persistent comments for Acknowledgements #4956
Fix persistent comments for Acknowledgements #4956
Conversation
Note: I used the same way of setting the bool persistent / false as commented earlier as is already used for the ApiAction::ScheduleDowntime command. |
lib/icinga/apiactions.cpp
Outdated
@@ -200,7 +200,7 @@ Dictionary::Ptr ApiActions::AcknowledgeProblem(const ConfigObject::Ptr& object, | |||
if (params->Contains("sticky")) | |||
sticky = AcknowledgementSticky; |
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.
That should check for a boolean, not just for the attribute being set.
Similar fix to be applied: 8196523
if (params->Contains("sticky") && HttpUtility::GetLastParameter(params, "sticky"))
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.
Updated to convert the number to bool properly.
56a7e93
to
848de5c
Compare
Can you remove the unnecessary explicit '== true', '> 0', etc. checks? Also, aren't all non-persistent comments in Icinga 1.x removed on restart (by virtue of not being persisted at all)? Your patch seems to not remove expired comments at all if they're persistent. Is that the correct behavior? |
848de5c
to
6a7f677
Compare
The naming with |
Right on the updated documentation, I see it now when you point out the ambiguity.
So remove the document update and squash commits?
Anything else?
… Den 10. feb. 2017 kl. 09.10 skrev Michael Friedrich ***@***.***>:
The naming with persistent just for acknowledgement comments is somewhat ambiguous. For "normal" comments there's no exact meaning, you cannot change or tell anything. Comments of the type Acknowledgement will only require an additional state to determine whether the comment is being deleted upon ack removal or not.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Squashing would certainly help an additional review, not sure about the docs. I would opt for finding a better name for |
a1754ba
to
1f55cd9
Compare
Updated, let me know if I didnt do it correctly. :-) |
e8c9a44
to
e492539
Compare
Rebased based on master, there was a conflict with doc and apiactions after an update to notify. |
1604657
to
99cea7b
Compare
Feedback from @dnsmichi is that he does not like the proposed name of comment_persistance. Other suggestions:
I'd really like to see this in 2.7 as the bug causes us a lot of headaches when comments from acknowledgements disappear with ticket numbers that was the comment for the ack. |
fixes Icinga#4818 Signed-off-by: Michael Friedrich <michael.friedrich@icinga.com>
99cea7b
to
273ca6a
Compare
ReviewI don't have a better name. I'd go with the same name as known from 1.x and external commands, just The docs should be clear about that, and if one tends to fetch the values from i.e. the API, he/she needs to be sure to check In terms of upgrade safety, one would say, I wouldn't change that behaviour and leave your patch as is. PatchI've modified some code parts following our code style, and removed a duplicate check. Rebased against master and amended my changes into your commit. If've also taken the liberty of force pushing your remote branch to cleanly merge this PR. Sorry for keeping this so long on my TODO list. I wanted to make sure I've fully understand your concern and proposed patch. The description with ticket ids in comments totally make sense to me now. Thanks for the patch 👍 TestsNon-persistentAdd
Remove
PersistentAdd
Remove
All fine ❤️ Icinga Web 2Keep in mind that Icinga Web 2 doesn't send the I haven't tested the patch, but it should work. Maybe you can test that and send in a PR for Icinga Web 2 then :)
|
@lippserd see my note about the Icinga Web 2 API command transport :) |
refs #4818