-
Notifications
You must be signed in to change notification settings - Fork 72
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
Fixes #27075 - fact names check #267
Conversation
Issues: #27075 |
@mccun934 hey have you got to try it? Any comments? I haven't tried this on instances with some real data, so not sure how is the experience (how fast this is). Shall we aim for 10k default threshold? |
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.
Thank you @lzap for submitting pull-request.
I have added few inline comments.
How about this? Full disclosure - untested :-) |
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.
Few code changes are required to run this check without any failure.
fact_values = 0 | ||
end | ||
assert(fact_values < max, | ||
"Host (ID #{host_id}) has #{fact_values} fact values. This can cause slow fact processing.", |
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.
How about adding max
value in the message so that user will know on what basis it is showing a particular host record?
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.
Done.
@@ -0,0 +1,29 @@ | |||
class Checks::ForemanFactsNames < ForemanMaintain::Check |
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 have a foreman
directory under checks
for foreman specific checks.
To have a consistency, could you move this check under same directory?
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.
host_id = result['host_id'] | ||
fact_values = result['fact_values'] | ||
else | ||
fact_values = 0 |
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.
You can remove else
part here & run assert inside if
.
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
There were the following issues with the commit message:
If you don't have a ticket number, please create an issue in Redmine. More guidelines are available in Coding Standards or on the Foreman wiki. This message was auto-generated by Foreman's prprocessor |
There were the following issues with the commit message:
If you don't have a ticket number, please create an issue in Redmine. More guidelines are available in Coding Standards or on the Foreman wiki. This message was auto-generated by Foreman's prprocessor |
Rebased. |
Thank you @lzap. @mbacovsky, @upadhyeammit, do you have any comments? |
Made her happy. |
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.
LGTM !
Any chance to get this in for 1.24? |
@lzap the PR looks good to merge. As it is just raising warning we can probably merge it without testing on user data which is out of our capacity right now. I'm currently investigating what is causing the test failures. |
@lzap, Once resolved, it's ready to merge. |
515a783
to
e5a6bc2
Compare
Done, cheers. |
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.
Tests are green 🎉
Thank you @lzap for quick update 👍 👌
Tested this check with dummy values not with real user data.
Thank you @mbacovsky, @upadhyeammit for review.
Merging this pull-request.
SSIA please test in real environment with real facts :-)