-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Refactor #15
base: master
Are you sure you want to change the base?
Refactor #15
Conversation
f5d2ce8
to
97a6fca
Compare
@@ -1,2 +1,4 @@ | |||
Style/TrailingCommaInLiteral: |
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.
Opened voxpupuli/voxpupuli-test#31 as I think that's where this file is now managed.
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.
This is merged, though not sure about the release process for that gem. Anyhow, this should probably stay in the commit as it will just get overwritten in the next sync and keep doing the same thing.
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.
🙋🏻♀️
if $manage_yarn { | ||
yumrepo { 'yarn': | ||
ensure => 'present', | ||
baseurl => 'https://dl.yarnpkg.com/rpm/', |
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 is this supposed to work for non-rpm systems?
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.
The module only supports EL7
is_expected.to contain_file('/opt/hyperglass').with( | ||
{ | ||
'ensure' => 'directory', | ||
'owner' => 'root', | ||
'group' => 'root', | ||
'mode' => '0755', | ||
} | ||
) |
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 generally like chaining more. It's compacter and also works nicely if you add other lines like .that_requires()
is_expected.to contain_file('/opt/hyperglass').with( | |
{ | |
'ensure' => 'directory', | |
'owner' => 'root', | |
'group' => 'root', | |
'mode' => '0755', | |
} | |
) | |
is_expected.to contain_file('/opt/hyperglass'). | |
with_ensure('directory'). | |
with_owner('root'). | |
with_group('root'). | |
with_mode('0755') |
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 disagree, mostly because I can copy/paste from the actual code and write the tests faster. I did leave the .with_this and .with_that for lines that were not too long.
I'm not a big fan of throwing most of the resources into a single class. From the official style guide:
|
'owner' => 'hyperglass-agent', | ||
'group' => 'hyperglass-agent', | ||
'mode' => '0700', | ||
'notify' => 'Systemd::Unit_file[hyperglass-agent.service]', |
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.
Better to use the relationship matchers. https://github.com/rodjek/rspec-puppet#relationship-matchers
The tests will continue to work if the way the relationships are defined are ever refactored.
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's a great idea!
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.
Used those where the .with_
and .that_
were chained. Kept this as is because it makes it harder to read to use multiple formats for the same it block.
A bunch of private classes just make the code hard to use and understand. I'm emphatically against it on so many levels. Hopefully given all the extra functionality and completeness of the spec tests, the value here is greater than these ideas about splitting code into a bunch of different files. |
97a6fca
to
1520ba1
Compare
1520ba1
to
699e83e
Compare
Anything else to get this merged? |
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 still don't think that it's a good idea to not follow the official style guide and recommendations from Puppet. If we do not agree with them anymore they should be changed instead of being ignored. If others think this is a good approach they shall merge it.
That section of the README is not very prescriptive at all. It does not say you need to scatter your resources across multiple private and public classes. I'm not opposed to doing that and do in the partner module for Sensu (https://github.com/sensu/sensu-puppet). This module is too simple to need all that and if it did, it would not be on ::config, ::install, and ::service lines. From the docs on classes https://puppet.com/docs/puppet/6.18/lang_classes.html
|
Dear @ghoneycutt, thanks for the PR! This is Vox Pupuli Tasks, your friendly Vox Pupuli GitHub Bot. I noticed that your pull request contains merge conflict. Can you please rebase? You can find my sourcecode at voxpupuli/vox-pupuli-tasks |
No description provided.