Skip to content

Commit f9657a0

Browse files
Merge pull request #38 from tkishel/forge_scores
(maint) correct lint issues found on forge
2 parents 9032cd4 + 8bdd2c9 commit f9657a0

13 files changed

+61
-57
lines changed

.puppet-lint.rc

-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
11
--relative
2-
--no-2sp_soft_tabs-check
3-
--no-arrow_alignment-check

.rubocop.yml

+7
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ GetText/DecorateString:
2727
Description: We don't want to decorate test output.
2828
Exclude:
2929
- spec/**/*
30+
Enabled: false
3031
RSpec/BeforeAfterAll:
3132
Description: Beware of using after(:all) as it may cause state to leak between tests.
3233
A necessary evil in acceptance testing.
@@ -88,6 +89,12 @@ Style/MethodCalledOnDoEndBlock:
8889
Enabled: true
8990
Style/StringMethods:
9091
Enabled: true
92+
GetText/DecorateFunctionMessage:
93+
Enabled: false
94+
GetText/DecorateStringFormattingUsingInterpolation:
95+
Enabled: false
96+
GetText/DecorateStringFormattingUsingPercent:
97+
Enabled: false
9198
Layout/EndOfLine:
9299
Enabled: false
93100
Layout/IndentHeredoc:

.sync.yml

-5
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@ spec/default_facts.yml:
1818
processors:
1919
"count": 8
2020

21-
Rakefile:
22-
extra_disabled_lint_checks:
23-
- '2sp_soft_tabs'
24-
- 'arrow_alignment'
25-
2621
.travis.yml:
2722
includes:
2823
- env: PUPPET_GEM_VERSION="= 4.6.1" CHECK=parallel_spec

.travis.yml

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,30 @@
11
---
2+
os: linux
23
dist: xenial
34
language: ruby
45
cache: bundler
56
before_install:
67
- bundle -v
78
- rm -f Gemfile.lock
8-
- gem update --system $RUBYGEMS_VERSION
9+
- "# Update system gems if requested. This is useful to temporarily workaround troubles in the test runner"
10+
- "# See https://github.com/puppetlabs/pdk-templates/commit/705154d5c437796b821691b707156e1b056d244f for an example of how this was used"
11+
- "# Ignore exit code of SIGPIPE'd yes to not fail with shell's pipefail set"
12+
- '[ -z "$RUBYGEMS_VERSION" ] || (yes || true) | gem update --system $RUBYGEMS_VERSION'
913
- gem --version
1014
- bundle -v
1115
script:
1216
- 'bundle exec rake $CHECK'
1317
bundler_args: --without system_tests
1418
rvm:
15-
- 2.5.3
19+
- 2.5.7
1620
stages:
1721
- static
1822
- spec
1923
- acceptance
2024
-
2125
if: tag =~ ^v\d
2226
name: deploy
23-
matrix:
27+
jobs:
2428
fast_finish: true
2529
include:
2630
-
@@ -32,14 +36,11 @@ matrix:
3236
stage: spec
3337
-
3438
env: PUPPET_GEM_VERSION="~> 6.0" CHECK=parallel_spec
35-
rvm: 2.5.3
39+
rvm: 2.5.7
3640
stage: spec
3741
-
3842
env: DEPLOY_TO_FORGE=yes
3943
stage: deploy
40-
-
41-
env: PUPPET_GEM_VERSION="= 4.6.1" CHECK=parallel_spec
42-
rvm: 2.1.9
4344
branches:
4445
only:
4546
- master

Gemfile

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ group :development do
2424
gem "json", '= 2.0.4', require: false if Gem::Requirement.create('~> 2.4.2').satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
2525
gem "json", '= 2.1.0', require: false if Gem::Requirement.create(['>= 2.5.0', '< 2.7.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
2626
gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw]
27-
gem "puppet-module-posix-default-r#{minor_version}", '~> 0.3', require: false, platforms: [:ruby]
28-
gem "puppet-module-posix-dev-r#{minor_version}", '~> 0.3', require: false, platforms: [:ruby]
29-
gem "puppet-module-win-default-r#{minor_version}", '~> 0.3', require: false, platforms: [:mswin, :mingw, :x64_mingw]
30-
gem "puppet-module-win-dev-r#{minor_version}", '~> 0.3', require: false, platforms: [:mswin, :mingw, :x64_mingw]
27+
gem "puppet-module-posix-default-r#{minor_version}", '~> 0.4', require: false, platforms: [:ruby]
28+
gem "puppet-module-posix-dev-r#{minor_version}", '~> 0.4', require: false, platforms: [:ruby]
29+
gem "puppet-module-win-default-r#{minor_version}", '~> 0.4', require: false, platforms: [:mswin, :mingw, :x64_mingw]
30+
gem "puppet-module-win-dev-r#{minor_version}", '~> 0.4', require: false, platforms: [:mswin, :mingw, :x64_mingw]
3131
end
3232

3333
puppet_version = ENV['PUPPET_GEM_VERSION']

Rakefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'puppet_litmus/rake_tasks' if Bundler.rubygems.find_name('puppet_litmus').any?
24
require 'puppetlabs_spec_helper/rake_tasks'
35
require 'puppet-syntax/tasks/puppet-syntax'
@@ -39,8 +41,6 @@ def changelog_future_release
3941
end
4042

4143
PuppetLint.configuration.send('disable_relative')
42-
PuppetLint.configuration.send('disable_2sp_soft_tabs')
43-
PuppetLint.configuration.send('disable_arrow_alignment')
4444

4545
if Bundler.rubygems.find_name('github_changelog_generator').any?
4646
GitHubChangelogGenerator::RakeTask.new :changelog do |config|

manifests/init.pp

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@
2929
if $manage_postgresql_settings and (versioncmp('2018.1.0', $facts['pe_server_version']) > 0) {
3030
include pe_databases::postgresql_settings
3131
class { 'pe_databases::postgresql_settings::table_settings' :
32-
manage_reports_autovacuum_cost_delay => $pe_databases::postgresql_settings::manage_reports_autovacuum_cost_delay,
33-
factsets_autovacuum_vacuum_scale_factor => $pe_databases::postgresql_settings::factsets_autovacuum_vacuum_scale_factor,
34-
reports_autovacuum_vacuum_scale_factor => $pe_databases::postgresql_settings::reports_autovacuum_vacuum_scale_factor,
35-
require => Class['pe_databases::postgresql_settings'],
32+
manage_reports_autovacuum_cost_delay => $pe_databases::postgresql_settings::manage_reports_autovacuum_cost_delay,
33+
factsets_autovacuum_vacuum_scale_factor => $pe_databases::postgresql_settings::factsets_autovacuum_vacuum_scale_factor,
34+
reports_autovacuum_vacuum_scale_factor => $pe_databases::postgresql_settings::reports_autovacuum_vacuum_scale_factor,
35+
require => Class['pe_databases::postgresql_settings'],
3636
}
3737
} elsif $manage_table_settings {
3838
# This is to provide for situations, like PE XL,

manifests/maintenance/pg_repack.pp

+16-12
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,25 @@
1515

1616
# PE 2019.1 starting shipping versioned pe-postgres packages where all paths are versioned.
1717
# So, prior to 2019.1 use a non-versioned path, and after use a versioned path.
18-
18+
# TODO: Use $pe_databases::psql_version after identifying why it is cast to ${psql_version}00000 in spec tests.
1919
$postgresql_version = $facts['pe_postgresql_info']['installed_server_version']
2020
$repack_executable = versioncmp('2019.1.0', $facts['pe_server_version']) ? {
21-
1 => '/opt/puppetlabs/server/apps/postgresql/bin/pg_repack',
22-
default => "/opt/puppetlabs/server/apps/postgresql/${$postgresql_version}/bin/pg_repack" }
21+
1 => '/opt/puppetlabs/server/apps/postgresql/bin/pg_repack',
22+
default => "/opt/puppetlabs/server/apps/postgresql/${postgresql_version}/bin/pg_repack"
23+
}
2324

2425
$repack = "su - pe-postgres -s /bin/bash -c \"${repack_executable} -d pe-puppetdb"
2526
$repack_jobs = "--jobs ${jobs}"
2627

2728
$facts_tables = '-t factsets -t fact_paths"'
2829
$catalogs_tables = '-t catalogs -t catalog_resources -t edges -t certnames"'
2930
$other_tables = '-t producers -t resource_params -t resource_params_cache"'
31+
3032
$reports_tables = versioncmp('2019.1.0', $facts['pe_server_version']) ? {
31-
1 => '-t reports"',
32-
default => '-t reports -t resource_events"' }
33+
1 => '-t reports"',
34+
default => '-t reports -t resource_events"'
35+
}
36+
3337
$logging = "> ${logging_directory}/output.log 2>&1"
3438

3539
Cron {
@@ -40,16 +44,16 @@
4044

4145
cron { 'pg_repack facts tables' :
4246
weekday => [2,6],
43-
hour => 4,
44-
minute => 30,
45-
command => "${repack} ${repack_jobs} ${facts_tables} ${logging}",
47+
hour => 4,
48+
minute => 30,
49+
command => "${repack} ${repack_jobs} ${facts_tables} ${logging}",
4650
}
4751

4852
cron { 'pg_repack catalogs tables' :
49-
weekday => [0,4],
50-
hour => 4,
51-
minute => 30,
52-
command => "${repack} ${repack_jobs} ${catalogs_tables} ${logging}",
53+
weekday => [0,4],
54+
hour => 4,
55+
minute => 30,
56+
command => "${repack} ${repack_jobs} ${catalogs_tables} ${logging}",
5357
}
5458

5559
cron { 'pg_repack other tables' :

manifests/maintenance/vacuum_full.pp

+11-11
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,23 @@
2929
}
3030

3131
Cron {
32-
ensure => $ensure_cron,
33-
user => 'root',
34-
require => File[$logging_directory, $script_directory],
32+
ensure => $ensure_cron,
33+
user => 'root',
34+
require => File[$logging_directory, $script_directory],
3535
}
3636

3737
cron { 'VACUUM FULL facts tables' :
38-
weekday => [2,6],
39-
hour => 4,
40-
minute => 30,
41-
command => "${vacuum_script_path} facts",
38+
weekday => [2,6],
39+
hour => 4,
40+
minute => 30,
41+
command => "${vacuum_script_path} facts",
4242
}
4343

4444
cron { 'VACUUM FULL catalogs tables' :
45-
weekday => [0,4],
46-
hour => 4,
47-
minute => 30,
48-
command => "${vacuum_script_path} catalogs",
45+
weekday => [0,4],
46+
hour => 4,
47+
minute => 30,
48+
command => "${vacuum_script_path} catalogs",
4949
}
5050

5151
cron { 'VACUUM FULL other tables' :

manifests/postgresql_settings/table_settings.pp

+3-6
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,9 @@
44

55
class pe_databases::postgresql_settings::table_settings (
66
# lint:ignore:140chars
7-
Boolean $manage_reports_autovacuum_cost_delay = lookup('pe_databases::postgresql_settings::manage_reports_autovacuum_cost_delay',
8-
{'default_value' => true}),
9-
Optional[Float[0,1]] $factsets_autovacuum_vacuum_scale_factor = lookup('pe_databases::postgresql_settings::factsets_autovacuum_vacuum_scale_factor',
10-
{'default_value' => 0.80}),
11-
Optional[Float[0,1]] $reports_autovacuum_vacuum_scale_factor = lookup('pe_databases::postgresql_settings::reports_autovacuum_vacuum_scale_factor',
12-
{'default_value' => 0.01}),
7+
Boolean $manage_reports_autovacuum_cost_delay = lookup('pe_databases::postgresql_settings::manage_reports_autovacuum_cost_delay', {'default_value' => true}),
8+
Optional[Float[0,1]] $factsets_autovacuum_vacuum_scale_factor = lookup('pe_databases::postgresql_settings::factsets_autovacuum_vacuum_scale_factor', {'default_value' => 0.80}),
9+
Optional[Float[0,1]] $reports_autovacuum_vacuum_scale_factor = lookup('pe_databases::postgresql_settings::reports_autovacuum_vacuum_scale_factor', {'default_value' => 0.01}),
1310
Optional[Float[0,1]] $catalogs_autovacuum_vacuum_scale_factor = 0.75,
1411
Optional[Float[0,1]] $certnames_autovacuum_vacuum_scale_factor = 0.75,
1512
# lint:endignore

metadata.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
"version_requirement": ">= 5.5.0"
7878
}
7979
],
80-
"pdk-version": "1.14.0.pre (heads/master-0-g9158517)",
81-
"template-url": "https://github.com/puppetlabs/pdk-templates#add_circleci_and_azure_pipelines_support",
82-
"template-ref": "remotes/origin/add_circleci_and_azure_pipelines_support-0-gdc89556"
80+
"pdk-version": "1.17.0",
81+
"template-url": "https://github.com/puppetlabs/pdk-templates#master",
82+
"template-ref": "tags/1.17.0-0-gd3a4319"
8383
}

spec/default_facts.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Facts specified here will override the values provided by rspec-puppet-facts.
44
---
55
ipaddress: "172.16.254.254"
6+
ipaddress6: "FE80:0000:0000:0000:AAAA:AAAA:AAAA"
67
is_pe: false
78
macaddress: "AA:AA:AA:AA:AA:AA"
89
pe_server_version: 2018.1.0
@@ -14,4 +15,3 @@ processors:
1415
count: 8
1516
pe_postgresql_info:
1617
installed_server_version: 9.6
17-

spec/spec_helper.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
RSpec.configure do |c|
24
c.mock_with :rspec
35
end

0 commit comments

Comments
 (0)