From 07bea617cf4a5cdff7c363754bf16f031bdb3587 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Tarti=C3=A8re?= Date: Wed, 22 Nov 2023 16:35:15 -1000 Subject: [PATCH 01/27] Remove legacy top-scope syntax --- CHANGELOG.md | 14 +++++++------- HISTORY.md | 2 +- NATIVE_TYPES_AND_PROVIDERS.md | 4 ++-- README.md | 6 +++--- lib/puppet/parser/functions/jenkins_port.rb | 2 +- lib/puppet/parser/functions/jenkins_prefix.rb | 2 +- manifests/cli.pp | 4 ++-- manifests/init.pp | 2 +- manifests/job/present.pp | 2 +- spec/functions/jenkins_prefix_spec.rb | 2 +- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ed0a4b8c..c40a053cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -224,7 +224,7 @@ These should not affect the functionality of the module. - systemd jenkins master support on RedHat [\#694](https://github.com/voxpupuli/puppet-jenkins/pull/694) ([jhoblitt](https://github.com/jhoblitt)) - fix slave systemd support [\#692](https://github.com/voxpupuli/puppet-jenkins/pull/692) ([jhoblitt](https://github.com/jhoblitt)) - add swarm client systemd support [\#691](https://github.com/voxpupuli/puppet-jenkins/pull/691) ([jhoblitt](https://github.com/jhoblitt)) -- add ::jenkins::sysconfdir parameter [\#689](https://github.com/voxpupuli/puppet-jenkins/pull/689) ([jhoblitt](https://github.com/jhoblitt)) +- add jenkins::sysconfdir parameter [\#689](https://github.com/voxpupuli/puppet-jenkins/pull/689) ([jhoblitt](https://github.com/jhoblitt)) - disable plugin pinning by default [\#688](https://github.com/voxpupuli/puppet-jenkins/pull/688) ([jhoblitt](https://github.com/jhoblitt)) - add firewall module dependency info [\#676](https://github.com/voxpupuli/puppet-jenkins/pull/676) ([vinhut](https://github.com/vinhut)) - Add support for gitlab api token credential - \#664 [\#667](https://github.com/voxpupuli/puppet-jenkins/pull/667) ([ripclawffb](https://github.com/ripclawffb)) @@ -245,7 +245,7 @@ These should not affect the functionality of the module. - Won't install alongside puppetlabs-mysql [\#623](https://github.com/voxpupuli/puppet-jenkins/issues/623) - uninitialized constant json when using Jenkins\_credentials provider [\#617](https://github.com/voxpupuli/puppet-jenkins/issues/617) - `jenkins_user` experimental password setting is broken [\#499](https://github.com/voxpupuli/puppet-jenkins/issues/499) -- Ensure $::jenkins::localstatedir to Directory Breaks Filesystem's With Symlinked Mounts [\#403](https://github.com/voxpupuli/puppet-jenkins/issues/403) +- Ensure $jenkins::localstatedir to Directory Breaks Filesystem's With Symlinked Mounts [\#403](https://github.com/voxpupuli/puppet-jenkins/issues/403) - repo::debian.pp does not work with apt module \>= 2.0.0 [\#402](https://github.com/voxpupuli/puppet-jenkins/issues/402) - Jenkins Plugin manifest are now readable since it has got some invalid byte sequence in US-ASCII [\#265](https://github.com/voxpupuli/puppet-jenkins/issues/265) - Default INFO logging makes jenkins cli output messages that are then … [\#907](https://github.com/voxpupuli/puppet-jenkins/pull/907) ([jhooyberghs](https://github.com/jhooyberghs)) @@ -302,7 +302,7 @@ These should not affect the functionality of the module. - setting security is not idempotent [\#673](https://github.com/voxpupuli/puppet-jenkins/issues/673) - 'digest\_type' default of 'sha1' is causing all plugins to install repeatedly [\#668](https://github.com/voxpupuli/puppet-jenkins/issues/668) - puppet\_helper.groovy throws an error with unsupported credentials [\#664](https://github.com/voxpupuli/puppet-jenkins/issues/664) -- $::jenkins::libdir is undef in jenkins::cli class [\#654](https://github.com/voxpupuli/puppet-jenkins/issues/654) +- $jenkins::libdir is undef in jenkins::cli class [\#654](https://github.com/voxpupuli/puppet-jenkins/issues/654) - Unsuccessful Installation [\#647](https://github.com/voxpupuli/puppet-jenkins/issues/647) - jenkins::plugins doesn't work properly with puppet 4.6.2 [\#637](https://github.com/voxpupuli/puppet-jenkins/issues/637) - Allow virtual jenkins host [\#630](https://github.com/voxpupuli/puppet-jenkins/issues/630) @@ -440,7 +440,7 @@ These should not affect the functionality of the module. - jenkins-slave don't stop correctly [\#557](https://github.com/voxpupuli/puppet-jenkins/issues/557) - jenkins\_job broken by org.jenkinsci.plugins.workflow.job.WorkflowJob jobs [\#551](https://github.com/voxpupuli/puppet-jenkins/issues/551) - Parameter jenkins::slave::ui\_pass not enclosed in quotes. [\#542](https://github.com/voxpupuli/puppet-jenkins/issues/542) -- ::jenkins::slave should not depend on ::jenkins [\#533](https://github.com/voxpupuli/puppet-jenkins/issues/533) +- jenkins::slave should not depend on jenkins [\#533](https://github.com/voxpupuli/puppet-jenkins/issues/533) - slow unit test causing travis failures [\#517](https://github.com/voxpupuli/puppet-jenkins/issues/517) - jenkins:plugin can incorrectly believe a plugin is installed \(when it isn't\) [\#513](https://github.com/voxpupuli/puppet-jenkins/issues/513) - jenkins::plugin ignores version changes [\#512](https://github.com/voxpupuli/puppet-jenkins/issues/512) @@ -497,7 +497,7 @@ These should not affect the functionality of the module. - Plugins specified by version number are not updated [\#445](https://github.com/voxpupuli/puppet-jenkins/issues/445) - Passing an array to jenkins::plugin [\#429](https://github.com/voxpupuli/puppet-jenkins/issues/429) - Unable to persist firewall rules: Execution of '/usr/libexec/iptables/iptables.init save' returned 1: [\#424](https://github.com/voxpupuli/puppet-jenkins/issues/424) -- $::jenkins::port does not properly manage listening port [\#416](https://github.com/voxpupuli/puppet-jenkins/issues/416) +- $jenkins::port does not properly manage listening port [\#416](https://github.com/voxpupuli/puppet-jenkins/issues/416) - Using Plugin Hash Exec Test for plugin Fails [\#410](https://github.com/voxpupuli/puppet-jenkins/issues/410) - jenkins::job::present issue [\#409](https://github.com/voxpupuli/puppet-jenkins/issues/409) - Using Direct URL for plug-ins restarts jenkins with every puppet run [\#408](https://github.com/voxpupuli/puppet-jenkins/issues/408) @@ -518,7 +518,7 @@ These should not affect the functionality of the module. - replace centos-7-docker fakesystemd with classic flavor [\#550](https://github.com/voxpupuli/puppet-jenkins/pull/550) ([jhoblitt](https://github.com/jhoblitt)) - travis puppet versions [\#549](https://github.com/voxpupuli/puppet-jenkins/pull/549) ([jhoblitt](https://github.com/jhoblitt)) - fix beaker acceptance tests on Ubuntu [\#548](https://github.com/voxpupuli/puppet-jenkins/pull/548) ([jhoblitt](https://github.com/jhoblitt)) -- simplify ::jenkins::slave ordering logic [\#547](https://github.com/voxpupuli/puppet-jenkins/pull/547) ([jhoblitt](https://github.com/jhoblitt)) +- simplify jenkins::slave ordering logic [\#547](https://github.com/voxpupuli/puppet-jenkins/pull/547) ([jhoblitt](https://github.com/jhoblitt)) - skip pending beaker tests [\#546](https://github.com/voxpupuli/puppet-jenkins/pull/546) ([jhoblitt](https://github.com/jhoblitt)) - minor puppet\_helper.groovy cleanup [\#543](https://github.com/voxpupuli/puppet-jenkins/pull/543) ([jhoblitt](https://github.com/jhoblitt)) - Improve spec speed [\#537](https://github.com/voxpupuli/puppet-jenkins/pull/537) ([petems](https://github.com/petems)) @@ -638,7 +638,7 @@ These should not affect the functionality of the module. * [#275](https://github.com/jenkinsci/puppet-jenkins/pull/275) - add .bundle to .gitignore * [#276](https://github.com/jenkinsci/puppet-jenkins/pull/276) - add log/ to .gitignore * [#277](https://github.com/jenkinsci/puppet-jenkins/pull/277) - add puppet 3.7.0 to travis matrix -* [#278](https://github.com/jenkinsci/puppet-jenkins/pull/278) - remove unnecessary whitespace from $::jenkins::cli_helper::helper_cmd +* [#278](https://github.com/jenkinsci/puppet-jenkins/pull/278) - remove unnecessary whitespace from $jenkins::cli_helper::helper_cmd * [#279](https://github.com/jenkinsci/puppet-jenkins/pull/279) - add metadata-json-lint to Gemfile & enable rake validate target * [#280](https://github.com/jenkinsci/puppet-jenkins/pull/280) - change puppetlabs/stdlib version dep to >= 4.6.0 * [#282](https://github.com/jenkinsci/puppet-jenkins/pull/282) - Feature/puppet 4 diff --git a/HISTORY.md b/HISTORY.md index b58e28133..4c2d21a49 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -89,7 +89,7 @@ * [#275](https://github.com/jenkinsci/puppet-jenkins/pull/275) - add .bundle to .gitignore * [#276](https://github.com/jenkinsci/puppet-jenkins/pull/276) - add log/ to .gitignore * [#277](https://github.com/jenkinsci/puppet-jenkins/pull/277) - add puppet 3.7.0 to travis matrix -* [#278](https://github.com/jenkinsci/puppet-jenkins/pull/278) - remove unnecessary whitespace from $::jenkins::cli_helper::helper_cmd +* [#278](https://github.com/jenkinsci/puppet-jenkins/pull/278) - remove unnecessary whitespace from $jenkins::cli_helper::helper_cmd * [#279](https://github.com/jenkinsci/puppet-jenkins/pull/279) - add metadata-json-lint to Gemfile & enable rake validate target * [#280](https://github.com/jenkinsci/puppet-jenkins/pull/280) - change puppetlabs/stdlib version dep to >= 4.6.0 * [#282](https://github.com/jenkinsci/puppet-jenkins/pull/282) - Feature/puppet 4 diff --git a/NATIVE_TYPES_AND_PROVIDERS.md b/NATIVE_TYPES_AND_PROVIDERS.md index d9dd05deb..a49e974f2 100644 --- a/NATIVE_TYPES_AND_PROVIDERS.md +++ b/NATIVE_TYPES_AND_PROVIDERS.md @@ -114,11 +114,11 @@ master service to be running. Most require the presence of sufficiently for all providers to function. ``` -class { '::jenkins': +class { 'jenkins': install_java => true, cli => true, } -include ::jenkins::cli_helper +include jenkins::cli_helper ``` The ruby gem `retries` is presently required by all providers. diff --git a/README.md b/README.md index a3e98cb80..47f3801a7 100644 --- a/README.md +++ b/README.md @@ -35,12 +35,12 @@ This module has been adjusted to support the new CLI. The CLI supports proper authentication with username and password. It's a requirement for supporting AD and OpenID authentications (there is no ssh key -there). You can supply ```$::jenkins::cli_username``` and -```$::jenkins::cli_password``` to use username / password based authentication. +there). You can supply ```$jenkins::cli_username``` and +```$jenkins::cli_password``` to use username / password based authentication. Then the puppet automation user can also reside in A.D Note: Jenkins requires a ssh username, so you must also provide -```$::jenkins::cli_username``` for ssh. If you specify both username/password +```$jenkins::cli_username``` for ssh. If you specify both username/password and ssh key file, SSH authentication is preferred. # Using puppet-jenkins diff --git a/lib/puppet/parser/functions/jenkins_port.rb b/lib/puppet/parser/functions/jenkins_port.rb index 3461b050b..023eb8e0b 100644 --- a/lib/puppet/parser/functions/jenkins_port.rb +++ b/lib/puppet/parser/functions/jenkins_port.rb @@ -10,7 +10,7 @@ module Puppet::Parser::Functions $port = jenkins_port() ENDHEREDOC - config_hash = lookupvar('::jenkins::config_hash') + config_hash = lookupvar('jenkins::config_hash') config_hash&.dig('JENKINS_PORT', 'value') || 8080 end end diff --git a/lib/puppet/parser/functions/jenkins_prefix.rb b/lib/puppet/parser/functions/jenkins_prefix.rb index 80a6a55bd..444c5bcbf 100644 --- a/lib/puppet/parser/functions/jenkins_prefix.rb +++ b/lib/puppet/parser/functions/jenkins_prefix.rb @@ -10,7 +10,7 @@ module Puppet::Parser::Functions $prefix = jenkins_prefix() ENDHEREDOC - config_hash = lookupvar('::jenkins::config_hash') + config_hash = lookupvar('jenkins::config_hash') config_hash&.dig('PREFIX', 'value') || '' end end diff --git a/manifests/cli.pp b/manifests/cli.pp index abad8ebe6..29336b6ea 100644 --- a/manifests/cli.pp +++ b/manifests/cli.pp @@ -6,7 +6,7 @@ include jenkins # XXX Classes/defines which include the jenkins::cli class assume that they - # can use the cli even if $::jenkins::cli == false. This breaks the top + # can use the cli even if $jenkins::cli == false. This breaks the top # level anchor pattern. The cli param should either be deprecated and # essentially hardwired to true or attempting to use cli functionality # without this param set should fail; either option is a backwards @@ -72,7 +72,7 @@ require => File[$jar], } - # jenkins::cli::reload should be included only after $::jenkins::cli::cmd is + # jenkins::cli::reload should be included only after $jenkins::cli::cmd is # defined include jenkins::cli::reload } diff --git a/manifests/init.pp b/manifests/init.pp index 424b665ab..0f5e89761 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -325,7 +325,7 @@ if $cli_ssh_keyfile { # SSH key auth if empty($cli_username) { - fail('ERROR: Latest remoting free CLI (see https://issues.jenkins-ci.org/browse/JENKINS-41745) needs username for SSH Access (\$::jenkins::cli_username)') + fail('ERROR: Latest remoting free CLI (see https://issues.jenkins-ci.org/browse/JENKINS-41745) needs username for SSH Access (\$jenkins::cli_username)') } $_cli_auth_arg = "-i '${cli_ssh_keyfile}' -ssh -user '${cli_username}'" } elsif !empty($cli_username) { diff --git a/manifests/job/present.pp b/manifests/job/present.pp index d2d7194fa..dcfb891ee 100644 --- a/manifests/job/present.pp +++ b/manifests/job/present.pp @@ -62,7 +62,7 @@ $job_dir = "${jenkins::job_dir}/${jobname}" $config_path = "${job_dir}/config.xml" - # Bring variables from Class['::jenkins'] into local scope. + # Bring variables from Class['jenkins'] into local scope. $cli_tries = $jenkins::cli_tries $cli_try_sleep = $jenkins::cli_try_sleep diff --git a/spec/functions/jenkins_prefix_spec.rb b/spec/functions/jenkins_prefix_spec.rb index 7669011c2..4cd829c0d 100644 --- a/spec/functions/jenkins_prefix_spec.rb +++ b/spec/functions/jenkins_prefix_spec.rb @@ -9,7 +9,7 @@ context 'with default parameters' do let(:pre_condition) do - 'include ::jenkins' + 'include jenkins' end it { is_expected.to run.with_params.and_return('') } From fcb2326f0f89d5569638d22a54afaf0fe331bb1d Mon Sep 17 00:00:00 2001 From: markuszilch Date: Wed, 27 Mar 2024 00:31:50 +0100 Subject: [PATCH 02/27] remove deprecated function with native puppet --- manifests/user_setup.pp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/manifests/user_setup.pp b/manifests/user_setup.pp index 886ac3e4d..63fab79d1 100644 --- a/manifests/user_setup.pp +++ b/manifests/user_setup.pp @@ -55,10 +55,7 @@ # On Debian the service is started by default so it must be configured prior # to installation which is why it's configured in this file rather than config.pp - $config_hash = merge( - $jenkins::params::config_hash_defaults, - $jenkins::config_hash - ) + $config_hash = $jenkins::params::config_hash_defaults + $jenkins::config_hash systemd::dropin_file { 'puppet-overrides.conf': unit => 'jenkins.service', From 54aeb45d66fef7d53abe8d8cf4751ccd0840f0ca Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Tue, 23 Apr 2024 11:22:18 +0200 Subject: [PATCH 03/27] Add support for puppetlabs/java 11.x --- metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index f27c75554..d6a011dca 100644 --- a/metadata.json +++ b/metadata.json @@ -85,7 +85,7 @@ }, { "name": "puppetlabs/java", - "version_requirement": ">= 1.0.1 < 11.0.0" + "version_requirement": ">= 1.0.1 < 12.0.0" }, { "name": "puppet/zypprepo", From 36f63bc2388f48074d79e1e10e902213d6f83b91 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Tue, 23 Apr 2024 11:33:31 +0200 Subject: [PATCH 04/27] fixtures.yml: remove puppet version contraint --- .fixtures.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.fixtures.yml b/.fixtures.yml index 087ac25d1..31b4009e1 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -1,3 +1,4 @@ +--- fixtures: repositories: apt: "https://github.com/puppetlabs/puppetlabs-apt" @@ -6,9 +7,5 @@ fixtures: zypprepo: "https://github.com/voxpupuli/puppet-zypprepo.git" archive: "https://github.com/voxpupuli/puppet-archive.git" systemd: "https://github.com/voxpupuli/puppet-systemd" - yumrepo_core: - repo: https://github.com/puppetlabs/puppetlabs-yumrepo_core.git - puppet_version: ">= 6.0.0" - augeas_core: - repo: https://github.com/puppetlabs/puppetlabs-augeas_core.git - puppet_version: ">= 6.0.0" + yumrepo_core: https://github.com/puppetlabs/puppetlabs-yumrepo_core.git + augeas_core: https://github.com/puppetlabs/puppetlabs-augeas_core.git From 115ec0630af85cc73ec7229983ea1fbf3ab0749a Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Tue, 23 Apr 2024 12:38:47 +0200 Subject: [PATCH 05/27] fix cloudbees-folder CI - the plugin now requires `ionicons-api`, so install it - pin to 6.897.vb_943ea_6b_a_08b_ as newer versions are not compatible with Jenkins LTS releases --- spec/acceptance/xtypes/jenkins_job_spec.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spec/acceptance/xtypes/jenkins_job_spec.rb b/spec/acceptance/xtypes/jenkins_job_spec.rb index 21e9d8c99..1c14bba2c 100644 --- a/spec/acceptance/xtypes/jenkins_job_spec.rb +++ b/spec/acceptance/xtypes/jenkins_job_spec.rb @@ -107,7 +107,10 @@ <<-EOS include jenkins include jenkins::cli::config - jenkins::plugin { 'cloudbees-folder': } + jenkins::plugin { 'ionicons-api': } + jenkins::plugin { 'cloudbees-folder': + version => '6.897.vb_943ea_6b_a_08b_' + } EOS end From 0c4906319b2e6d45148c5dead692107f02f779a5 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Tue, 23 Apr 2024 13:06:04 +0200 Subject: [PATCH 06/27] fix ssh-credentials and aws-credentials CI missing dependencies --- spec/acceptance/xtypes/jenkins_credentials_spec.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spec/acceptance/xtypes/jenkins_credentials_spec.rb b/spec/acceptance/xtypes/jenkins_credentials_spec.rb index 265307afb..451f842e9 100644 --- a/spec/acceptance/xtypes/jenkins_credentials_spec.rb +++ b/spec/acceptance/xtypes/jenkins_credentials_spec.rb @@ -79,6 +79,7 @@ jenkins::plugin { [ 'ssh-credentials', + 'variant', 'trilead-api', ]: } @@ -195,6 +196,8 @@ 'credentials-binding', 'jackson2-api', 'jaxb', + 'joda-time-api', + 'json-api', 'plain-credentials', 'script-security', 'snakeyaml-api', From 08cb22b5d636e0d1439db58ca3b32f2067706667 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Tue, 23 Apr 2024 13:27:28 +0200 Subject: [PATCH 07/27] fix gitlab-plugin CI missing dependencies --- spec/acceptance/xtypes/jenkins_credentials_spec.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spec/acceptance/xtypes/jenkins_credentials_spec.rb b/spec/acceptance/xtypes/jenkins_credentials_spec.rb index 451f842e9..093de4874 100644 --- a/spec/acceptance/xtypes/jenkins_credentials_spec.rb +++ b/spec/acceptance/xtypes/jenkins_credentials_spec.rb @@ -235,6 +235,7 @@ include jenkins::cli::config package { 'git': } jenkins::plugin { [ + 'asm-api', 'apache-httpcomponents-client-4-api', 'bootstrap5-api', 'caffeine-api', @@ -248,14 +249,17 @@ 'git', 'git-client', 'gitlab-plugin', + 'gson-api', 'ionicons-api', 'jackson2-api', 'jakarta-activation-api', 'jakarta-mail-api', 'jaxb', 'jersey2-api', + 'joda-time-api', 'jquery3-api', 'jsch', + 'json-api', 'junit', 'mailer', 'matrix-project', @@ -270,6 +274,7 @@ 'ssh-credentials', 'sshd', 'trilead-api', + 'variant', 'workflow-api', 'workflow-job', 'workflow-scm-step', From cb0ade5ace4d0f0be0d17cb895c535ca3aa93722 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Tue, 23 Apr 2024 13:27:59 +0200 Subject: [PATCH 08/27] fix browserstack-integration CI missing dependencies --- spec/acceptance/xtypes/jenkins_credentials_spec.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spec/acceptance/xtypes/jenkins_credentials_spec.rb b/spec/acceptance/xtypes/jenkins_credentials_spec.rb index 093de4874..6f8199302 100644 --- a/spec/acceptance/xtypes/jenkins_credentials_spec.rb +++ b/spec/acceptance/xtypes/jenkins_credentials_spec.rb @@ -308,6 +308,7 @@ include jenkins::cli::config jenkins::plugin { [ 'ace-editor', + 'asm-api', 'apache-httpcomponents-client-4-api', 'bootstrap5-api', 'browserstack-integration', @@ -322,8 +323,12 @@ 'font-awesome-api', 'ionicons-api', 'jackson2-api', + 'jakarta-activation-api', + 'jakarta-mail-api', 'jaxb', + 'joda-time-api', 'jquery3-api', + 'json-api', 'junit', 'mailer', 'plain-credentials', @@ -334,6 +339,7 @@ 'snakeyaml-api', 'ssh-credentials', 'trilead-api', + 'variant', 'workflow-api', 'workflow-basic-steps', 'workflow-cps', From a82e268f9f6203e89513420bc34273e52f3c8d99 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Tue, 23 Apr 2024 15:13:57 +0200 Subject: [PATCH 09/27] also install optional dependencies while these are not required for tests to run, their absence still spams the logs with "Plugin is missing" errors, making it really hard to find actual issues --- spec/acceptance/xtypes/jenkins_credentials_spec.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/spec/acceptance/xtypes/jenkins_credentials_spec.rb b/spec/acceptance/xtypes/jenkins_credentials_spec.rb index 6f8199302..a193e83ed 100644 --- a/spec/acceptance/xtypes/jenkins_credentials_spec.rb +++ b/spec/acceptance/xtypes/jenkins_credentials_spec.rb @@ -40,11 +40,16 @@ include jenkins::cli::config jenkins::plugin { [ + 'apache-httpcomponents-client-4-api', + 'caffeine-api', 'command-launcher', + 'gson-api', 'jaxb', 'jdk-tool', + 'mina-sshd-api-common', 'mina-sshd-api-core', 'phabricator-plugin', + 'script-security', 'sshd', 'trilead-api', ]: } @@ -78,6 +83,7 @@ include jenkins::cli::config jenkins::plugin { [ + 'gson-api', 'ssh-credentials', 'variant', 'trilead-api', @@ -194,6 +200,7 @@ 'aws-java-sdk-ssm', 'caffeine-api', 'credentials-binding', + 'gson-api', 'jackson2-api', 'jaxb', 'joda-time-api', @@ -321,6 +328,7 @@ 'durable-task', 'echarts-api', 'font-awesome-api', + 'gson-api', 'ionicons-api', 'jackson2-api', 'jakarta-activation-api', From 0f96dc339a6a8bed0006a8f4842961db4b923d8b Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Tue, 23 Apr 2024 18:48:30 +0200 Subject: [PATCH 10/27] set purge_plugins => true when testing different credential plugins otherwise previous runs leave plugins installed which can influence test execution --- .../xtypes/jenkins_credentials_spec.rb | 40 ++++++++++++++----- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/spec/acceptance/xtypes/jenkins_credentials_spec.rb b/spec/acceptance/xtypes/jenkins_credentials_spec.rb index a193e83ed..72b7cd69c 100644 --- a/spec/acceptance/xtypes/jenkins_credentials_spec.rb +++ b/spec/acceptance/xtypes/jenkins_credentials_spec.rb @@ -8,7 +8,9 @@ context 'UsernamePasswordCredentialsImpl' do it 'works with no errors and idempotently' do pp = <<-EOS - include jenkins + class {'jenkins': + purge_plugins => true, + } include jenkins::cli::config jenkins_credentials { '9b07d668-a87e-4877-9407-ae05056e32ac': ensure => 'present', @@ -36,7 +38,9 @@ context 'ConduitCredentialsImpl' do it 'works with no errors and idempotently' do pp = <<-EOS - include jenkins + class {'jenkins': + purge_plugins => true, + } include jenkins::cli::config jenkins::plugin { [ @@ -79,7 +83,9 @@ context 'BasicSSHUserPrivateKey' do it 'works with no errors and idempotently' do pp = <<-EOS - include jenkins + class {'jenkins': + purge_plugins => true, + } include jenkins::cli::config jenkins::plugin { [ @@ -116,7 +122,9 @@ context 'StringCredentialsImpl' do it 'works with no errors and idempotently' do pp = <<-EOS - include jenkins + class {'jenkins': + purge_plugins => true, + } include jenkins::cli::config jenkins::plugin { 'plain-credentials': pin => true, @@ -147,7 +155,9 @@ context 'FileCredentialsImpl' do it 'works with no errors and idempotently' do pp = <<-EOS - include jenkins + class {'jenkins': + purge_plugins => true, + } include jenkins::cli::config jenkins::plugin { 'plain-credentials': pin => true, @@ -179,7 +189,9 @@ context 'AWSCredentialsImpl' do it 'works with no errors and idempotently' do pp = <<-EOS - include jenkins + class {'jenkins': + purge_plugins => true, + } include jenkins::cli::config jenkins::plugin { [ 'apache-httpcomponents-client-4-api', @@ -238,7 +250,9 @@ context 'GitLabApiTokenImpl' do it 'works with no errors and idempotently' do pp = <<-EOS - include jenkins + class {'jenkins': + purge_plugins => true, + } include jenkins::cli::config package { 'git': } jenkins::plugin { [ @@ -311,7 +325,9 @@ context 'BrowserStackCredentials' do pp = <<-EOS - include jenkins + class {'jenkins': + purge_plugins => true, + } include jenkins::cli::config jenkins::plugin { [ 'ace-editor', @@ -389,7 +405,9 @@ context 'StringCredentialsImpl' do it 'works with no errors and idempotently' do pp = <<-EOS - include jenkins + class {'jenkins': + purge_plugins => true, + } include jenkins::cli::config jenkins::plugin { 'plain-credentials': } @@ -418,7 +436,9 @@ context 'FileCredentialsImpl' do it 'works with no errors and idempotently' do pp = <<-EOS - include jenkins + class {'jenkins': + purge_plugins => true, + } include jenkins::cli::config jenkins::plugin { 'plain-credentials': pin => true, From 423d3d2215a5334dfba916ebbc8cafdbc5bed802 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Tue, 23 Apr 2024 19:15:26 +0200 Subject: [PATCH 11/27] don't pin plain-credentials plugin no idea why it was pinned in the past, but pinning seems to miss-behave when we use purge_plugins=>true in tests and breaks idempotency tests --- spec/acceptance/xtypes/jenkins_credentials_spec.rb | 3 --- 1 file changed, 3 deletions(-) diff --git a/spec/acceptance/xtypes/jenkins_credentials_spec.rb b/spec/acceptance/xtypes/jenkins_credentials_spec.rb index 72b7cd69c..a26861e44 100644 --- a/spec/acceptance/xtypes/jenkins_credentials_spec.rb +++ b/spec/acceptance/xtypes/jenkins_credentials_spec.rb @@ -127,7 +127,6 @@ class {'jenkins': } include jenkins::cli::config jenkins::plugin { 'plain-credentials': - pin => true, } jenkins_credentials { '150b2895-b0eb-4813-b8a5-3779690c063c': @@ -160,7 +159,6 @@ class {'jenkins': } include jenkins::cli::config jenkins::plugin { 'plain-credentials': - pin => true, } jenkins_credentials { '95bfe159-8bf0-4605-be20-47e201220e7c': @@ -441,7 +439,6 @@ class {'jenkins': } include jenkins::cli::config jenkins::plugin { 'plain-credentials': - pin => true, } jenkins_credentials { '95bfe159-8bf0-4605-be20-47e201220e7c': From cb975d48fffb1fa4e2e44d957606e9e6510a4260 Mon Sep 17 00:00:00 2001 From: Alexander Over Date: Thu, 28 Jul 2022 11:44:40 +0200 Subject: [PATCH 12/27] Add download option to jenkins module This allows forcing HTTP 1.1 per official suggestion[1], since HTTP 2 regularly fails when downloading. cURL on RHEL7 doesn't support HTTP 2 and thus does not have a --http1.1 switch. [1]: https://github.com/jenkins-infra/helpdesk/issues/3078#issuecomment-1198084336 --- manifests/plugin.pp | 45 +++++++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 1fb6f7558..595c71393 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -45,17 +45,21 @@ # Pin the plugin to a specific version. This prevents the updater from # updating it. # +# @param download_options +# Add options to Archive's curl +# define jenkins::plugin ( - Optional[String] $version = undef, - Optional[String] $config_filename = undef, - Optional[String] $config_content = undef, - Optional[String] $update_url = undef, - Optional[String] $source = undef, - Enum['hpi', 'jpi'] $extension = 'hpi', - Optional[String] $digest_string = undef, - Boolean $enabled = true, - String $digest_type = 'sha1', - Boolean $pin = false, + Optional[String] $version = undef, + Optional[String] $config_filename = undef, + Optional[String] $config_content = undef, + Optional[String] $update_url = undef, + Optional[String] $source = undef, + Enum['hpi', 'jpi'] $extension = 'hpi', + Optional[String] $digest_string = undef, + Boolean $enabled = true, + String $digest_type = 'sha1', + Boolean $pin = false, + Array[String[1]] $download_options = ($facts['os']['family'] == 'RedHat' and $facts['os']['release']['major'] == '7') ? { true => [], default => ['--http1.1'] }, ) { include jenkins @@ -186,16 +190,17 @@ command => "/bin/rm -rf ${jenkins::plugin_dir}/${plugin}", } -> archive { $plugin: - source => $download_url, - path => "${jenkins::plugin_dir}/${plugin}", - checksum_verify => $checksum_verify, - checksum => $checksum, - checksum_type => $checksum_type, - proxy_server => $jenkins::proxy::url, - cleanup => false, - extract => false, - require => $plugindir, - notify => $notify, + source => $download_url, + path => "${jenkins::plugin_dir}/${plugin}", + checksum_verify => $checksum_verify, + checksum => $checksum, + checksum_type => $checksum_type, + proxy_server => $jenkins::proxy::url, + cleanup => false, + extract => false, + require => $plugindir, + notify => $notify, + download_options => $download_options, } $archive_require = Archive[$plugin] } else { From 20ee279993de2857d7d022b6fb5492728f18a583 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Fri, 15 Dec 2023 13:19:40 +0100 Subject: [PATCH 13/27] modulesync 7.2.0 --- .github/workflows/ci.yml | 2 +- .github/workflows/release.yml | 2 +- .msync.yml | 2 +- .pmtignore | 1 + Gemfile | 8 +++----- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8a0779116..b66d8ca74 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,6 +13,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' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 15f172134..55324aa62 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: diff --git a/.msync.yml b/.msync.yml index dd3e95722..f8183449f 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: '7.0.0' +modulesync_config_version: '7.2.0' diff --git a/.pmtignore b/.pmtignore index 58a040887..10b983069 100644 --- a/.pmtignore +++ b/.pmtignore @@ -35,3 +35,4 @@ /.yardoc/ /.yardopts /Dockerfile +/HISTORY.md diff --git a/Gemfile b/Gemfile index 7e02fe691..3174d3c09 100644 --- a/Gemfile +++ b/Gemfile @@ -7,7 +7,7 @@ group :test do gem 'voxpupuli-test', '~> 7.0', :require => false gem 'coveralls', :require => false gem 'simplecov-console', :require => false - gem 'puppet_metadata', '~> 3.0', :require => false + gem 'puppet_metadata', '~> 3.5', :require => false gem 'retries', :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 From 896ebd05e6f21616657b2de170a8e974dda4ce84 Mon Sep 17 00:00:00 2001 From: markuszilch Date: Tue, 6 Feb 2024 12:33:32 +0100 Subject: [PATCH 14/27] modulesync 7.3.0 --- .github/workflows/ci.yml | 7 ++++++- .msync.yml | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b66d8ca74..7216724fd 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 }} diff --git a/.msync.yml b/.msync.yml index f8183449f..f46ee025e 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: '7.2.0' +modulesync_config_version: '7.3.0' From 5c4a0ddf767500e5fcdad79a1cee956e4cb3937b Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Fri, 12 Apr 2024 13:26:24 +0200 Subject: [PATCH 15/27] modulesync 7.4.0 --- .github/CONTRIBUTING.md | 16 +++++++++++++--- .gitignore | 2 ++ .msync.yml | 2 +- Dockerfile | 24 ------------------------ 4 files changed, 16 insertions(+), 28 deletions(-) delete mode 100644 Dockerfile diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 6aaa603ff..880932740 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 diff --git a/.gitignore b/.gitignore index 84fd904ca..adea1b017 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 f46ee025e..28b61dcfe 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: '7.3.0' +modulesync_config_version: '7.4.0' diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 8dd82d636..000000000 --- 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 From aeaa39bf408ab7e311fc53cadf70982b69c207de Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Wed, 24 Apr 2024 12:34:35 +0200 Subject: [PATCH 16/27] update hieradata structure for voxpupuli-acceptance 3.x --- spec/acceptance/hieradata/{os => family}/RedHat.yaml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename spec/acceptance/hieradata/{os => family}/RedHat.yaml (100%) diff --git a/spec/acceptance/hieradata/os/RedHat.yaml b/spec/acceptance/hieradata/family/RedHat.yaml similarity index 100% rename from spec/acceptance/hieradata/os/RedHat.yaml rename to spec/acceptance/hieradata/family/RedHat.yaml From ec805836f7a9920df4efde2a02428dc510d8a405 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Sat, 13 Oct 2018 16:36:22 +0200 Subject: [PATCH 17/27] Remove retries gem This removes the retries gem in favor of the built in RetryAction. This does swap the parameter cli_try_sleep for the built in exponential backoff. It also raises a RetriesExceeded exception instead of the original exception. Since those aren't caught explicitly, that's not really a huge difference. RetryAction logs at the info level which exception has been caught. --- .sync.yml | 4 - Gemfile | 1 - NATIVE_TYPES_AND_PROVIDERS.md | 9 -- lib/puppet/feature/retries.rb | 5 - lib/puppet/x/jenkins/config.rb | 1 - lib/puppet/x/jenkins/provider/cli.rb | 17 +-- manifests/cli/config.pp | 18 --- spec/classes/cli/config_spec.rb | 20 ---- spec/unit/puppet/x/jenkins/config_spec.rb | 7 +- .../puppet/x/jenkins/provider/cli_spec.rb | 104 ++---------------- spec/unit/puppet/x/spec_jenkins_providers.rb | 13 --- 11 files changed, 17 insertions(+), 182 deletions(-) delete mode 100644 lib/puppet/feature/retries.rb diff --git a/.sync.yml b/.sync.yml index c645ca804..35775e974 100644 --- a/.sync.yml +++ b/.sync.yml @@ -1,7 +1,3 @@ --- -Gemfile: - optional: - ':test': - - gem: 'retries' .rubocop.yml: unmanaged: true diff --git a/Gemfile b/Gemfile index 3174d3c09..a4a3b2043 100644 --- a/Gemfile +++ b/Gemfile @@ -8,7 +8,6 @@ group :test do gem 'coveralls', :require => false gem 'simplecov-console', :require => false gem 'puppet_metadata', '~> 3.5', :require => false - gem 'retries', :require => false end group :development do diff --git a/NATIVE_TYPES_AND_PROVIDERS.md b/NATIVE_TYPES_AND_PROVIDERS.md index d9dd05deb..083546f4c 100644 --- a/NATIVE_TYPES_AND_PROVIDERS.md +++ b/NATIVE_TYPES_AND_PROVIDERS.md @@ -121,8 +121,6 @@ class { '::jenkins': include ::jenkins::cli_helper ``` -The ruby gem `retries` is presently required by all providers. - ### `puppetserver` There is a known issue with `puppetserver` being unable to load code from @@ -141,13 +139,6 @@ jruby-puppet: { See [SERVER-973](https://tickets.puppetlabs.com/browse/SERVER-973) -Additionally, the `retries` gem is required. This may be installed on the master by running: - -``` -/opt/puppetlabs/bin/puppetserver gem install retries -``` - - Types -- diff --git a/lib/puppet/feature/retries.rb b/lib/puppet/feature/retries.rb deleted file mode 100644 index 426565f6a..000000000 --- a/lib/puppet/feature/retries.rb +++ /dev/null @@ -1,5 +0,0 @@ -# frozen_string_literal: true - -require 'puppet/util/feature' - -Puppet.features.add(:retries, libs: 'retries') diff --git a/lib/puppet/x/jenkins/config.rb b/lib/puppet/x/jenkins/config.rb index 1a0556d89..e32c8092a 100644 --- a/lib/puppet/x/jenkins/config.rb +++ b/lib/puppet/x/jenkins/config.rb @@ -18,7 +18,6 @@ class UnknownConfig < ArgumentError; end ssh_private_key: nil, puppet_helper: '/usr/share/java/puppet_helper.groovy', cli_tries: 30, - cli_try_sleep: 2, cli_username: nil, cli_password: nil, cli_password_file: '/tmp/jenkins_credentials_for_puppet', diff --git a/lib/puppet/x/jenkins/provider/cli.rb b/lib/puppet/x/jenkins/provider/cli.rb index 6057cdc48..c979940ea 100644 --- a/lib/puppet/x/jenkins/provider/cli.rb +++ b/lib/puppet/x/jenkins/provider/cli.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'puppet/provider' +require 'puppet/util/retry_action' require 'facter' require 'json' @@ -31,7 +32,6 @@ def self.inherited(subclass) # rubocop:todo Lint/MissingSuper initvars commands java: 'java' - confine feature: :retries # subclasses should inherit this value once it has been determined that # jenkins requires authorization, it shortens the run time be elemating the @@ -170,7 +170,6 @@ def self.execute_with_retry(command, options = {}, cli_pre_cmd = []) url = config[:url] ssh_private_key = config[:ssh_private_key] cli_tries = config[:cli_tries] - cli_try_sleep = config[:cli_try_sleep] cli_username = config[:cli_username] cli_password = config[:cli_password] cli_password_file = config[:cli_password_file] @@ -202,16 +201,7 @@ def self.execute_with_retry(command, options = {}, cli_pre_cmd = []) # retry on "unknown" execution errors but don't catch AuthErrors. If an # AuthError has bubbled up to this level it means either an ssh_private_key # is required and we don't have one or that one we have was rejected. - handler = proc do |exception, attempt_number, total_delay| - Puppet.debug("#{sname} caught #{exception.class.to_s.match(%r{::([^:]+)$})[1]}; retry attempt #{attempt_number}; #{total_delay.round(3)} seconds have passed") - end - with_retries( - max_tries: cli_tries, - base_sleep_seconds: 1, - max_sleep_seconds: cli_try_sleep, - rescue: [UnknownError, NetError], - handler: handler - ) do + Puppet::Util::RetryAction.retry_action(retries: cli_tries, retry_exceptions: [UnknownError, NetError]) do result = execute_with_auth(cli_cmd, auth_cmd, options) Puppet.debug("#{sname} command stdout:\n#{result}") unless result == '' return result @@ -262,7 +252,8 @@ def self.execute_exceptionify(cmd, options) 'SEVERE: I/O error in channel CLI connection', 'java.net.SocketException: Connection reset', 'java.net.ConnectException: Connection refused', - 'java.io.IOException: Failed to connect' + 'java.io.IOException: Failed to connect', + 'java.io.IOException: Server returned HTTP response code: 503' ] if options.key?(:tmpfile_as_param) diff --git a/manifests/cli/config.pp b/manifests/cli/config.pp index 1c815ba67..0b1e71ec6 100644 --- a/manifests/cli/config.pp +++ b/manifests/cli/config.pp @@ -17,28 +17,10 @@ Boolean $cli_password_file_exists = false, Optional[String] $ssh_private_key_content = undef, ) { - if str2bool($facts['is_pe']) { - $gem_provider = 'pe_gem' - # lint:ignore:legacy_facts - } elsif $facts['rubysitedir'] and ('/opt/puppetlabs/puppet/lib/ruby' in $facts['rubysitedir']) { - # lint:endignore - # AIO puppet - $gem_provider = 'puppet_gem' - } else { - $gem_provider = 'gem' - } - # lint:ignore:legacy_facts $is_root = $facts['id'] == 'root' # lint:endignore - # required by PuppetX::Jenkins::Provider::Clihelper base - if ! defined(Package['retries']) { - package { 'retries': - provider => $gem_provider, - } - } - if $ssh_private_key and $ssh_private_key_content { file { $ssh_private_key: ensure => 'file', diff --git a/spec/classes/cli/config_spec.rb b/spec/classes/cli/config_spec.rb index 9069004ba..4b998bf2a 100644 --- a/spec/classes/cli/config_spec.rb +++ b/spec/classes/cli/config_spec.rb @@ -126,26 +126,6 @@ end end end - - describe 'package gem provider' do - context 'is_pe fact' do - context 'true' do - let :facts do - super().merge(is_pe: true) - end - - it { is_expected.to contain_package('retries').with(provider: 'pe_gem') } - end - - context 'false' do - let :facts do - super().merge(is_pe: false) - end - - it { is_expected.to contain_package('retries').with(provider: 'gem') } - end - end - end end end end diff --git a/spec/unit/puppet/x/jenkins/config_spec.rb b/spec/unit/puppet/x/jenkins/config_spec.rb index 02221d7d1..583c47bb0 100644 --- a/spec/unit/puppet/x/jenkins/config_spec.rb +++ b/spec/unit/puppet/x/jenkins/config_spec.rb @@ -10,8 +10,7 @@ url: 'http://localhost:8080', ssh_private_key: nil, puppet_helper: '/usr/share/java/puppet_helper.groovy', - cli_tries: 30, - cli_try_sleep: 2 + cli_tries: 30 }.freeze shared_context 'facts' do @@ -21,7 +20,6 @@ Facter.add(:jenkins_ssh_private_key) { setcode { 'fact.id_rsa' } } Facter.add(:jenkins_puppet_helper) { setcode { 'fact.groovy' } } Facter.add(:jenkins_cli_tries) { setcode { 22 } } - Facter.add(:jenkins_cli_try_sleep) { setcode { 33 } } end end @@ -126,8 +124,7 @@ url: 'http://localhost:111', ssh_private_key: 'cat.id_rsa', puppet_helper: 'cat.groovy', - cli_tries: 222, - cli_try_sleep: 333 + cli_tries: 222 ) catalog.add_resource jenkins diff --git a/spec/unit/puppet/x/jenkins/provider/cli_spec.rb b/spec/unit/puppet/x/jenkins/provider/cli_spec.rb index b74e067ec..744c6f103 100644 --- a/spec/unit/puppet/x/jenkins/provider/cli_spec.rb +++ b/spec/unit/puppet/x/jenkins/provider/cli_spec.rb @@ -3,9 +3,6 @@ require 'spec_helper' require 'unit/puppet/x/spec_jenkins_providers' -# we need to make sure retries is always loaded or random test ordering can -# cause failures when a side effect hasn't yet caused the lib to be loaded -require 'retries' require 'puppet/x/jenkins/provider/cli' describe Puppet::X::Jenkins::Provider::Cli do @@ -38,7 +35,6 @@ Facter.add(:jenkins_puppet_helper) { setcode { 'fact.groovy' } } Facter.add(:jenkins_cli_username) { setcode { 'myuser' } } Facter.add(:jenkins_cli_tries) { setcode { 22 } } - Facter.add(:jenkins_cli_try_sleep) { setcode { 33 } } end end @@ -316,13 +312,6 @@ end describe '::cli' do - before do - # disable with_retries sleeping to [vastly] speed up testing - # - # we are relying the side effects of ::suitable? from a previous example - Retries.sleep_enabled = false - end - shared_examples 'uses default values' do it 'uses default values' do expect(described_class.superclass).to receive(:execute).with( @@ -400,8 +389,7 @@ url: 'http://localhost:111', ssh_private_key: 'cat.id_rsa', cli_username: 'myuser', - cli_tries: 222, - cli_try_sleep: 333 + cli_tries: 222 ) catalog.add_resource jenkins @@ -423,10 +411,8 @@ context 'without ssh_private_key' do CLI_AUTH_ERRORS.each do |error| it 'does not retry cli on AuthError exception' do - expect(described_class.superclass).to receive(:execute).with( - 'java -jar /usr/share/java/jenkins-cli.jar -s http://localhost:8080 -logger WARNING foo', - failonfail: true, combine: true - ).and_raise(AuthError, error) + expect(described_class).to receive(:execute_with_auth).once.and_raise(AuthError, error) + expect(Puppet::Util::RetryAction).not_to receive(:sleep) expect { described_class.cli('foo') }. to raise_error(AuthError) @@ -490,14 +476,12 @@ context 'network failure' do context 'without ssh_private_key' do CLI_NET_ERRORS.each do |error| - it 'does not retry cli on AuthError exception' do - expect(described_class.superclass).to receive(:execute).with( - 'java -jar /usr/share/java/jenkins-cli.jar -s http://localhost:8080 -logger WARNING foo', - failonfail: true, combine: true - ).exactly(30).times.and_raise(NetError, error) + it 'retries cli on NetError exception' do + expect(described_class).to receive(:execute_with_auth).exactly(31).times.and_raise(NetError, error) + expect(Puppet::Util::RetryAction).to receive(:sleep).exactly(30).times expect { described_class.cli('foo') }. - to raise_error(NetError) + to raise_error(Puppet::Util::RetryAction::RetryException::RetriesExceeded) end end end @@ -514,10 +498,7 @@ ) catalog.add_resource jenkins - expect(described_class.superclass).to receive(:execute).with( - 'java -jar /usr/share/java/jenkins-cli.jar -s http://localhost:8080 -logger WARNING foo', - failonfail: true, combine: true - ).exactly(30).times.and_raise(UnknownError, 'foo') + expect(Puppet::Util::RetryAction).to receive(:retry_action).with(retries: 30, retry_exceptions: [UnknownError, NetError]).and_raise(UnknownError, 'foo') expect { described_class.cli('foo', catalog: catalog) }. to raise_error(UnknownError, 'foo') @@ -530,10 +511,7 @@ ) catalog.add_resource jenkins - expect(described_class.superclass).to receive(:execute).with( - 'java -jar /usr/share/java/jenkins-cli.jar -s http://localhost:8080 -logger WARNING foo', - failonfail: true, combine: true - ).twice.and_raise(UnknownError, 'foo') + expect(Puppet::Util::RetryAction).to receive(:retry_action).with(retries: 2, retry_exceptions: [UnknownError, NetError]).and_raise(UnknownError, 'foo') expect { described_class.cli('foo', catalog: catalog) }. to raise_error(UnknownError, 'foo') @@ -547,10 +525,7 @@ ) catalog.add_resource jenkins - expect(described_class.superclass).to receive(:execute).with( - 'java -jar /usr/share/java/jenkins-cli.jar -s http://localhost:8080 -logger WARNING foo', - failonfail: true, combine: true - ).exactly(3).times.and_raise(UnknownError, 'foo') + expect(Puppet::Util::RetryAction).to receive(:retry_action).with(retries: 3, retry_exceptions: [UnknownError, NetError]).and_raise(UnknownError, 'foo') expect { described_class.cli('foo', catalog: catalog) }. to raise_error(UnknownError, 'foo') @@ -565,69 +540,12 @@ ) catalog.add_resource jenkins - expect(described_class.superclass).to receive(:execute).with( - 'java -jar /usr/share/java/jenkins-cli.jar -s http://localhost:8080 -logger WARNING foo', - failonfail: true, combine: true - ).twice.and_raise(UnknownError, 'foo') + expect(Puppet::Util::RetryAction).to receive(:retry_action).with(retries: 2, retry_exceptions: [UnknownError, NetError]).and_raise(UnknownError, 'foo') expect { described_class.cli('foo', catalog: catalog) }. to raise_error(UnknownError, 'foo') end end - - context 'waiting up to n seconds' do - # this isn't behavioral testing because we don't want to either wait - # for the wallclock delay timeout or attempt to accurate time examples - it 'by default' do - jenkins = Puppet::Type.type(:component).new( - name: 'jenkins::cli::config' - ) - catalog.add_resource jenkins - - expect(described_class).to receive(:with_retries).with(hash_including(max_sleep_seconds: 2)) - - described_class.cli('foo', catalog: catalog) - end - - it 'from catalog value' do - jenkins = Puppet::Type.type(:component).new( - name: 'jenkins::cli::config', - cli_try_sleep: 3 - ) - catalog.add_resource jenkins - - expect(described_class).to receive(:with_retries).with(hash_including(max_sleep_seconds: 3)) - - described_class.cli('foo', catalog: catalog) - end - - it 'from fact' do - Facter.add(:jenkins_cli_try_sleep) { setcode { 4 } } - - jenkins = Puppet::Type.type(:component).new( - name: 'jenkins::cli::config' - ) - catalog.add_resource jenkins - - expect(described_class).to receive(:with_retries).with(hash_including(max_sleep_seconds: 4)) - - described_class.cli('foo', catalog: catalog) - end - - it 'from catalog overriding fact' do - Facter.add(:jenkins_cli_try_sleep) { setcode { 4 } } - - jenkins = Puppet::Type.type(:component).new( - name: 'jenkins::cli::config', - cli_try_sleep: 3 - ) - catalog.add_resource jenkins - - expect(described_class).to receive(:with_retries).with(hash_including(max_sleep_seconds: 3)) - - described_class.cli('foo', catalog: catalog) - end - end end context 'options with :stdinjson' do diff --git a/spec/unit/puppet/x/spec_jenkins_providers.rb b/spec/unit/puppet/x/spec_jenkins_providers.rb index 4e144433d..51a2701cf 100644 --- a/spec/unit/puppet/x/spec_jenkins_providers.rb +++ b/spec/unit/puppet/x/spec_jenkins_providers.rb @@ -8,19 +8,6 @@ described_class.confine_collection.instance_variable_get(:@confines) end - it 'has no matched confines' do - expect(described_class.confine_collection.summary).to eq({}) - end - - context 'feature :retries' do - it do - expect(confines).to include( - be_a(Puppet::Confine::Feature). - and(have_attributes(values: [:retries])) - ) - end - end - context 'commands :java' do it do expect(confines).to include( From f3db646307454f1a9d0bfc84c11ea538285d71f7 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Tue, 23 Apr 2024 11:24:08 +0200 Subject: [PATCH 18/27] Add support for Puppet 8 --- metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index d6a011dca..6b5463f00 100644 --- a/metadata.json +++ b/metadata.json @@ -103,7 +103,7 @@ "requirements": [ { "name": "puppet", - "version_requirement": ">= 7.0.0 < 8.0.0" + "version_requirement": ">= 7.0.0 < 9.0.0" } ] } From 765ea8cd56adbdcdab1078a520140f9f4b2cf8fe Mon Sep 17 00:00:00 2001 From: markuszilch Date: Thu, 25 Apr 2024 17:16:53 +0200 Subject: [PATCH 19/27] modulesync 7.5.0 --- .msync.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.msync.yml b/.msync.yml index 28b61dcfe..ade23f9ea 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: '7.4.0' +modulesync_config_version: '7.5.0' From ec61bf0841af4dfe37e1c74766531503cb5bad7a Mon Sep 17 00:00:00 2001 From: Christoph Maser Date: Fri, 26 Apr 2024 12:59:35 +0200 Subject: [PATCH 20/27] update puppet-systemd upper bound to 8.0.0 --- metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index 6b5463f00..a17edcaa5 100644 --- a/metadata.json +++ b/metadata.json @@ -97,7 +97,7 @@ }, { "name": "puppet/systemd", - "version_requirement": ">= 3.1.0 < 7.0.0" + "version_requirement": ">= 3.1.0 < 8.0.0" } ], "requirements": [ From 833706db1e1bb1f5018f8f5b6a0699900f8e2cd5 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Tue, 7 May 2024 13:32:12 +0200 Subject: [PATCH 21/27] pin workflow-job plugin to a version compatible with Jenkins LTS 2.440 is the latest LTS Jenkins, but newer workflow-job versions need 2.454+ --- spec/acceptance/xtypes/jenkins_credentials_spec.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/spec/acceptance/xtypes/jenkins_credentials_spec.rb b/spec/acceptance/xtypes/jenkins_credentials_spec.rb index a26861e44..d778aa3a8 100644 --- a/spec/acceptance/xtypes/jenkins_credentials_spec.rb +++ b/spec/acceptance/xtypes/jenkins_credentials_spec.rb @@ -295,11 +295,13 @@ class {'jenkins': 'trilead-api', 'variant', 'workflow-api', - 'workflow-job', 'workflow-scm-step', 'workflow-step-api', 'workflow-support', ]: } + jenkins::plugin { 'workflow-job': + version => '1400.v7fd111b_ec82f' + } jenkins_credentials { '7e86e9fb-a8af-480f-b596-7191dc02bf38': ensure => 'present', @@ -366,11 +368,13 @@ class {'jenkins': 'workflow-basic-steps', 'workflow-cps', 'workflow-durable-task-step', - 'workflow-job', 'workflow-scm-step', 'workflow-step-api', 'workflow-support', ]: } + jenkins::plugin { 'workflow-job': + version => '1400.v7fd111b_ec82f' + } jenkins_credentials { '562fa23d-a441-4cab-997f-58df6e245813': ensure => 'present', From 6cc537e6fde7233c699e62390715d31b1ab71170 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Tue, 7 May 2024 13:37:59 +0200 Subject: [PATCH 22/27] CentOS: Drop EoL 7/8 support Both are soonish EoL so we should drop them. --- metadata.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/metadata.json b/metadata.json index a17edcaa5..b054b6fb0 100644 --- a/metadata.json +++ b/metadata.json @@ -24,8 +24,6 @@ { "operatingsystem": "CentOS", "operatingsystemrelease": [ - "7", - "8", "9" ] }, From 4d1a0e45f951b40a5e34049370fb21c1666f503b Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Tue, 7 May 2024 12:23:11 +0200 Subject: [PATCH 23/27] Release 5.0.0 --- CHANGELOG.md | 18 ++++++++++++++++++ metadata.json | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c40a053cd..4dba11a9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,24 @@ All notable changes to this project will be documented in this file. Each new release typically also includes the latest modulesync defaults. These should not affect the functionality of the module. +## [v5.0.0](https://github.com/voxpupuli/puppet-jenkins/tree/v5.0.0) (2024-05-07) + +[Full Changelog](https://github.com/voxpupuli/puppet-jenkins/compare/v4.0.0...v5.0.0) + +**Breaking changes:** + +- CentOS: Drop EoL 7/8 support [\#1106](https://github.com/voxpupuli/puppet-jenkins/pull/1106) ([bastelfreak](https://github.com/bastelfreak)) +- Use native Puppet instead of the retries Gem in the CLI provider, replacing try\_sleep parameter by exponential backoff [\#904](https://github.com/voxpupuli/puppet-jenkins/pull/904) ([ekohl](https://github.com/ekohl)) + +**Implemented enhancements:** + +- update puppet-systemd upper bound to 8.0.0 [\#1102](https://github.com/voxpupuli/puppet-jenkins/pull/1102) ([TheMeier](https://github.com/TheMeier)) +- Add support for Puppet 8 [\#1095](https://github.com/voxpupuli/puppet-jenkins/pull/1095) ([evgeni](https://github.com/evgeni)) +- Add support for puppetlabs/java 11.x [\#1094](https://github.com/voxpupuli/puppet-jenkins/pull/1094) ([evgeni](https://github.com/evgeni)) +- replace deprecated `merge` function with native puppet [\#1092](https://github.com/voxpupuli/puppet-jenkins/pull/1092) ([zilchms](https://github.com/zilchms)) +- Remove legacy top-scope syntax [\#1084](https://github.com/voxpupuli/puppet-jenkins/pull/1084) ([smortex](https://github.com/smortex)) +- Add download option to jenkins module [\#1073](https://github.com/voxpupuli/puppet-jenkins/pull/1073) ([ekohl](https://github.com/ekohl)) + ## [v4.0.0](https://github.com/voxpupuli/puppet-jenkins/tree/v4.0.0) (2023-09-29) [Full Changelog](https://github.com/voxpupuli/puppet-jenkins/compare/v3.3.0...v4.0.0) diff --git a/metadata.json b/metadata.json index b054b6fb0..96db7e28f 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "puppet-jenkins", - "version": "4.0.0", + "version": "5.0.0", "author": "Vox Pupuli", "license": "Apache-2.0", "summary": "Manage the Jenkins continuous integration service with Puppet", From 8abe55d0c0541c332575411359ff7a6043f328d8 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Tue, 7 May 2024 14:57:50 +0200 Subject: [PATCH 24/27] [blacksmith] Bump version to 5.0.1-rc0 --- metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index 96db7e28f..6d81305eb 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "puppet-jenkins", - "version": "5.0.0", + "version": "5.0.1-rc0", "author": "Vox Pupuli", "license": "Apache-2.0", "summary": "Manage the Jenkins continuous integration service with Puppet", From c24a5110f6f541660ed04ef4d12b3c597144a0e4 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Mon, 3 Jun 2024 18:45:12 +0200 Subject: [PATCH 25/27] modulesync 8.0.1 --- .github/workflows/ci.yml | 2 -- .msync.yml | 2 +- .overcommit.yml | 8 +++++--- .rspec | 5 ----- .rspec_parallel | 4 ---- Gemfile | 4 ++-- 6 files changed, 8 insertions(+), 17 deletions(-) delete mode 100644 .rspec delete mode 100644 .rspec_parallel diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7216724fd..1f82c4c93 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,5 +19,3 @@ jobs: puppet: name: Puppet uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v2 - with: - pidfile_workaround: 'false' diff --git a/.msync.yml b/.msync.yml index ade23f9ea..876cb3b02 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: '7.5.0' +modulesync_config_version: '8.0.1' diff --git a/.overcommit.yml b/.overcommit.yml index d367adaea..4ed994cc5 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/.rspec b/.rspec deleted file mode 100644 index f634583de..000000000 --- a/.rspec +++ /dev/null @@ -1,5 +0,0 @@ -# Managed by modulesync - DO NOT EDIT -# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ - ---format documentation ---color diff --git a/.rspec_parallel b/.rspec_parallel deleted file mode 100644 index a9a84f852..000000000 --- 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/Gemfile b/Gemfile index a4a3b2043..ec7b4cd33 100644 --- a/Gemfile +++ b/Gemfile @@ -4,10 +4,10 @@ source ENV['GEM_SOURCE'] || 'https://rubygems.org' group :test do - gem 'voxpupuli-test', '~> 7.0', :require => false + gem 'voxpupuli-test', '~> 7.2', :require => false gem 'coveralls', :require => false gem 'simplecov-console', :require => false - gem 'puppet_metadata', '~> 3.5', :require => false + gem 'puppet_metadata', '~> 4.0', :require => false end group :development do From d44d14e44559d371bec0e2006f6d823857a5491f Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Wed, 12 Jun 2024 11:27:04 +0200 Subject: [PATCH 26/27] modulesync 9.0.0 --- .github/labeler.yml | 3 +++ .msync.yml | 2 +- Gemfile | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 .github/labeler.yml diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 000000000..7899de848 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,3 @@ +--- +skip-changelog: + - head-branch: ['^release-*', 'release'] diff --git a/.msync.yml b/.msync.yml index 876cb3b02..36071685f 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: '8.0.1' +modulesync_config_version: '9.0.0' diff --git a/Gemfile b/Gemfile index ec7b4cd33..27cdc0de2 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ source ENV['GEM_SOURCE'] || 'https://rubygems.org' group :test do - gem 'voxpupuli-test', '~> 7.2', :require => false + gem 'voxpupuli-test', '~> 8.0', :require => false gem 'coveralls', :require => false gem 'simplecov-console', :require => false gem 'puppet_metadata', '~> 4.0', :require => false From e6e6e2bd669b281ae6916a49f48a62259098c18a Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Tue, 9 Jul 2024 15:16:10 +0200 Subject: [PATCH 27/27] modulesync 9.1.0 --- .github/CONTRIBUTING.md | 12 ++++++++-- .github/labeler.yml | 3 +++ .github/release.yml | 42 +++++++++++++++++++++++++++++++++++ .github/workflows/labeler.yml | 17 ++++++++++++++ .github/workflows/release.yml | 7 ++++++ .msync.yml | 2 +- .puppet-lint.rc | 3 +++ Gemfile | 2 +- spec/spec_helper.rb | 4 ++++ 9 files changed, 88 insertions(+), 4 deletions(-) create mode 100644 .github/release.yml create mode 100644 .github/workflows/labeler.yml diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 880932740..daceb642f 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -245,15 +245,23 @@ with: BEAKER_PUPPET_COLLECTION=puppet7 BEAKER_setfile=debian11-64 bundle exec rake beaker ``` +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: * ubuntu2004 * ubuntu2204 * debian11 -* centos7 -* centos8 +* debian12 * centos9 +* archlinux * almalinux8 * almalinux9 * fedora36 diff --git a/.github/labeler.yml b/.github/labeler.yml index 7899de848..f2d08d6b4 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,3 +1,6 @@ --- +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ + skip-changelog: - head-branch: ['^release-*', 'release'] diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 000000000..f5b5d7a99 --- /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/labeler.yml b/.github/workflows/labeler.yml new file mode 100644 index 000000000..66127cd0b --- /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 55324aa62..93b33c2bc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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/.msync.yml b/.msync.yml index 36071685f..95e8c977c 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: '9.0.0' +modulesync_config_version: '9.1.0' diff --git a/.puppet-lint.rc b/.puppet-lint.rc index dd8272c7b..05d28a260 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/Gemfile b/Gemfile index 27cdc0de2..7123c6636 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ source ENV['GEM_SOURCE'] || 'https://rubygems.org' group :test do - gem 'voxpupuli-test', '~> 8.0', :require => false + gem 'voxpupuli-test', '~> 9.0', :require => false gem 'coveralls', :require => false gem 'simplecov-console', :require => false gem 'puppet_metadata', '~> 4.0', :require => false diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 9efb4ae62..58c9b66ab 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'))