Skip to content
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

modulesync 7.3.0; allow stdlib 9.x #1192

Merged
merged 9 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,18 +232,21 @@ 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.
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
* centos9
* almalinux8
* almalinux9
* fedora36

For more information and tips & tricks, see [voxpupuli-acceptance's documentation](https://github.com/voxpupuli/voxpupuli-acceptance#running-tests).

Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@

name: CI

on: pull_request
on:
pull_request: {}
push:
branches:
- main
- master

concurrency:
group: ${{ github.ref_name }}
Expand All @@ -13,6 +18,6 @@ concurrency:
jobs:
puppet:
name: Puppet
uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v1
uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v2
with:
pidfile_workaround: 'false'
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .msync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/

modulesync_config_version: '5.5.0'
modulesync_config_version: '7.3.0'
1 change: 1 addition & 0 deletions .pmtignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@
/.yardoc/
/.yardopts
/Dockerfile
/HISTORY.md
2 changes: 2 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
inherit_from: .rubocop_todo.yml

# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/

Expand Down
20 changes: 20 additions & 0 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2024-02-11 16:22:05 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: 32
# Configuration parameters: Max.
RSpec/IndexedLet:
Exclude:
- 'spec/unit/provider/elasticsearch_component_template/ruby_spec.rb'
- 'spec/unit/provider/elasticsearch_ilm_policy/ruby_spec.rb'
- 'spec/unit/provider/elasticsearch_index/ruby_spec.rb'
- 'spec/unit/provider/elasticsearch_index_template/ruby_spec.rb'
- 'spec/unit/provider/elasticsearch_pipeline/ruby_spec.rb'
- 'spec/unit/provider/elasticsearch_slm_policy/ruby_spec.rb'
- 'spec/unit/provider/elasticsearch_snapshot_repository/ruby_spec.rb'
- 'spec/unit/provider/elasticsearch_template/ruby_spec.rb'
11 changes: 5 additions & 6 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
source ENV['GEM_SOURCE'] || 'https://rubygems.org'

group :test do
gem 'voxpupuli-test', '~> 5.4', :require => false
gem 'voxpupuli-test', '~> 7.0', :require => false
gem 'coveralls', :require => false
gem 'simplecov-console', :require => false
gem 'puppet_metadata', '~> 2.0', :require => false
gem 'puppet_metadata', '~> 3.5', :require => false
gem 'bcrypt', :require => false
gem 'webmock', :require => false
end
Expand All @@ -18,21 +18,20 @@ group :development do
end

group :system_tests do
gem 'voxpupuli-acceptance', '~> 1.0', :require => false
gem 'voxpupuli-acceptance', '~> 3.0', :require => false
gem 'bcrypt', :require => false
gem 'rspec-retry', :require => false
gem 'simp-beaker-helpers', :require => false
end

group :release do
gem 'github_changelog_generator', '>= 1.16.1', :require => false if RUBY_VERSION >= '2.5'
gem 'voxpupuli-release', '~> 2.0', :require => false
gem 'voxpupuli-release', '~> 3.0', :require => false
end

gem 'rake', :require => false
gem 'facter', ENV['FACTER_GEM_VERSION'], :require => false, :groups => [:test]

puppetversion = ENV['PUPPET_GEM_VERSION'] || '>= 6.0'
puppetversion = ENV['PUPPET_GEM_VERSION'] || '~> 7.24'
gem 'puppet', puppetversion, :require => false, :groups => [:test]

# vim: syntax=ruby
2 changes: 1 addition & 1 deletion lib/puppet/parser/functions/concat_merge.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Puppet::Parser::Functions
newfunction(
:concat_merge,
type: :rvalue,
doc: <<-'ENDHEREDOC') do |args|
doc: <<-ENDHEREDOC) do |args|
Merges two or more hashes together concatenating duplicate keys
with array values and returns the resulting hash.

Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/parser/functions/deep_implode.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module Puppet::Parser::Functions
newfunction(
:deep_implode,
type: :rvalue,
doc: <<-'ENDHEREDOC') do |args|
doc: <<-ENDHEREDOC) do |args|
Recursively flattens all keys of a hash into a dot-notated
hash, deeply merging duplicate key values by natively combining
them and returns the resulting hash.
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/parser/functions/es_plugin_name.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module Puppet::Parser::Functions
newfunction(
:es_plugin_name,
type: :rvalue,
doc: <<-'ENDHEREDOC') do |args|
doc: <<-ENDHEREDOC) do |args|
Given a string, return the best guess at what the directory name
will be for the given plugin. Any arguments past the first will
be fallbacks (using the same logic) should the first fail.
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/provider/elastic_plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def with_environment(&block)
env_vars['ES_JAVA_OPTS'] = env_vars['ES_JAVA_OPTS'].join(' ')

env_vars.each do |env_var, value|
saved_vars[env_var] = ENV[env_var]
saved_vars[env_var] = ENV.fetch(env_var, nil)
ENV[env_var] = value
end

Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/type/elasticsearch_component_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def insync?(value)
val['template']['settings']['index'] = {} unless val['template']['settings'].key? 'index'
(val['template']['settings'].keys - ['index']).each do |setting|
new_key = if setting.start_with? 'index.'
setting[6..-1]
setting[6..]
else
setting
end
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/type/elasticsearch_ilm_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
end

def insync?(value)
Puppet_X::Elastic.deep_implode(value) == \
Puppet_X::Elastic.deep_implode(value) ==
Puppet_X::Elastic.deep_implode(should)
end

Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/type/elasticsearch_index_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def insync?(value)
val['template']['settings']['index'] = {} unless val['template']['settings'].key? 'index'
(val['template']['settings'].keys - ['index']).each do |setting|
new_key = if setting.start_with? 'index.'
setting[6..-1]
setting[6..]
else
setting
end
Expand Down
4 changes: 2 additions & 2 deletions lib/puppet/type/elasticsearch_license.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ def insync?(value)
def should_to_s(newvalue)
newvalue.transform_values do |license_data|
if license_data.is_a? Hash
license_data.map do |field, value|
license_data.to_h do |field, value|
[field, field == 'signature' ? '[redacted]' : value]
end.to_h
end
else
v
end
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/type/elasticsearch_slm_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
end

def insync?(value)
Puppet_X::Elastic.deep_implode(value) == \
Puppet_X::Elastic.deep_implode(value) ==
Puppet_X::Elastic.deep_implode(should)
end

Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/type/elasticsearch_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
val['settings']['index'] = {} unless val['settings'].key? 'index'
(val['settings'].keys - ['index']).each do |setting|
new_key = if setting.start_with? 'index.'
setting[6..-1]
setting[6..]
else
setting
end
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
{
"name": "puppetlabs/stdlib",
"version_requirement": ">= 4.13.0 < 9.0.0"
"version_requirement": ">= 4.13.0 < 10.0.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to allow 9.x cause without it puppet module install in acceptance never finishes ...

}
],
"operatingsystem_support": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,17 @@
shared_examples 'component template operations' do |es_config, component_template|
describe 'template resources' do
before :all do # rubocop:disable RSpec/BeforeAfterAll
shell "mkdir -p #{default['distmoduledir']}/another/files"
shell "mkdir -p #{default.puppet['codedir']}/modules/another/files"

create_remote_file(
default,
"#{default['distmoduledir']}/another/files/good.json",
"#{default.puppet['codedir']}/modules/another/files/good.json",
JSON.dump(component_template)
)

create_remote_file(
default,
"#{default['distmoduledir']}/another/files/bad.json",
"#{default.puppet['codedir']}/modules/another/files/bad.json",
JSON.dump(component_template)[0..-5]
)
end
Expand Down
2 changes: 1 addition & 1 deletion spec/helpers/acceptance/tests/datadir_shared_examples.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
json = JSON.parse(subject.stdout)['nodes'].values.first
expect(
json['settings']['path']['data']
).to(datapaths.one? && v[:elasticsearch_major_version] <= 2 ? eq(datapaths.first) : contain_exactly(*datapaths))
).to(datapaths.one? && v[:elasticsearch_major_version] <= 2 ? eq(datapaths.first) : match_array(datapaths))
end
end
end
Expand Down
6 changes: 3 additions & 3 deletions spec/helpers/acceptance/tests/ilm_policy_shared_examples.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,17 @@
shared_examples 'ILM policy operations' do |es_config, ilm_policy|
describe 'policy resources' do
before :all do # rubocop:disable RSpec/BeforeAfterAll
shell "mkdir -p #{default['distmoduledir']}/another/files"
shell "mkdir -p #{default.puppet['codedir']}/modules/another/files"

create_remote_file(
default,
"#{default['distmoduledir']}/another/files/good.json",
"#{default.puppet['codedir']}/modules/another/files/good.json",
JSON.dump(ilm_policy)
)

create_remote_file(
default,
"#{default['distmoduledir']}/another/files/bad.json",
"#{default.puppet['codedir']}/modules/another/files/bad.json",
JSON.dump(ilm_policy)[0..-5]
)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,17 @@
shared_examples 'index template operations' do |es_config, index_template|
describe 'template resources' do
before :all do # rubocop:disable RSpec/BeforeAfterAll
shell "mkdir -p #{default['distmoduledir']}/another/files"
shell "mkdir -p #{default.puppet['codedir']}/modules/another/files"

create_remote_file(
default,
"#{default['distmoduledir']}/another/files/good.json",
"#{default.puppet['codedir']}/modules/another/files/good.json",
JSON.dump(index_template)
)

create_remote_file(
default,
"#{default['distmoduledir']}/another/files/bad.json",
"#{default.puppet['codedir']}/modules/another/files/bad.json",
JSON.dump(index_template)[0..-5]
)
end
Expand Down
4 changes: 2 additions & 2 deletions spec/helpers/acceptance/tests/package_url_shared_examples.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@

context 'via puppet paths', :with_cleanup do
before :all do # rubocop:disable RSpec/BeforeAfterAll
shell "mkdir -p #{default['distmoduledir']}/another/files"
shell "mkdir -p #{default.puppet['codedir']}/modules/another/files"

scp_to default,
v[:elasticsearch_package][:path],
"#{default['distmoduledir']}/another/files/#{v[:elasticsearch_package][:filename]}"
"#{default.puppet['codedir']}/modules/another/files/#{v[:elasticsearch_package][:filename]}"
end

let(:manifest_class_parameters) do
Expand Down
4 changes: 2 additions & 2 deletions spec/helpers/acceptance/tests/plugin_shared_examples.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
shared_examples 'plugin acceptance tests' do |es_config, plugins|
describe 'elasticsearch::plugin' do
before :all do # rubocop:disable RSpec/BeforeAfterAll
shell "mkdir -p #{default['distmoduledir']}/another/files"
shell "mkdir -p #{default.puppet['codedir']}/modules/another/files"
end

describe 'invalid plugins', :with_cleanup do
Expand Down Expand Up @@ -53,7 +53,7 @@
scp_to(
default,
meta[:path],
"#{default['distmoduledir']}/another/files/#{plugin}.zip"
"#{default.puppet['codedir']}/modules/another/files/#{plugin}.zip"
)
end

Expand Down
2 changes: 1 addition & 1 deletion spec/helpers/acceptance/tests/security_shared_examples.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
end

shared_examples 'security acceptance tests' do |es_config|
describe 'security plugin operations', if: vault_available?, then_purge: true, with_license: true, with_certificates: true do
describe 'security plugin operations', if: vault_available?, then_purge: true, with_certificates: true, with_license: true do
rand_string = -> { [*('a'..'z')].sample(8).join }

admin_user = rand_string.call
Expand Down
6 changes: 3 additions & 3 deletions spec/helpers/acceptance/tests/slm_policy_shared_examples.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,17 @@
shared_examples 'SLM policy operations' do |es_config, slm_policy|
describe 'policy resources' do
before :all do # rubocop:disable RSpec/BeforeAfterAll
shell "mkdir -p #{default['distmoduledir']}/another/files"
shell "mkdir -p #{default.puppet['codedir']}/modules/another/files"

create_remote_file(
default,
"#{default['distmoduledir']}/another/files/good.json",
"#{default.puppet['codedir']}/modules/another/files/good.json",
JSON.dump(slm_policy)
)

create_remote_file(
default,
"#{default['distmoduledir']}/another/files/bad.json",
"#{default.puppet['codedir']}/modules/another/files/bad.json",
JSON.dump(slm_policy)[0..-5]
)
end
Expand Down
6 changes: 3 additions & 3 deletions spec/helpers/acceptance/tests/template_shared_examples.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,17 @@
shared_examples 'template operations' do |es_config, template|
describe 'template resources' do
before :all do # rubocop:disable RSpec/BeforeAfterAll
shell "mkdir -p #{default['distmoduledir']}/another/files"
shell "mkdir -p #{default.puppet['codedir']}/modules/another/files"

create_remote_file(
default,
"#{default['distmoduledir']}/another/files/good.json",
"#{default.puppet['codedir']}/modules/another/files/good.json",
JSON.dump(template)
)

create_remote_file(
default,
"#{default['distmoduledir']}/another/files/bad.json",
"#{default.puppet['codedir']}/modules/another/files/bad.json",
JSON.dump(template)[0..-5]
)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

expect(described_class.instances.map do |provider|
provider.instance_variable_get(:@property_hash)
end).to contain_exactly(*instance)
end).to match_array(instance)
end
end

Expand Down
Loading