-
Notifications
You must be signed in to change notification settings - Fork 14
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
(CONT-675) Fix fact detection #96
Conversation
9e304eb
to
05aa8f6
Compare
05aa8f6
to
e3815ce
Compare
end | ||
|
||
it 'uses the facts hash' do | ||
expect(manifest).to eq("$facts['os']['family']") |
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.
in the future we should consider reworking the legacy_fact/topscope_fact/topscope_variable check because they heavily overlap.
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.
would it make sense to add some tests from https://github.com/puppetlabs/puppet-lint/blob/e3815cebdfa50100acb888e29fde8f03f4e1879b/spec/unit/puppet-lint/plugins/top_scope_facts/top_scope_facts_spec.rb here? But expect no changes? I want to prevent that legacy_fact and topscope_fact fix the same code.
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 was looking in to this yesterday. It would seem that they no longer clash but adding extra tests is never a bad thing.
Prior to this change the legacy facts check would not detect legacy facts defined as follows: ``` $::facts['osfamily'] ```` This changes updates the `check` logic to evaluate tokens that may start with `::` and extract the fact name as appropriate. `
e3815ce
to
a3b7241
Compare
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.
looks good. Tested locally and works as expetced
Prior to this change the legacy facts check would not detect legacy facts defined as follows:
This changes updates the
check
logic to evaluate tokens that may start with::
and extract the fact name as appropriate. `