From 63fb8f15e1368f2e07e8e373df0ca05df2d1ff3b Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Thu, 17 Aug 2023 14:25:33 +0200 Subject: [PATCH 1/4] modulesync 9.1.0 --- .github/CONTRIBUTING.md | 39 +++++++++++++++++++++++-------- .rspec => .github/labeler.yml | 5 ++-- .github/release.yml | 42 ++++++++++++++++++++++++++++++++++ .github/workflows/ci.yml | 11 +++++---- .github/workflows/labeler.yml | 17 ++++++++++++++ .github/workflows/release.yml | 9 +++++++- .gitignore | 2 ++ .msync.yml | 2 +- .overcommit.yml | 8 ++++--- .pmtignore | 1 + .puppet-lint.rc | 3 +++ .rspec_parallel | 4 ---- Dockerfile | 24 ------------------- Gemfile | 10 ++++---- spec/spec.opts | 6 ----- spec/spec_helper.rb | 5 ++++ spec/spec_helper_acceptance.rb | 2 +- 17 files changed, 129 insertions(+), 61 deletions(-) rename .rspec => .github/labeler.yml (63%) create mode 100644 .github/release.yml create mode 100644 .github/workflows/labeler.yml delete mode 100644 .rspec_parallel delete mode 100644 Dockerfile delete mode 100644 spec/spec.opts diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 8b466cf..daceb64 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -131,19 +131,29 @@ You can install all needed gems for spec tests into the modules directory by running: ```sh -bundle install --path .vendor/ --without development system_tests release --jobs "$(nproc)" +bundle config set --local path '.vendor/' +bundle config set --local without 'development system_tests release' +bundle install --jobs "$(nproc)" ``` If you also want to run acceptance tests: ```sh -bundle install --path .vendor/ --with system_tests --without development release --jobs "$(nproc)" +bundle config set --local path '.vendor/' +bundle config set --local without 'development release' +bundle config set --local with 'system_tests' +bundle install --jobs "$(nproc)" ``` Our all in one solution if you don't know if you need to install or update gems: ```sh -bundle install --path .vendor/ --with system_tests --without development release --jobs "$(nproc)"; bundle update; bundle clean +bundle config set --local path '.vendor/' +bundle config set --local without 'development release' +bundle config set --local with 'system_tests' +bundle install --jobs "$(nproc)" +bundle update +bundle clean ``` As an alternative to the `--jobs "$(nproc)` parameter, you can set an @@ -232,18 +242,29 @@ simple tests against it after applying the module. You can run this with: ```sh -BEAKER_setfile=debian11-64 bundle exec rake beaker +BEAKER_PUPPET_COLLECTION=puppet7 BEAKER_setfile=debian11-64 bundle exec rake beaker ``` -You can replace the string `debian10` with any common operating system. +or + +```sh +BEAKER_PUPPET_COLLECTION=none BEAKER_setfile=archlinux-64 bundle exec rake beaker +``` + +This latter example will use the distribution's own version of Puppet. + +You can replace the string `debian11` with any common operating system. The following strings are known to work: -* ubuntu1804 * ubuntu2004 -* debian10 +* ubuntu2204 * debian11 -* centos7 -* centos8 +* debian12 +* centos9 +* archlinux +* almalinux8 +* almalinux9 +* fedora36 For more information and tips & tricks, see [voxpupuli-acceptance's documentation](https://github.com/voxpupuli/voxpupuli-acceptance#running-tests). diff --git a/.rspec b/.github/labeler.yml similarity index 63% rename from .rspec rename to .github/labeler.yml index f634583..f2d08d6 100644 --- a/.rspec +++ b/.github/labeler.yml @@ -1,5 +1,6 @@ +--- # Managed by modulesync - DO NOT EDIT # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ ---format documentation ---color +skip-changelog: + - head-branch: ['^release-*', 'release'] diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 0000000..f5b5d7a --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,42 @@ +--- +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ + +# https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes + +changelog: + exclude: + labels: + - duplicate + - invalid + - modulesync + - question + - skip-changelog + - wont-fix + - wontfix + + categories: + - title: Breaking Changes 🛠 + labels: + - backwards-incompatible + + - title: New Features 🎉 + labels: + - enhancement + + - title: Bug Fixes 🐛 + labels: + - bug + + - title: Documentation Updates 📚 + labels: + - documentation + - docs + + - title: Dependency Updates ⬆️ + labels: + - dependencies + + - title: Other Changes + labels: + - "*" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 743bb72..1f82c4c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,7 +4,12 @@ name: CI -on: pull_request +on: + pull_request: {} + push: + branches: + - main + - master concurrency: group: ${{ github.ref_name }} @@ -13,6 +18,4 @@ concurrency: jobs: puppet: name: Puppet - uses: voxpupuli/gha-puppet/.github/workflows/basic.yml@v1 - with: - additional_packages: 'libaugeas-dev augeas-tools' + uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v2 diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml new file mode 100644 index 0000000..66127cd --- /dev/null +++ b/.github/workflows/labeler.yml @@ -0,0 +1,17 @@ +--- +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ + +name: "Pull Request Labeler" + +on: + pull_request_target: {} + +jobs: + labeler: + permissions: + contents: read + pull-requests: write + runs-on: ubuntu-latest + steps: + - uses: actions/labeler@v5 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 15f1721..93b33c2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,7 @@ on: jobs: release: name: Release - uses: voxpupuli/gha-puppet/.github/workflows/release.yml@v1 + uses: voxpupuli/gha-puppet/.github/workflows/release.yml@v2 with: allowed_owner: 'voxpupuli' secrets: @@ -20,3 +20,10 @@ jobs: # https://docs.github.com/en/actions/security-guides/encrypted-secrets username: ${{ secrets.PUPPET_FORGE_USERNAME }} api_key: ${{ secrets.PUPPET_FORGE_API_KEY }} + + create-github-release: + name: Create GitHub Release + runs-on: ubuntu-latest + steps: + - name: Create GitHub release + uses: voxpupuli/gha-create-a-github-release@v1 diff --git a/.gitignore b/.gitignore index 84fd904..adea1b0 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,5 @@ .*.sw? /.yardoc/ /Guardfile +bolt-debug.log +.rerun.json diff --git a/.msync.yml b/.msync.yml index b929160..95e8c97 100644 --- a/.msync.yml +++ b/.msync.yml @@ -2,4 +2,4 @@ # Managed by modulesync - DO NOT EDIT # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ -modulesync_config_version: '6.0.0' +modulesync_config_version: '9.1.0' diff --git a/.overcommit.yml b/.overcommit.yml index d367ada..4ed994c 100644 --- a/.overcommit.yml +++ b/.overcommit.yml @@ -43,10 +43,12 @@ PreCommit: enabled: true description: 'Runs rubocop on modified files only' command: ['bundle', 'exec', 'rubocop'] - PuppetLint: + RakeTarget: enabled: true - description: 'Runs puppet-lint on modified files only' - command: ['bundle', 'exec', 'puppet-lint'] + description: 'Runs lint on modified files only' + targets: + - 'lint' + command: ['bundle', 'exec', 'rake'] YamlSyntax: enabled: true JsonSyntax: diff --git a/.pmtignore b/.pmtignore index 58a0408..10b9830 100644 --- a/.pmtignore +++ b/.pmtignore @@ -35,3 +35,4 @@ /.yardoc/ /.yardopts /Dockerfile +/HISTORY.md diff --git a/.puppet-lint.rc b/.puppet-lint.rc index dd8272c..05d28a2 100644 --- a/.puppet-lint.rc +++ b/.puppet-lint.rc @@ -1,3 +1,6 @@ +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ + --fail-on-warnings --no-parameter_documentation-check --no-parameter_types-check diff --git a/.rspec_parallel b/.rspec_parallel deleted file mode 100644 index a9a84f8..0000000 --- a/.rspec_parallel +++ /dev/null @@ -1,4 +0,0 @@ -# Managed by modulesync - DO NOT EDIT -# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ - ---format progress diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 8dd82d6..0000000 --- a/Dockerfile +++ /dev/null @@ -1,24 +0,0 @@ -# MANAGED BY MODULESYNC -# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ - -FROM ruby:2.7 - -WORKDIR /opt/puppet - -# https://github.com/puppetlabs/puppet/blob/06ad255754a38f22fb3a22c7c4f1e2ce453d01cb/lib/puppet/provider/service/runit.rb#L39 -RUN mkdir -p /etc/sv - -ARG PUPPET_GEM_VERSION="~> 6.0" -ARG PARALLEL_TEST_PROCESSORS=4 - -# Cache gems -COPY Gemfile . -RUN bundle install --without system_tests development release --path=${BUNDLE_PATH:-vendor/bundle} - -COPY . . - -RUN bundle install -RUN bundle exec rake release_checks - -# Container should not saved -RUN exit 1 diff --git a/Gemfile b/Gemfile index 411fa26..662b3b0 100644 --- a/Gemfile +++ b/Gemfile @@ -4,10 +4,10 @@ source ENV['GEM_SOURCE'] || 'https://rubygems.org' group :test do - gem 'voxpupuli-test', '~> 6.0', :require => false + gem 'voxpupuli-test', '~> 9.0', :require => false gem 'coveralls', :require => false gem 'simplecov-console', :require => false - gem 'puppet_metadata', '~> 3.0', :require => false + gem 'puppet_metadata', '~> 4.0', :require => false gem 'ruby-augeas', :require => false end @@ -17,13 +17,11 @@ group :development do end group :system_tests do - gem 'voxpupuli-acceptance', '~> 2.0', :require => false + gem 'voxpupuli-acceptance', '~> 3.0', :require => false end group :release do - gem 'github_changelog_generator', '>= 1.16.1', :require => false - gem 'voxpupuli-release', '~> 3.0', :require => false - gem 'faraday-retry', '~> 2.1', :require => false + gem 'voxpupuli-release', '~> 3.0', :require => false end gem 'rake', :require => false diff --git a/spec/spec.opts b/spec/spec.opts deleted file mode 100644 index 91cd642..0000000 --- a/spec/spec.opts +++ /dev/null @@ -1,6 +0,0 @@ ---format -s ---colour ---loadby -mtime ---backtrace diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index d6e9512..d017b14 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -9,6 +9,10 @@ require 'voxpupuli/test/spec_helper' +RSpec.configure do |c| + c.facterdb_string_keys = false +end + add_mocked_facts! if File.exist?(File.join(__dir__, 'default_module_facts.yml')) @@ -23,3 +27,4 @@ # augeasproviders: setting $LOAD_PATH to work around broken type autoloading $LOAD_PATH.unshift(File.join(__dir__, 'fixtures/modules/augeasproviders_core/lib')) +Dir['./spec/support/spec/**/*.rb'].sort.each { |f| require f } diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index d3a6e23..2681792 100644 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -5,6 +5,6 @@ require 'voxpupuli/acceptance/spec_helper_acceptance' -configure_beaker +configure_beaker(modules: :metadata) Dir['./spec/support/acceptance/**/*.rb'].sort.each { |f| require f } From ffe2e9dc2a03d002c689474374b7d29cc92df477 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Tue, 9 Jul 2024 21:51:25 +0200 Subject: [PATCH 2/4] CI: Disable acceptance tests Testing grub isn't reliable on Docker. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1f82c4c..2974af3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,4 +18,4 @@ concurrency: jobs: puppet: name: Puppet - uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v2 + uses: voxpupuli/gha-puppet/.github/workflows/basic.yml@v2 From e20b97fdf7d25033b45ff6d84360cfa27729eb7a Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Thu, 17 Aug 2023 23:56:05 +0200 Subject: [PATCH 3/4] rubocop: autofix --- .rubocop_todo.yml | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 63bd839..0483a12 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,30 +1,33 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2022-05-10 18:42:52 UTC using RuboCop version 1.22.3. +# on 2023-08-17 21:29:32 UTC using RuboCop version 1.50.2. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. -# Offense count: 38 -# Configuration parameters: CheckForMethodsWithNoSideEffects. -Lint/Void: +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +Lint/NonAtomicFileOperation: Exclude: - - 'spec/unit/puppet/provider/kernel_parameter/grub2_spec.rb' - - 'spec/unit/puppet/provider/kernel_parameter/grub_spec.rb' + - 'lib/puppet/provider/grub_menuentry/grub2.rb' # Offense count: 7 RSpec/AnyInstance: Exclude: - 'spec/unit/puppet/provider/kernel_parameter/grub2_spec.rb' - - 'spec/unit/puppet/provider/kernel_parameter/grub_spec.rb' -# Offense count: 6 +# Offense count: 4 +# This cop supports unsafe autocorrection (--autocorrect-all). +RSpec/BeEq: + Exclude: + - 'spec/unit/puppet/provider/kernel_parameter/grub2_spec.rb' + +# Offense count: 4 # Configuration parameters: AssignmentOnly. RSpec/InstanceVariable: Exclude: - 'spec/unit/puppet/provider/kernel_parameter/grub2_spec.rb' - - 'spec/unit/puppet/provider/kernel_parameter/grub_spec.rb' # Offense count: 1 RSpec/MultipleDescribes: @@ -36,7 +39,15 @@ RSpec/RepeatedExampleGroupDescription: Exclude: - 'spec/unit/puppet/provider/kernel_parameter/grub2_spec.rb' -# Offense count: 1 -Style/MixinUsage: +# Offense count: 2 +# This cop supports unsafe autocorrection (--autocorrect-all). +Style/MapToHash: + Exclude: + - 'lib/puppet/provider/grub_menuentry/grub2.rb' + +# Offense count: 3 +# This cop supports unsafe autocorrection (--autocorrect-all). +Style/SlicingWithRange: Exclude: - - 'spec/spec_helper_acceptance.rb' + - 'lib/puppet/provider/grub_menuentry/grub2.rb' + - 'lib/puppetx/augeasproviders_grub/util.rb' From dad20e81fe99d50e88c75296a55275543bd214e2 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Tue, 9 Jul 2024 21:58:57 +0200 Subject: [PATCH 4/4] modulesync 9.1.0 --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2974af3..f66457d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,3 +19,5 @@ jobs: puppet: name: Puppet uses: voxpupuli/gha-puppet/.github/workflows/basic.yml@v2 + with: + additional_packages: 'libaugeas-dev augeas-tools'