Skip to content

Commit bfdccbc

Browse files
(SIMP-7305) Update HighLine packaged by simp-cli (#150)
* Updated SIMP-packaged HighLine 1.7.8 to HighLine 2.0.3. * Updated the simp-cli code and unit tests to work with the new HighLine version. * Minimal changes * Updated Rakefile. * Updated the pkg:gem target (used by the pkg:rpm target) to exclude HighLine's optional gems in the 'code_quality" group from the bundle used to build the gem. * One dependency of those gems requires 'cmake' to be installed on the system. We don't need extra cruft when we are building simp-cli RPMs. * Reworked spec-related Rake tasks, as puppet-provided spec, spec_standalone, etc are no longer included in the dependency chain. * Added in simp:ci_* rake tasks so I could validate .gitlab-ci.yml changes. * Updated Gemfile. * Updated to the latest simp-beaker-helpers to pick up the FIPS-mode test fixes and then re-enabled FIPS-mode acceptance tests. * Updated acceptance tests. * Fixed unreliable password setting acceptance test. * Now uses an expect script. * Set ClientAlive* sshd settings in an attempt to minimize beaker ssh failures connection on slow GitLab servers. * Updated versions of Puppet and Ruby in CI to better match SIMP-6.5.0. SIMP-7305 #close SIMP-8406 #close
1 parent e99c62b commit bfdccbc

97 files changed

Lines changed: 3867 additions & 5952 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.fixtures.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ fixtures:
1010
simplib: https://github.com/simp/pupmod-simp-simplib
1111
stdlib: https://github.com/simp/puppetlabs-stdlib
1212

13+
# To set ClientAlive* settings for sshd_config
14+
augeasproviders_core: https://github.com/simp/augeasproviders_core
15+
augeasproviders_ssh: https://github.com/simp/augeasproviders_ssh
16+
1317
# Other assets
1418
# - WARNING: rsync data does not remain intact through the fixtures copy
1519
# process...Required empty directories are removed!

.gitlab-ci.yml

Lines changed: 37 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
# The testing matrix considers ruby/puppet versions supported by SIMP and PE:
22
#
3-
# https://puppet.com/docs/pe/2019.0/component_versions_in_recent_pe_releases.html
3+
# https://puppet.com/docs/pe/2019.8/component_versions_in_recent_pe_releases.html
44
# https://puppet.com/misc/puppet-enterprise-lifecycle
55
# https://puppet.com/docs/pe/2018.1/overview/getting_support_for_pe.html
66
# ------------------------------------------------------------------------------
77
# Release Puppet Ruby EOL
8-
# SIMP 6.3 5.5.16 2.4.5 TBD***
9-
# PE 2018.1 5.5.16 2.4.5 2020-05 (LTS)***
10-
# PE 2019.0 6.0 2.5.1 2019-08-31^^^
8+
# SIMP 6.4 5.5 2.4.10 TBD***
9+
# SIMP 6.5 6.18 2.5.8
10+
# PE 2018.1 5.5 2.4.10 2021-01
11+
# PE 2019.8.1 6.17 2.5.8 2021-11 (LTS)
1112
#
1213
# *** = Modules created for SIMP 6.3+ are not required to support Puppet < 5.5
1314
---
@@ -69,10 +70,10 @@ variables:
6970
BEAKER_PUPPET_COLLECTION: 'puppet5'
7071
MATRIX_RUBY_VERSION: '2.4'
7172

72-
.pup_5_5_16: &pup_5_5_16
73+
.pup_5_5_20: &pup_5_5_20
7374
image: 'ruby:2.4'
7475
variables:
75-
PUPPET_VERSION: '5.5.16'
76+
PUPPET_VERSION: '5.5.20'
7677
BEAKER_PUPPET_COLLECTION: 'puppet5'
7778
MATRIX_RUBY_VERSION: '2.4'
7879

@@ -83,6 +84,14 @@ variables:
8384
BEAKER_PUPPET_COLLECTION: 'puppet6'
8485
MATRIX_RUBY_VERSION: '2.5'
8586

87+
.pup_6_18_0: &pup_6_18_0
88+
image: 'ruby:2.5'
89+
variables:
90+
PUPPET_VERSION: '6.18.0'
91+
BEAKER_PUPPET_COLLECTION: 'puppet6'
92+
MATRIX_RUBY_VERSION: '2.5'
93+
94+
8695
# Testing Environments
8796
#-----------------------------------------------------------------------
8897

@@ -126,33 +135,35 @@ pup5-unit:
126135
<<: *pup_5
127136
<<: *unit_tests
128137

129-
pup5.5.16-unit:
130-
<<: *pup_5_5_16
138+
pup5.5.20-unit:
139+
<<: *pup_5_5_20
131140
<<: *unit_tests
132141

133142
pup6-unit:
134143
<<: *pup_6
135144
<<: *unit_tests
136145

146+
pup6.18.0-unit:
147+
<<: *pup_6_18_0
148+
<<: *unit_tests
149+
150+
137151
# Acceptance tests
138152
# ==============================================================================
139-
pup5.5.16:
140-
<<: *pup_5_5_16
153+
pup5.5.20:
154+
<<: *pup_5_5_20
141155
<<: *acceptance_base
142156
script:
143157
- 'bundle exec rake beaker:suites[default,default]'
144158

145-
# Re-enable after SIMP-8406 and SIMP-7305 are fixed. We don't even
146-
# want to run with allowed failure, because the attempt to reconnect
147-
# after reboot during FIPS setup can take more than an hour to timeout!
148-
#pup5.5.16-fips:
149-
# <<: *pup_5_5_16
150-
# <<: *acceptance_base
151-
# script:
152-
# - 'BEAKER_fips=yes bundle exec rake beaker:suites[default,default]'
153-
154-
pup5.5.16_simp_kv:
155-
<<: *pup_5_5_16
159+
pup5.5.20-fips:
160+
<<: *pup_5_5_20
161+
<<: *acceptance_base
162+
script:
163+
- 'BEAKER_fips=yes bundle exec rake beaker:suites[default,default]'
164+
165+
pup5.5.20_simp_kv:
166+
<<: *pup_5_5_20
156167
<<: *acceptance_base
157168
script:
158169
- 'bundle exec rake beaker:suites[simp_kv,default]'
@@ -163,14 +174,11 @@ pup6:
163174
script:
164175
- 'bundle exec rake beaker:suites[default,default]'
165176

166-
# Re-enable after SIMP-8406 and SIMP-7305 are fixed. We don't even
167-
# want to run with allowed failure, because the attempt to reconnect
168-
# after reboot during FIPS setup can take more than an hour to timeout!
169-
#pup6-fips:
170-
# <<: *pup_6
171-
# <<: *acceptance_base
172-
# script:
173-
# - 'BEAKER_fips=yes bundle exec rake beaker:suites[default,default]'
177+
pup6-fips:
178+
<<: *pup_6
179+
<<: *acceptance_base
180+
script:
181+
- 'BEAKER_fips=yes bundle exec rake beaker:suites[default,default]'
174182

175183
pup6_simp_kv:
176184
<<: *pup_6

.travis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
include:
3232
- stage: check
3333
name: 'Syntax, style, and validation checks'
34-
rvm: 2.4.5
34+
rvm: 2.4.9
3535
script:
3636
- bundle exec rake pkg:compare_latest_tag
3737
- bundle exec rake pkg:create_tag_changelog
@@ -40,7 +40,7 @@ jobs:
4040
# Test with Ruby versions packaged with standard Puppet All-in-one installs
4141
- stage: spec
4242
name: 'Ruby packaged with Puppet 5.x'
43-
rvm: 2.4.5
43+
rvm: 2.4.9
4444
env:
4545
- PUPPET_VERSION="~> 5.5"
4646
- SIMP_SKIP_NON_SIMPOS_TESTS=1
@@ -49,15 +49,15 @@ jobs:
4949

5050
- stage: spec
5151
name: 'Ruby packaged with Puppet 6.x'
52-
rvm: 2.5.1
52+
rvm: 2.5.8
5353
env:
5454
- PUPPET_VERSION="~> 6.0"
5555
- SIMP_SKIP_NON_SIMPOS_TESTS=1
5656
script:
5757
- bundle exec rake spec
5858

5959
- stage: deploy
60-
rvm: 2.4.5
60+
rvm: 2.4.9
6161
script:
6262
- true
6363
before_deploy:

Gemfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ gem 'puppet', ENV.fetch('PUPPET_VERSION', '~>5')
1313
gem 'rake'
1414
gem 'simp-rake-helpers', ENV.fetch('SIMP_RAKE_HELPERS_VERSION', ['>= 5.6', '< 6.0'])
1515

16-
#FIXME SIMP-8406
17-
#gem 'simp-beaker-helpers', ENV['SIMP_BEAKER_HELPERS_VERSION'] || ['>= 1.18.7', '< 2']
18-
gem 'simp-beaker-helpers', ENV.fetch('SIMP_BEAKER_HELPERS_VERSION', '~> 1.12')
16+
gem 'simp-beaker-helpers', ENV['SIMP_BEAKER_HELPERS_VERSION'] || ['>= 1.18.7', '< 2']
1917
gem 'r10k', ENV.fetch('R10k_VERSION', '~>3')
2018

2119
# FIXME Use released version when available. This version has more robust

Rakefile

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@ require 'rspec/core/rake_task'
77
require 'rubygems'
88
require 'simp/rake'
99
require 'simp/rake/beaker'
10+
require 'simp/rake/ci'
1011
require 'simp/cli/version'
1112

13+
# Create pkg:* and simp:ci_* Rake tasks
1214
Simp::Rake::Pkg.new(File.dirname(__FILE__))
15+
Simp::Rake::Ci.new(File.dirname(__FILE__))
1316

1417
@package='simp-cli'
1518
@rakefile_dir=File.dirname(__FILE__)
@@ -27,7 +30,7 @@ Find.find( @rakefile_dir ) do |path|
2730
end
2831
end
2932

30-
# Acceptance Tests
33+
# Create beaker:* acceptance test Rake tasks
3134
Simp::Rake::Beaker.new(File.dirname(__FILE__))
3235

3336
desc 'Ensure gemspec-safe permissions on all files'
@@ -53,10 +56,7 @@ SIMP_RPM_BUILD when set, alters the gem produced by pkg:gem to be RPM-safe.
5356
}
5457
end
5558

56-
# This project has unit tests in nonstandard locations, so redefine the
57-
# underlying Rake task to pick up its tests
58-
Rake::Task[:spec_standalone].clear if Rake::Task.task_defined?(:spec_standalone)
59-
RSpec::Core::RakeTask.new(:spec_standalone) do |t|
59+
RSpec::Core::RakeTask.new(:spec) do |t|
6060
t.rspec_opts = ['--color']
6161
t.exclude_pattern = '**/{acceptance,fixtures,files}/**/*_spec.rb'
6262
t.pattern = 'spec/{lib,bin}/**/*_spec.rb'
@@ -84,18 +84,20 @@ namespace :pkg do
8484
gem_dirs.each do |gem_dir|
8585
Dir.chdir gem_dir do
8686
Dir['*.gemspec'].each do |spec_file|
87+
# highline optional (development-related) gems require cmake, so
88+
# exclude them in the bundle
89+
opts = (File.basename(gem_dir) == 'highline') ? '--without=code_quality' : ''
8790
cmd = %Q{SIMP_RPM_BUILD=1 bundle exec gem build "#{spec_file}" &> /dev/null}
88-
89-
if ::Bundler.respond_to?(:with_unbundled_env)
91+
if ::Bundler.respond_to?(:with_unbundled_env)
9092
# Use Bundler 2.x API
9193
::Bundler.with_unbundled_env do
92-
%x{bundle install}
94+
%x{bundle install #{opts}}
9395
sh cmd
9496
end
9597
else
9698
# Use deprecated Bundler 1.x API
9799
::Bundler.with_clean_env do
98-
%x{bundle install}
100+
%x{bundle install #{opts}}
99101
sh cmd
100102
end
101103
end

build/rubygem-simp-cli.spec

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
%global gemdir /usr/share/simp/ruby
44
%global geminstdir %{gemdir}/gems/%{gemname}-%{version}
55
%global cli_version 6.0.2
6-
%global highline_version 1.7.8
6+
%global highline_version 2.0.3
77

88
# gem2ruby's method of installing gems into mocked build roots will blow up
99
# unless this line is present:
@@ -134,6 +134,7 @@ EOM
134134
proceed because the environment to configure already exists.
135135
- Fixed a bug in `simp environment new` in which the actual failure
136136
messages from a failed `setfacl --restore` execution are not logged.
137+
- Updated HighLine from version 1.7.8 to 2.0.3.
137138

138139
* Tue Sep 01 2020 Jeanne Greulich <jeanne.greulich@onyxpoint.com> - 6.0.1
139140
- In Rakefile check if task spec_standalone exists before trying to

ext/gems/highline/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
doc
22
pkg
3+
.DS_Store
4+
coverage
5+
Gemfile.lock
6+
*.swp
7+
*.swo

ext/gems/highline/.rubocop.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Bellow the changes to default Rubocop behavior.
2+
3+
# See options at:
4+
# https://github.com/bbatsov/rubocop/tree/master/config
5+
6+
AllCops:
7+
TargetRubyVersion: 2.1
8+
9+
# General
10+
11+
# Multi-line method chaining should be done with leading dots.
12+
Layout/DotPosition:
13+
EnforcedStyle: trailing
14+
SupportedStyles:
15+
- leading
16+
- trailing
17+
18+
# Enabling
19+
# --------
20+
21+
Style/CollectionMethods:
22+
Description: 'Preferred collection methods.'
23+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#map-find-select-reduce-size'
24+
Enabled: true
25+
26+
Style/StringMethods:
27+
Description: 'Checks if configured preferred methods are used over non-preferred.'
28+
Enabled: true
29+
30+
# Disabling
31+
# ---------
32+
33+
# Modifying
34+
# ---------
35+
36+
# Check quotes usage according to lint rule below.
37+
Style/StringLiterals:
38+
Enabled: true
39+
EnforcedStyle: double_quotes
40+
41+
# Configuration parameters: SupportedStyles.
42+
# SupportedStyles: snake_case, camelCase
43+
Naming/MethodName:
44+
EnforcedStyle: snake_case
45+
Exclude:
46+
- 'test/**/*'
47+
48+
# Cop supports --auto-correct.
49+
# Configuration parameters: EnforcedStyle, SupportedStyles, AutoCorrectEncodingComment.
50+
# SupportedStyles: when_needed, always, never
51+
Style/Encoding:
52+
Enabled: true
53+
54+
# If we fix this, it will change method signature.
55+
# Save it for major release.
56+
Style/OptionalArguments:
57+
Exclude:
58+
- 'lib/highline/list_renderer.rb'
59+
60+
# TemplateRenderer should never fail on method missing.
61+
Style/MethodMissing:
62+
Exclude:
63+
- 'lib/highline/template_renderer.rb'
64+
65+
# This is a breaking change for MRI 1.9.
66+
# Revoke when updating to MRI 2.0 as minimum.
67+
# Cop supports --auto-correct.
68+
# Configuration parameters: MinSize, SupportedStyles.
69+
# SupportedStyles: percent, brackets
70+
Style/SymbolArray:
71+
EnforcedStyle: brackets
72+
73+
# Cop supports --auto-correct.
74+
# Configuration parameters: EnforcedStyle, SupportedStyles.
75+
# SupportedStyles: auto_detection, squiggly, active_support, powerpack, unindent
76+
Layout/IndentHeredoc:
77+
Exclude:
78+
- 'examples/page_and_wrap.rb'
79+
- 'highline.gemspec'
80+
- 'test/acceptance/acceptance.rb'
81+
82+
# Cop supports --auto-correct.
83+
Lint/ScriptPermission:
84+
Enabled: false

ext/gems/highline/.simplecov

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
unless SimpleCov.running
2+
SimpleCov.start do
3+
add_filter "test_"
4+
end
5+
end

0 commit comments

Comments
 (0)