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

Drop Puppet 4 and 5 support, add compatibility with Puppet stdlib 7 #803

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
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
200 changes: 10 additions & 190 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,14 @@ version: 2.1
orbs:
win: circleci/[email protected]
jobs:
specs-ruby21-puppet46: &specs
specs-ruby23-puppet60: &specs
machine:
image: ubuntu-2004:202201-02
environment:
STRICT_VARIABLES: 'yes'
RUBY_VERSION: '2.1.9'
PUPPET_VERSION: '4.6.2'
RUBY_VERSION: '2.3.6'
PUPPET_VERSION: '6.0.0'
steps:
# See https://github.blog/2021-09-01-improving-git-protocol-security-github/
- run:
name: Fix git clones
command: echo -e '[url "https://github.com/"]\n insteadOf = "git://github.com/"' >> ~/.gitconfig
- checkout
- run:
name: Install old libssl1.0-dev
Expand All @@ -39,138 +35,13 @@ jobs:
name: Run tests
command: rvm $RUBY_VERSION --verbose do bundle exec rake test

specs-ruby21-puppet410:
<<: *specs
environment:
STRICT_VARIABLES: 'yes'
RUBY_VERSION: '2.1.9'
PUPPET_VERSION: '4.10.9'

specs-ruby21-puppet50:
<<: *specs
environment:
STRICT_VARIABLES: 'yes'
RUBY_VERSION: '2.1.9'
PUPPET_VERSION: '5.0.1'

specs-ruby21-puppet53:
<<: *specs
environment:
STRICT_VARIABLES: 'yes'
RUBY_VERSION: '2.1.9'
PUPPET_VERSION: '5.3.3'

# Puppet 6 depends on ruby >= 2.3
#specs-ruby21-puppet60
#specs-ruby21-puppet65

specs-ruby22-puppet46:
<<: *specs
environment:
STRICT_VARIABLES: 'yes'
RUBY_VERSION: '2.2.3'
PUPPET_VERSION: '4.6.2'

specs-ruby22-puppet410:
<<: *specs
environment:
STRICT_VARIABLES: 'yes'
RUBY_VERSION: '2.2.3'
PUPPET_VERSION: '4.10.9'

specs-ruby22-puppet50:
<<: *specs
environment:
STRICT_VARIABLES: 'yes'
RUBY_VERSION: '2.2.3'
PUPPET_VERSION: '5.0.1'

specs-ruby22-puppet53:
<<: *specs
environment:
STRICT_VARIABLES: 'yes'
RUBY_VERSION: '2.2.3'
PUPPET_VERSION: '5.3.3'

# Puppet 6 depends on ruby >= 2.3
#specs-ruby22-puppet60
#specs-ruby22-puppet65

specs-ruby23-puppet46:
<<: *specs
environment:
STRICT_VARIABLES: 'yes'
RUBY_VERSION: '2.3.6'
PUPPET_VERSION: '4.6.2'

specs-ruby23-puppet410:
<<: *specs
environment:
STRICT_VARIABLES: 'yes'
RUBY_VERSION: '2.3.6'
PUPPET_VERSION: '4.10.9'

specs-ruby23-puppet50:
<<: *specs
environment:
STRICT_VARIABLES: 'yes'
RUBY_VERSION: '2.3.6'
PUPPET_VERSION: '5.0.1'

specs-ruby23-puppet53:
<<: *specs
environment:
STRICT_VARIABLES: 'yes'
RUBY_VERSION: '2.3.6'
PUPPET_VERSION: '5.3.3'

specs-ruby23-puppet60:
<<: *specs
environment:
STRICT_VARIABLES: 'yes'
RUBY_VERSION: '2.3.6'
PUPPET_VERSION: '6.0.0'

specs-ruby23-puppet65:
<<: *specs
environment:
STRICT_VARIABLES: 'yes'
RUBY_VERSION: '2.3.6'
PUPPET_VERSION: '6.5.0'

# Puppet < 5 doesn't work with Ruby when it's compiled with libssl > 1.0 - see
# https://bugzilla.redhat.com/show_bug.cgi?id=1440710 for details - but RVM
# refuses to compile with older libssl. We could use --autolibs=0 RVM option,
# but then we'd have to manually install all deps ourselves and maintain that
# solution... So we just disable specs-ruby24-puppet46 and specs-ruby25-puppet46.
# specs-ruby24-puppet46:
# <<: *specs
# environment:
# STRICT_VARIABLES: 'yes'
# RUBY_VERSION: '2.4.3'
# PUPPET_VERSION: '4.6.2'

specs-ruby24-puppet410:
<<: *specs
environment:
STRICT_VARIABLES: 'yes'
RUBY_VERSION: '2.4.3'
PUPPET_VERSION: '4.10.9'

specs-ruby24-puppet50:
<<: *specs
environment:
STRICT_VARIABLES: 'yes'
RUBY_VERSION: '2.4.3'
PUPPET_VERSION: '5.0.1'

specs-ruby24-puppet53:
<<: *specs
environment:
STRICT_VARIABLES: 'yes'
RUBY_VERSION: '2.4.3'
PUPPET_VERSION: '5.3.3'

specs-ruby24-puppet60:
<<: *specs
environment:
Expand All @@ -185,34 +56,6 @@ jobs:
RUBY_VERSION: '2.4.3'
PUPPET_VERSION: '6.5.0'

# specs-ruby25-puppet46:
# <<: *specs
# environment:
# STRICT_VARIABLES: 'yes'
# RUBY_VERSION: '2.5.3'
# PUPPET_VERSION: '4.6.2'

specs-ruby25-puppet410:
<<: *specs
environment:
STRICT_VARIABLES: 'yes'
RUBY_VERSION: '2.5.3'
PUPPET_VERSION: '4.10.9'

specs-ruby25-puppet50:
<<: *specs
environment:
STRICT_VARIABLES: 'yes'
RUBY_VERSION: '2.5.3'
PUPPET_VERSION: '5.0.1'

specs-ruby25-puppet53:
<<: *specs
environment:
STRICT_VARIABLES: 'yes'
RUBY_VERSION: '2.5.3'
PUPPET_VERSION: '5.3.3'

specs-ruby25-puppet60:
<<: *specs
environment:
Expand Down Expand Up @@ -240,6 +83,7 @@ jobs:
STRICT_VARIABLES: 'yes'
RUBY_VERSION: '2.6.3'
PUPPET_VERSION: '6.5.0'

specs-ruby26-puppet79:
<<: *specs
environment:
Expand All @@ -266,10 +110,6 @@ jobs:
name: win/default # Comes with ruby 2.6, which is not supported on Windows as of puppet 6.10.1
shell: bash.exe
steps:
# See https://github.blog/2021-09-01-improving-git-protocol-security-github/
- run:
name: Fix git clones
command: echo -e '[url "https://github.com/"]\n insteadOf = "git://github.com/"' >> ~/.gitconfig
- checkout
- run:
name: Run tests
Expand All @@ -295,11 +135,10 @@ jobs:
STRICT_VARIABLES: 'yes'
RUBY_VERSION: '2.5.3'
steps:
# See https://github.blog/2021-09-01-improving-git-protocol-security-github/
- run:
name: Fix git clones
command: echo -e '[url "https://github.com/"]\n insteadOf = "git://github.com/"' >> ~/.gitconfig
- checkout
- run:
name: Remove Gemfile.lock
command: rm Gemfile.lock
- run:
name: Install Ruby versions
command: rvm install $RUBY_VERSION
Expand All @@ -320,11 +159,10 @@ jobs:
STRICT_VARIABLES: 'yes'
RUBY_VERSION: '2.5.3'
steps:
# See https://github.blog/2021-09-01-improving-git-protocol-security-github/
- run:
name: Fix git clones
command: echo -e '[url "https://github.com/"]\n insteadOf = "git://github.com/"' >> ~/.gitconfig
- checkout
- run:
name: Remove Gemfile.lock
command: rm Gemfile.lock
- run:
name: Install Ruby versions
command: rvm install $RUBY_VERSION
Expand All @@ -343,28 +181,10 @@ workflows:
version: 2
build_and_test:
jobs:
- specs-ruby21-puppet46
- specs-ruby21-puppet410
- specs-ruby21-puppet50
- specs-ruby21-puppet53
- specs-ruby22-puppet46
- specs-ruby22-puppet410
- specs-ruby22-puppet50
- specs-ruby22-puppet53
- specs-ruby23-puppet46
- specs-ruby23-puppet410
- specs-ruby23-puppet50
- specs-ruby23-puppet53
- specs-ruby23-puppet60
- specs-ruby23-puppet65
- specs-ruby24-puppet410
- specs-ruby24-puppet50
- specs-ruby24-puppet53
- specs-ruby24-puppet60
- specs-ruby24-puppet65
- specs-ruby25-puppet410
- specs-ruby25-puppet50
- specs-ruby25-puppet53
- specs-ruby25-puppet60
- specs-ruby25-puppet65
- specs-ruby25-puppet65-windows
Expand Down
18 changes: 9 additions & 9 deletions .fixtures.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
fixtures:
repositories:
stdlib:
repo: "git://github.com/puppetlabs/puppetlabs-stdlib.git"
ref: "4.25.0"
repo: "https://github.com/puppetlabs/puppetlabs-stdlib.git"
ref: "v6.0.0"
concat:
repo: "git://github.com/puppetlabs/puppetlabs-concat.git"
ref: "4.1.1"
repo: "https://github.com/puppetlabs/puppetlabs-concat.git"
ref: "v6.0.0"
apt:
repo: "git://github.com/puppetlabs/puppetlabs-apt.git"
ref: "4.5.0"
repo: "https://github.com/puppetlabs/puppetlabs-apt.git"
ref: "v7.0.1"
puppetserver_gem:
repo: "git://github.com/puppetlabs/puppetlabs-puppetserver_gem.git"
ref: "1.0.0"
repo: "https://github.com/puppetlabs/puppetlabs-puppetserver_gem.git"
ref: "1.1.1"
forge_modules:
yumrepo_core:
repo: "puppetlabs/yumrepo_core"
Expand All @@ -21,7 +21,7 @@ fixtures:
ref: "4.1.0"
zypprepo:
repo: "puppet/zypprepo"
ref: "3.1.0"
ref: "5.0.0"
symlinks:
custom_datadog: "#{source_dir}/spec/custom_fixtures/custom_datadog"
datadog_agent: "#{source_dir}"
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ ruby_version = Gem::Version.new(RUBY_VERSION.dup)

# Each version of Puppet recommends a specific version of Ruby. Try to fetch the Puppet version that
# matches our Ruby (unless PUPPET_VERSION is defined).
matching_puppet_version = ruby_version > Gem::Version.new('2.5') ? (ruby_version > Gem::Version.new('2.7') ? '7.0.0' : '6.0.1') : '4.10.2'
matching_puppet_version = ruby_version > Gem::Version.new('2.7') ? '7.0.0' : '6.0.1'
puppet_version = ENV.fetch('PUPPET_VERSION', matching_puppet_version)
gem "puppet", "~> #{puppet_version}"

ruby_version_segments = ruby_version.segments
minor_version = ruby_version_segments[0..1].join('.')

group :development do
gem "rake", "~> 12.3.3" if ruby_version < Gem::Version.new('2.6.0') # last version for ruby < 2.6
gem "rake", "~> 12.3.3" if ruby_version < Gem::Version.new('2.8.0') # last version for ruby < 2.6
gem "semantic_puppet", '= 1.0.4'
gem "xmlrpc" if ruby_version >= Gem::Version.new('2.3')
gem "concurrent-ruby", '= 1.1.10' if Gem::Requirement.create([' >= 6.9.0', '<7.25.0']).satisfied_by?(Gem::Version.new(puppet_version)) # Add this beucause until Puppet 7.25 concurrent-ruby 1.22 break puppet
Expand Down
Loading
Loading