voxpupuli / puppet-augeasproviders_grub

Augeas-based grub type and providers
Apache License 2.0
9 stars 33 forks source link

Add new parameter to prevent grub-mkconfig being run #59

Closed cedws closed 2 years ago

cedws commented 4 years ago

Closes #47. I'm afraid I don't really know Ruby tooling so I am not sure if the tests pass.

puppet-community-rangefinder[bot] commented 4 years ago

grub_user is a type

Breaking changes to this file MAY impact these 3 modules (near match): * [simp-simp_grub](https://github.com/simp/pupmod-simp-simp_grub) * [cohdjn-cisecurity](https://github.com/cohdjn/cisecurity) * [fervid-secure_linux_cis](https://github.com/fervidus/secure_linux_cis.git)

kernel_parameter is a type

Breaking changes to this file MAY impact these 14 modules (near match): * [simp-fips](https://github.com/simp/pupmod-simp-fips) * [simp-ima](https://github.com/simp/pupmod-simp-ima) * [treydock-kdump](https://github.com/treydock/puppet-kdump) * [stivesso-serial_console](https://github.com/stivesso/serial_console) * [cohdjn-cisecurity](https://github.com/cohdjn/cisecurity) * [tomkrieger-security_baseline](https://git.home.tom-krieger.de/puppet-modules/security_baseline.git) * [shearn89-toughen](https://github.com/shearn89/puppet-toughen) * [mindhive-serial_console](https://github.com/mindhivenz/puppet-serial_console.git) * [domcleal-augeasproviders](https://github.com/hercules-team/augeasproviders) * [herculesteam-augeasproviders](https://github.com/hercules-team/augeasproviders) * [simp-selinux](https://github.com/simp/pupmod-simp-selinux) * [simp-auditd](https://github.com/simp/pupmod-simp-auditd) * [ceritsc-serial_console](https://github.com/CERIT-SC/puppet-serial_console.git) * [fervid-secure_linux_cis](https://github.com/fervidus/secure_linux_cis.git)

This module is declared in 6 of 575 indexed public Puppetfiles.


These results were generated with Rangefinder, a tool that helps predict the downstream impact of breaking changes to elements used in Puppet modules. You can run this on the command line to get a full report.

Exact matches are those that we can positively identify via namespace and the declaring modules' metadata. Non-namespaced items, such as Puppet 3.x functions, will always be reported as near matches only.

coveralls commented 4 years ago

Coverage Status

Coverage increased (+0.2%) to 94.118% when pulling 04053015deabf5001c1ffbed5a2d9ea668ebb0dd on cedws:OptionalMkconfig into 082bf147b11b30e6890a59bd0563551c5e1720c2 on hercules-team:master.

raphink commented 4 years ago

This looks good. Now it only needs some tests :smile:

Something similar to https://github.com/hercules-team/augeasproviders_grub/blob/master/spec/unit/puppet/provider/kernel_parameter/grub2_spec.rb#L73, but it should expect to never run when run_mkconfig => false.

cedws commented 4 years ago

Apologies for the delay on this. I had a look at writing some tests but am having some toolchain issues. I've installed the dependencies with bundler and am trying to run the tests with rspec, but it's spitting out some errors. Any ideas?

raphink commented 4 years ago

Are you running bundle exec rake spec?

cedws commented 4 years ago

Ah, no, I was just running rspec from GEMPATH, thanks. I've just committed a single test, is this along the right lines? I assume you would like me to add a test for the other types as well (grub_config, grub_user, et al)?

raphink commented 4 years ago

Yes, please!

cedws commented 4 years ago

Sorry, not getting very far with this. Tried running bundle exec rake acceptance on Ruby 2.7 but get this. Then I saw CI might be using 2.4.4 (though it doesn't appear to actually run the acceptance tests?) so I downgraded, now bundle install is failing because it looks like something to do with Augeas is failing to compile. I have the headers installed on my system. Also tried doing this all in Docker but I guess the acceptance tests require virtualisation so that won't work. I do need to add acceptance tests for the run_mkconfig parameter for the grub_menuentry/grub_user/... types correct?

raphink commented 4 years ago

There's no acceptance tests in this module, all the tests are declared as unit tests, so you run all the tests with bundle exec rake spec.

trevor-vaughan commented 4 years ago

There actually are acceptance tests and it would be great to run them. The CI can't run them because they require virtual machines and are run through beaker.

I suggest using PDK to set up an isolated dev environment or RVM or rbenv but not system Ruby.

raphink commented 4 years ago

Oh my bad, I didn't think we had any acceptance tests in augeasproviders modules. Sorry about that.

And I'm guessing docker containers would not be sufficient for grub tests.

trevor-vaughan commented 4 years ago

Nope, docker won't work at all for GRUB. Need the real deal :-D.

I had to add them due to the complexity of GRUB itself and just being too dangerous to get wrong.

raphink commented 4 years ago

We used to run beaker on Travis with openstack or AWS nodes, but it's a paid solution.

trevor-vaughan commented 4 years ago

Yeah, that's the issue. Without someone to put up a system to run the tests, there's not much that can be done besides run them by hand.

trevor-vaughan commented 4 years ago

I'll be able to review this next week if it can wait that long.

trevor-vaughan commented 4 years ago

I'm getting failures in beaker with the code that I'll dig into tomorrow.

trevor-vaughan commented 4 years ago

@cedws Let us know if you need help with the testing. Things are 90% there!

cedws commented 4 years ago

@trevor-vaughan Thanks very much for this. I will not be able to get to it for a week or so.

jcpunk commented 3 years ago

I'll confess interest in this patch...

raphink commented 3 years ago

@cedws are you still interested in working on this?

cedws commented 3 years ago

I am, but have quite a lot of things going on at the moment. It's still on my to-do list. Anybody is welcome to pick this up.

vox-pupuli-tasks[bot] commented 2 years ago

Dear @cedws, 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