-
Notifications
You must be signed in to change notification settings - Fork 1k
Fixes #38930 - Make fact parsers use proper os #10789
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
base: develop
Are you sure you want to change the base?
Fixes #38930 - Make fact parsers use proper os #10789
Conversation
ekohl
left a comment
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.
I didn't mean to do a review, but this caught my eye. So take my comments here as suggestions.
Looking at the failed tests I think we're using assert_equal in the wrong order, leading to confusing errors. Not a blocker.
But the failing tests do look related so please have a look.
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 already have FacterDB as a dependency which contains these kinds of fact sets. Is it possible to reuse that? I see others use static files so don't consider this blocking.
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.
I see there is a warning under the hood of FacterDB:
./home/vagrant/foreman/.vendor/ruby/3.0.0/gems/jgrep-1.5.4/lib/jgrep.rb:27: warning: detected duplicate key "osfamily" in JSON object. This will raise an error in json 3.0 unless enabled via `allow_duplicate_key: true` at line 86377 column 2
/home/vagrant/foreman/.vendor/ruby/3.0.0/gems/jgrep-1.5.4/lib/jgrep.rb:27: warning: detected duplicate key "fqdn" in JSON object. This will raise an error in json 3.0 unless enabled via `allow_duplicate_key: true` at line 197772 column 2
/home/vagrant/foreman/.vendor/ruby/3.0.0/gems/jgrep-1.5.4/lib/jgrep.rb:27: warning: detected duplicate key "hostname" in JSON object. This will raise an error in json 3.0 unless enabled via `allow_duplicate_key: true` at line 402388 column 2
It is not problematic yet, but I preferred not to mess with external dependency.
5a2c434 to
65dacac
Compare
65dacac to
8fa0cfa
Compare
|
Fixed the original errors that @ekohl was referring to. The new errors seem trickier, since they do not appear in my local environment. |
|
[test] |
bf74f09 to
1f1517b
Compare
|
Found out that the errors came from newer gem version in the CI. Updated the gem versions locally and the errors appeared for me too. I have fixed the issue by forcing facterdb to load only the files that are relevant to the checks we perform. Luckily those files were OK, and the tests could run successfully. |
Make sure the fact parser searches by all unique constraint combinations before creating a new object.
1f1517b to
99ebc5c
Compare
|
Did you file an issue for the broken files? |
We're using an antique version of facterdb gem. In the newer versions of the gem we don't have older facter versions of the data, so I didn't test our code against the newer facterdb. If we want to file a ticket, it would not make sense to file it against v1.27 when v4.0 is already out. |
Make sure the fact parser searches by all unique constraint combinations before creating a new object.