From d34ca46dc22db429feee67a93775a26e3c227a92 Mon Sep 17 00:00:00 2001 From: david22swan Date: Wed, 20 Apr 2022 11:07:46 +0100 Subject: [PATCH 1/4] (maint) PDK Update --- .github/workflows/nightly.yml | 2 +- .github/workflows/spec.yml | 8 ++++---- metadata.json | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index f19d652df..bf335e2c6 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -200,5 +200,5 @@ jobs: repo_token: ${{ secrets.GITHUB_TOKEN }} slack_webhook_url: ${{ secrets.SLACK_WEBHOOK }} # Optional Input - channel: '#team-ia-bots' + channel: '#team-cat-bots' name: 'GABot' diff --git a/.github/workflows/spec.yml b/.github/workflows/spec.yml index 2f6aa5361..6c1ae10d8 100644 --- a/.github/workflows/spec.yml +++ b/.github/workflows/spec.yml @@ -54,10 +54,10 @@ jobs: buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment' echo STEP_ID=Setup-Acceptance-Test-Matrix >> $GITHUB_ENV echo STEP_START=$(date +%s) >> $GITHUB_ENV -# - name: Run Static & Syntax Tests -# if: ${{ github.repository_owner == 'puppetlabs' }} -# run: | -# buildevents cmd $TRACE_ID $STEP_ID 'static_syntax_checks' -- bundle exec rake syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop + - name: Run Static & Syntax Tests + if: ${{ github.repository_owner == 'puppetlabs' }} + run: | + buildevents cmd $TRACE_ID $STEP_ID 'static_syntax_checks' -- bundle exec rake syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop - name: Setup Spec Test Matrix id: get-matrix diff --git a/metadata.json b/metadata.json index 752623098..74effc308 100644 --- a/metadata.json +++ b/metadata.json @@ -86,6 +86,6 @@ ], "description": "MySQL module", "template-url": "https://github.com/puppetlabs/pdk-templates#main", - "template-ref": "heads/main-0-gf3911d3", + "template-ref": "heads/main-0-g806810b", "pdk-version": "2.3.0" } From d88a64ea8ebf8ba2a64c45644992f34a25f852b8 Mon Sep 17 00:00:00 2001 From: david22swan Date: Mon, 25 Apr 2022 12:03:15 +0100 Subject: [PATCH 2/4] (maint) syntax:hiera:yaml fixes --- manifests/backup/mysqlbackup.pp | 2 +- manifests/bindings.pp | 9 +++------ manifests/params.pp | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/manifests/backup/mysqlbackup.pp b/manifests/backup/mysqlbackup.pp index 2e7f0731e..ca04d4e07 100644 --- a/manifests/backup/mysqlbackup.pp +++ b/manifests/backup/mysqlbackup.pp @@ -107,7 +107,7 @@ 'incremental_base' => 'history:last_backup', 'incremental_backup_dir' => $backupdir, 'user' => $backupuser, - 'password' => $backuppassword_unsensitive + 'password' => $backuppassword_unsensitive, }, } $options = mysql::normalise_and_deepmerge($default_options, $mysql::server::override_options) diff --git a/manifests/bindings.pp b/manifests/bindings.pp index 6e29f625a..abdd5528b 100644 --- a/manifests/bindings.pp +++ b/manifests/bindings.pp @@ -102,14 +102,11 @@ ) inherits mysql::params { case $::osfamily { 'Archlinux': { - if $java_enable { fail("::mysql::bindings::java cannot be managed by puppet on ${::facts['os']['family']} - as it is not in official repositories. Please disable java mysql binding.") } + if $java_enable { fail("::mysql::bindings::java cannot be managed by puppet on ${::facts['os']['family']} as it is not in official repositories. Please disable java mysql binding.") } if $perl_enable { include 'mysql::bindings::perl' } - if $php_enable { warning("::mysql::bindings::php does not need to be managed by puppet on ${::facts['os']['family']} - as it is included in mysql package by default.") } + if $php_enable { warning("::mysql::bindings::php does not need to be managed by puppet on ${::facts['os']['family']} as it is included in mysql package by default.") } if $python_enable { include 'mysql::bindings::python' } - if $ruby_enable { fail("::mysql::bindings::ruby cannot be managed by puppet on %{::facts['os']['family']} - as it is not in official repositories. Please disable ruby mysql binding.") } + if $ruby_enable { fail("::mysql::bindings::ruby cannot be managed by puppet on ${::facts['os']['family']} as it is not in official repositories. Please disable ruby mysql binding.") } } default: { diff --git a/manifests/params.pp b/manifests/params.pp index cfd1d387a..35b29fc07 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -227,7 +227,7 @@ $xtrabackup_package_name_override = 'percona-xtrabackup-24' } if ($::operatingsystem == 'Ubuntu' and versioncmp($::operatingsystemrelease, '20.04') >= 0) or - ($::operatingsystem == 'Debian' and versioncmp($::operatingsystemrelease, '11') >= 0){ + ($::operatingsystem == 'Debian' and versioncmp($::operatingsystemrelease, '11') >= 0) { $python_package_name = 'python3-mysqldb' } else { $python_package_name = 'python-mysqldb' From 1e25921edecc6d494c4f52a6e23e1b3a42d0b531 Mon Sep 17 00:00:00 2001 From: david22swan Date: Mon, 25 Apr 2022 12:04:06 +0100 Subject: [PATCH 3/4] (GH-cat-9) syntax:hiera:yaml exclusions added --- .puppet-lint.rc | 7 +++++++ .sync.yml | 9 +++++++++ Rakefile | 8 +++++++- metadata.json | 2 +- 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/.puppet-lint.rc b/.puppet-lint.rc index cc96ece05..cff88308a 100644 --- a/.puppet-lint.rc +++ b/.puppet-lint.rc @@ -1 +1,8 @@ --relative +--no-parameter_types-check +--no-parameter_documentation-check +--no-legacy_facts-check +--no-top_scope_facts-check +--no-anchor_resource-check +--no-relative_classname_reference-check +--no-params_empty_string_assignment-check diff --git a/.sync.yml b/.sync.yml index e91376f32..71e3b8b9b 100644 --- a/.sync.yml +++ b/.sync.yml @@ -41,3 +41,12 @@ Rakefile: .travis.yml: delete: true changelog_since_tag: 'v11.0.3' +Rakefile: + extra_disabled_lint_checks: + - parameter_types + - parameter_documentation + - legacy_facts + - top_scope_facts + - anchor_resource + - relative_classname_reference + - params_empty_string_assignment diff --git a/Rakefile b/Rakefile index 2a95d3e9e..9ceb18bf5 100644 --- a/Rakefile +++ b/Rakefile @@ -42,6 +42,13 @@ def changelog_future_release end PuppetLint.configuration.send('disable_relative') +PuppetLint.configuration.send('disable_parameter_types') +PuppetLint.configuration.send('disable_parameter_documentation') +PuppetLint.configuration.send('disable_legacy_facts') +PuppetLint.configuration.send('disable_top_scope_facts') +PuppetLint.configuration.send('disable_anchor_resource') +PuppetLint.configuration.send('disable_relative_classname_reference') +PuppetLint.configuration.send('disable_params_empty_string_assignment') if Bundler.rubygems.find_name('github_changelog_generator').any? @@ -50,7 +57,6 @@ if Bundler.rubygems.find_name('github_changelog_generator').any? config.user = "#{changelog_user}" config.project = "#{changelog_project}" config.since_tag = "v11.0.3" - config.max_issues = 500 config.future_release = "#{changelog_future_release}" config.exclude_labels = ['maintenance'] config.header = "# Change log\n\nAll notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org)." diff --git a/metadata.json b/metadata.json index 74effc308..e24ef2c1b 100644 --- a/metadata.json +++ b/metadata.json @@ -87,5 +87,5 @@ "description": "MySQL module", "template-url": "https://github.com/puppetlabs/pdk-templates#main", "template-ref": "heads/main-0-g806810b", - "pdk-version": "2.3.0" + "pdk-version": "2.4.0" } From 8095cce0affc3b8359a129685cef2f036dd1ae87 Mon Sep 17 00:00:00 2001 From: david22swan Date: Mon, 25 Apr 2022 12:09:10 +0100 Subject: [PATCH 4/4] (GH-cat-9) Rubocop fixes --- lib/facter/mysql_server_id.rb | 8 +++----- lib/puppet/provider/mysql_grant/mysql.rb | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/facter/mysql_server_id.rb b/lib/facter/mysql_server_id.rb index ec8cd996a..171b908d9 100644 --- a/lib/facter/mysql_server_id.rb +++ b/lib/facter/mysql_server_id.rb @@ -15,10 +15,8 @@ def mysql_id_get Facter.add('mysql_server_id') do setcode do - begin - mysql_id_get - rescue - nil - end + mysql_id_get + rescue + nil end end diff --git a/lib/puppet/provider/mysql_grant/mysql.rb b/lib/puppet/provider/mysql_grant/mysql.rb index bc2605188..d18fa6dd9 100644 --- a/lib/puppet/provider/mysql_grant/mysql.rb +++ b/lib/puppet/provider/mysql_grant/mysql.rb @@ -69,7 +69,7 @@ def self.instances sorted_privileges = ['ALL'] # Currently there is an issue with the behaviour of the module which was highlighted by the 'complex test' test case in 'mysql_grant_spec'. The module, upon retrieving all privileges from an - # user, does not take into account that the latest version of mysql now includes dynamic privileges which are returned alongside the original static privileges and are set by 'ALL PRIVILEGES' + # user, does not take into account that the latest version of mysql now includes dynamic privileges which are returned alongside the original static privileges and are set by 'ALL PRIVILEGES' # (shortened to 'ALL'). This is a workaround to remove the unnecesary privileges from the sorted_privileges list which is used to check for idempotency in test cases. elsif sorted_privileges == ['ALL', 'APPLICATION_PASSWORD_ADMIN', 'AUDIT_ABORT_EXEMPT', 'AUDIT_ADMIN', 'AUTHENTICATION_POLICY_ADMIN', 'BACKUP_ADMIN', 'BINLOG_ADMIN', 'BINLOG_ENCRYPTION_ADMIN', 'CLONE_ADMIN', 'CONNECTION_ADMIN', 'ENCRYPTION_KEY_ADMIN', 'FLUSH_OPTIMIZER_COSTS', 'FLUSH_STATUS', 'FLUSH_TABLES', 'FLUSH_USER_RESOURCES',