foreman_remote_execution 4.2.3 → 4.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6a9f5c20b58b5911c612164cc806d63b3096c81506b18cd11423fb4b073bdec4
4
- data.tar.gz: 2c8615b8ef06bf5d5adc3e62ab2a36906714ebe9e99adbf13dfb3eaa742819d6
3
+ metadata.gz: f170eb66eb23ab9e671ff1137c9ca830041743eb83836947cf11da32432f119d
4
+ data.tar.gz: 0f4d52cce40bc8c9f89eb4e65242b1e3a25e4d0ce5ba9cf24b5fc9ff23346267
5
5
  SHA512:
6
- metadata.gz: 549daa0a07ac47a7ed596187fd86943d9e1e517dab1d653af8f454ccee9e2b83fa85b6e2ec188201e5f849978b50b69108a0dbf6a6c67844b909de3b1b1e846f
7
- data.tar.gz: b6e71fedfb385b05aa488fd65b68c2c242eba84783da007e26a6cf5f5b1b837de7bcbcfeecc72459b4c48cee93513f45948aa14318bbc548a52f159f2ae967cd
6
+ metadata.gz: 5964ee1b1bc9b3983f6f2677f9e38dbaf41416d16ace8ee1dcfc43f63d7250154b62722b191cc62b2b29c073d8035e0f813d5e576db167b05b1a2ea56cef6ce4
7
+ data.tar.gz: 3cf702ec56abf119a67f6bbbd1a0d2b6b2dbb067ee99ea31735d2b5bcedc87b194d992e48ffcfe8848799cc16eb872623523d73d16b5f8e6ddd8d47400d51e80
@@ -0,0 +1,29 @@
1
+ name: JS
2
+ on:
3
+ pull_request:
4
+ paths:
5
+ - 'webpack/**'
6
+ - 'package.json'
7
+ - '.github/workflows/js_ci.yml'
8
+ jobs:
9
+ test_js:
10
+ runs-on: ubuntu-latest
11
+ strategy:
12
+ fail-fast: false
13
+ matrix:
14
+ node-version: [12]
15
+ steps:
16
+ - uses: actions/checkout@v2
17
+ - name: Setup Node
18
+ uses: actions/setup-node@v1
19
+ with:
20
+ node-version: ${{ matrix.node-version }}
21
+ - name: Npm install
22
+ run: |
23
+ npm install
24
+ - name: Run plugin linter
25
+ run: |
26
+ npm run lint
27
+ - name: Run plugin tests
28
+ run: |
29
+ npm run test
@@ -1,5 +1,9 @@
1
- name: CI
2
- on: [pull_request]
1
+ name: Ruby
2
+ on:
3
+ pull_request:
4
+ push:
5
+ branches:
6
+ - master
3
7
  env:
4
8
  RAILS_ENV: test
5
9
  DATABASE_URL: postgresql://postgres:@localhost/test
@@ -12,16 +16,17 @@ jobs:
12
16
  - name: Setup Ruby
13
17
  uses: ruby/setup-ruby@v1
14
18
  with:
15
- ruby-version: 2.6
16
- - name: Setup
17
- run: |
18
- gem install bundler
19
- bundle install --jobs=3 --retry=3
19
+ ruby-version: 2.5
20
+ bundler-cache: true
20
21
  - name: Run rubocop
21
- run: bundle exec rubocop
22
+ if: github.event_name != 'push'
23
+ run: bundle exec rubocop --format github
22
24
  test_ruby:
23
25
  runs-on: ubuntu-latest
24
26
  needs: rubocop
27
+ timeout-minutes: 30
28
+ env:
29
+ BUNDLE_WITHOUT: journald:development:console:libvirt
25
30
  services:
26
31
  postgres:
27
32
  image: postgres:12.1
@@ -31,7 +36,7 @@ jobs:
31
36
  fail-fast: false
32
37
  matrix:
33
38
  foreman-core-branch: [develop]
34
- ruby-version: [2.5, 2.6]
39
+ ruby-version: [2.5, 2.7]
35
40
  node-version: [12]
36
41
  steps:
37
42
  - run: sudo apt-get update
@@ -43,59 +48,26 @@ jobs:
43
48
  - uses: actions/checkout@v2
44
49
  with:
45
50
  path: foreman_remote_execution
51
+ - name: Setup Bundler
52
+ run: |
53
+ echo "gem 'foreman_remote_execution', path: './foreman_remote_execution'" > bundler.d/foreman_remote_execution.local.rb
46
54
  - name: Setup Ruby
47
55
  uses: ruby/setup-ruby@v1
48
56
  with:
49
57
  ruby-version: ${{ matrix.ruby-version }}
58
+ bundler-cache: true
50
59
  - name: Setup Node
60
+ if: github.event_name != 'push'
51
61
  uses: actions/setup-node@v1
52
62
  with:
53
63
  node-version: ${{ matrix.node-version }}
54
- - uses: actions/cache@v1
55
- with:
56
- path: vendor/bundle
57
- key: ${{ runner.os }}-fgems-${{ matrix.ruby-version }}-${{ hashFiles('Gemfile.lock') }}
58
- restore-keys: |
59
- ${{ runner.os }}-fgems-${{ matrix.ruby-version }}-
60
- - name: Setup Bundler
61
- run: |
62
- echo "gem 'foreman_remote_execution', path: './foreman_remote_execution'" > bundler.d/foreman_remote_execution.local.rb
63
- gem install bundler
64
- bundle config set without journald development console libvirt
65
- bundle config set path vendor/bundle
66
- - name: Prepare test env
64
+ - name: Prepare test DB
65
+ if: github.event_name != 'push'
67
66
  run: |
68
- bundle install --jobs=3 --retry=3
69
67
  bundle exec rake db:create
70
68
  bundle exec rake db:migrate
71
69
  - name: Run plugin tests
70
+ if: github.event_name != 'push'
72
71
  run: |
73
72
  bundle exec rake test:foreman_remote_execution
74
73
  bundle exec rake test TEST="test/unit/foreman/access_permissions_test.rb"
75
- test_js:
76
- runs-on: ubuntu-latest
77
- needs: rubocop
78
- strategy:
79
- fail-fast: false
80
- matrix:
81
- ruby-version: [2.6]
82
- node-version: [10, 12]
83
- steps:
84
- - uses: actions/checkout@v2
85
- - name: Setup Ruby
86
- uses: ruby/setup-ruby@v1
87
- with:
88
- ruby-version: ${{ matrix.ruby-version }}
89
- - name: Setup Node
90
- uses: actions/setup-node@v1
91
- with:
92
- node-version: ${{ matrix.node-version }}
93
- - name: Nmp install
94
- run: |
95
- npm install
96
- - name: Run plugin linter
97
- run: |
98
- npm run lint
99
- - name: Run plugin tests
100
- run: |
101
- npm run test
data/.prettierrc ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ "singleQuote": true,
3
+ "trailingComma": "es5"
4
+ }
data/.rubocop.yml CHANGED
@@ -1,29 +1,27 @@
1
- require:
2
- - rubocop-minitest
3
- - rubocop-performance
4
- - rubocop-rails
1
+ inherit_gem:
2
+ theforeman-rubocop:
3
+ - lenient.yml
4
+ - minitest.yml
5
5
 
6
6
  inherit_from: .rubocop_todo.yml
7
7
 
8
+ inherit_mode:
9
+ merge:
10
+ - Exclude
11
+
8
12
  AllCops:
9
13
  TargetRubyVersion: 2.5
10
14
  TargetRailsVersion: 5.2
11
15
  Exclude:
12
16
  - 'node_modules/**/*'
17
+ - 'vendor/bundle/**/*'
13
18
 
14
19
  Bundler/OrderedGems:
15
20
  Enabled: false
16
21
 
17
- Layout/ArgumentAlignment:
18
- EnforcedStyle: with_fixed_indentation
19
- IndentationWidth: 2
20
-
21
22
  Layout/DotPosition:
22
23
  Enabled: false
23
24
 
24
- Layout/FirstArgumentIndentation:
25
- EnforcedStyle: consistent
26
-
27
25
  Layout/HashAlignment:
28
26
  Enabled: false
29
27
 
@@ -33,6 +31,9 @@ Layout/LineLength:
33
31
  Layout/ParameterAlignment:
34
32
  Enabled: false
35
33
 
34
+ Layout/SpaceInsideHashLiteralBraces:
35
+ Enabled: false
36
+
36
37
  Lint/BooleanSymbol:
37
38
  Enabled: false
38
39
 
@@ -42,12 +43,6 @@ Metrics:
42
43
  Performance/Casecmp:
43
44
  Enabled: false
44
45
 
45
- Performance/RedundantMatch:
46
- Enabled: true
47
-
48
- Performance/RedundantMerge:
49
- Enabled: true
50
-
51
46
  Performance/RegexpMatch:
52
47
  Enabled: false
53
48
 
@@ -66,12 +61,6 @@ Rails/BulkChangeTable:
66
61
  Rails/RefuteMethods:
67
62
  Enabled: false
68
63
 
69
- Style/Alias:
70
- EnforcedStyle: prefer_alias_method
71
-
72
- Style/AndOr:
73
- EnforcedStyle: conditionals
74
-
75
64
  # Don't prefer is_a? over kind_of?
76
65
  Style/ClassCheck:
77
66
  Enabled: false
@@ -83,13 +72,6 @@ Style/CollectionMethods:
83
72
  Style/ConditionalAssignment:
84
73
  Enabled: false
85
74
 
86
- # Don't enforce documentation
87
- Style/Documentation:
88
- Enabled: false
89
-
90
- Style/EmptyMethod:
91
- EnforcedStyle: expanded
92
-
93
75
  # Don't enforce frozen string literals
94
76
  Style/FrozenStringLiteralComment:
95
77
  Enabled: false
@@ -104,10 +86,6 @@ Style/IfUnlessModifier:
104
86
  Style/InverseMethods:
105
87
  Enabled: false
106
88
 
107
- # disabled until we can configure "+" as concat sign
108
- Style/LineEndConcatenation:
109
- Enabled: false
110
-
111
89
  Style/MultipleComparison:
112
90
  Enabled: false
113
91
 
@@ -123,19 +101,5 @@ Style/ParenthesesAroundCondition:
123
101
  Style/PreferredHashMethods:
124
102
  Enabled: false
125
103
 
126
- # Both double and single quotes are OK
127
- Style/StringLiterals:
128
- Enabled: false
129
-
130
- Style/TernaryParentheses:
131
- EnforcedStyle: require_parentheses_when_complex
132
-
133
- Style/TrailingCommaInArrayLiteral:
134
- EnforcedStyleForMultiline: comma
135
-
136
- Style/TrailingCommaInHashLiteral:
137
- EnforcedStyleForMultiline: comma
138
-
139
- #Allow both ['a', 'b'], %w[a b] and %w(a b) style arrays
140
- Style/WordArray:
104
+ Style/RaiseArgs:
141
105
  Enabled: false
data/.rubocop_todo.yml CHANGED
@@ -1,41 +1,67 @@
1
1
  # This configuration was generated by
2
- # `rubocop --auto-gen-config --exclude-limit 0`
3
- # on 2020-03-14 13:43:47 +0100 using RuboCop version 0.80.1.
2
+ # `rubocop --auto-gen-config`
3
+ # on 2020-12-02 23:05:20 UTC using RuboCop version 1.5.1.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- Minitest/GlobalExpectations:
10
- Enabled: false
11
-
12
9
  # Offense count: 2
13
- # Cop supports --auto-correct.
14
- # Configuration parameters: TreatCommentsAsGroupSeparators, Include.
10
+ # Configuration parameters: Include.
15
11
  # Include: **/*.gemspec
16
- Gemspec/OrderedDependencies:
17
- Enabled: false
12
+ Gemspec/RequiredRubyVersion:
13
+ Exclude:
14
+ - 'foreman_remote_execution.gemspec'
15
+ - 'foreman_remote_execution_core.gemspec'
18
16
 
19
- # Offense count: 14
17
+ # Offense count: 1
18
+ # Cop supports --auto-correct.
19
+ # Configuration parameters: EnforcedStyleAlignWith, Severity.
20
+ # SupportedStylesAlignWith: start_of_line, begin
21
+ Layout/BeginEndAlignment:
22
+ Exclude:
23
+ - 'lib/foreman_remote_execution_core/script_runner.rb'
24
+
25
+ # Offense count: 13
20
26
  # Cop supports --auto-correct.
21
27
  # Configuration parameters: EnforcedStyle, IndentOneStep, IndentationWidth.
22
28
  # SupportedStyles: case, end
23
29
  Layout/CaseIndentation:
24
- Enabled: false
30
+ Exclude:
31
+ - 'app/controllers/job_invocations_controller.rb'
32
+ - 'app/controllers/job_templates_controller.rb'
33
+ - 'app/models/host_status/execution_status.rb'
25
34
 
26
35
  # Offense count: 4
27
36
  # Cop supports --auto-correct.
28
37
  Layout/EmptyLines:
29
- Enabled: false
38
+ Exclude:
39
+ - 'app/models/template_invocation.rb'
40
+ - 'test/unit/input_template_renderer_test.rb'
41
+ - 'test/unit/job_invocation_composer_test.rb'
42
+ - 'test/unit/remote_execution_feature_test.rb'
43
+
44
+ # Offense count: 3
45
+ # Cop supports --auto-correct.
46
+ # Configuration parameters: AllowAliasSyntax, AllowedMethods.
47
+ # AllowedMethods: alias_method, public, protected, private
48
+ Layout/EmptyLinesAroundAttributeAccessor:
49
+ Exclude:
50
+ - 'app/lib/foreman_remote_execution/renderer/scope/input.rb'
51
+ - 'app/models/job_invocation_composer.rb'
30
52
 
31
53
  # Offense count: 6
32
54
  # Cop supports --auto-correct.
33
55
  # Configuration parameters: EnforcedStyle.
34
56
  # SupportedStyles: empty_lines, no_empty_lines
35
57
  Layout/EmptyLinesAroundBlockBody:
36
- Enabled: false
58
+ Exclude:
59
+ - 'extra/cockpit/foreman-cockpit-session'
60
+ - 'test/unit/input_template_renderer_test.rb'
61
+ - 'test/unit/job_invocation_composer_test.rb'
62
+ - 'test/unit/targeting_test.rb'
37
63
 
38
- # Offense count: 20
64
+ # Offense count: 21
39
65
  # Cop supports --auto-correct.
40
66
  # Configuration parameters: EnforcedStyle.
41
67
  # SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines, beginning_only, ending_only
@@ -47,208 +73,377 @@ Layout/EmptyLinesAroundClassBody:
47
73
  # Configuration parameters: EnforcedStyle.
48
74
  # SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines
49
75
  Layout/EmptyLinesAroundModuleBody:
50
- Enabled: false
76
+ Exclude:
77
+ - 'app/helpers/concerns/foreman_remote_execution/hosts_helper_extensions.rb'
78
+ - 'app/lib/actions/middleware/bind_job_invocation.rb'
79
+ - 'test/functional/api/v2/job_templates_controller_test.rb'
51
80
 
52
81
  # Offense count: 6
53
82
  # Cop supports --auto-correct.
54
83
  # Configuration parameters: Width, IgnoredPatterns.
55
84
  Layout/IndentationWidth:
56
- Enabled: false
85
+ Exclude:
86
+ - 'app/models/template_invocation.rb'
87
+ - 'extra/cockpit/foreman-cockpit-session'
57
88
 
58
- # Offense count: 9
89
+ # Offense count: 7
59
90
  # Cop supports --auto-correct.
60
91
  # Configuration parameters: EnforcedStyle, IndentationWidth.
61
92
  # SupportedStyles: aligned, indented
62
93
  Layout/MultilineOperationIndentation:
63
- Enabled: false
94
+ Exclude:
95
+ - 'app/helpers/job_invocations_helper.rb'
96
+ - 'app/helpers/remote_execution_helper.rb'
97
+ - 'app/models/job_invocation_composer.rb'
98
+ - 'app/models/remote_execution_provider.rb'
99
+ - 'lib/foreman_remote_execution_core/dispatcher.rb'
64
100
 
65
- # Offense count: 5
101
+ # Offense count: 7
66
102
  # Cop supports --auto-correct.
67
103
  Layout/SpaceAfterComma:
68
- Enabled: false
104
+ Exclude:
105
+ - 'app/helpers/job_invocation_output_helper.rb'
106
+ - 'db/migrate/20200623073022_rename_sudo_password_to_effective_user_password.rb'
107
+ - 'test/functional/ui_job_wizard_controller_test.rb'
108
+ - 'test/unit/job_invocation_composer_test.rb'
69
109
 
70
- # Offense count: 28
110
+ # Offense count: 29
71
111
  # Cop supports --auto-correct.
72
112
  # Configuration parameters: AllowForAlignment, EnforcedStyleForExponentOperator.
73
113
  # SupportedStylesForExponentOperator: space, no_space
74
114
  Layout/SpaceAroundOperators:
75
- Enabled: false
76
-
77
- # Offense count: 54
115
+ Exclude:
116
+ - 'app/controllers/ui_job_wizard_controller.rb'
117
+ - 'app/helpers/job_invocations_helper.rb'
118
+ - 'db/migrate/20150708133242_add_invocation.rb'
119
+ - 'extra/cockpit/foreman-cockpit-session'
120
+ - 'test/helpers/remote_execution_helper_test.rb'
121
+ - 'test/unit/input_template_renderer_test.rb'
122
+ - 'test/unit/job_invocation_composer_test.rb'
123
+
124
+ # Offense count: 58
78
125
  # Cop supports --auto-correct.
79
126
  # Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBrackets.
80
127
  # SupportedStyles: space, no_space, compact
81
128
  # SupportedStylesForEmptyBrackets: space, no_space
82
129
  Layout/SpaceInsideArrayLiteralBrackets:
83
- Enabled: false
130
+ Exclude:
131
+ - 'app/helpers/concerns/foreman_remote_execution/hosts_helper_extensions.rb'
132
+ - 'app/helpers/remote_execution_helper.rb'
133
+ - 'app/lib/actions/remote_execution/run_host_job.rb'
134
+ - 'app/models/host_status/execution_status.rb'
135
+ - 'app/models/job_invocation.rb'
136
+ - 'app/models/job_invocation_composer.rb'
137
+ - 'app/models/job_template.rb'
138
+ - 'app/models/remote_execution_feature.rb'
139
+ - 'extra/cockpit/foreman-cockpit-session'
140
+ - 'lib/foreman_remote_execution/engine.rb'
141
+ - 'test/unit/execution_task_status_mapper_test.rb'
142
+ - 'test/unit/job_invocation_composer_test.rb'
143
+ - 'test/unit/targeting_test.rb'
84
144
 
85
- # Offense count: 95
86
- # Cop supports --auto-correct.
87
- # Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces.
88
- # SupportedStyles: space, no_space, compact
89
- # SupportedStylesForEmptyBraces: space, no_space
90
- Layout/SpaceInsideHashLiteralBraces:
91
- Enabled: false
145
+ # Offense count: 2
146
+ # Configuration parameters: AllowedMethods.
147
+ # AllowedMethods: enums
148
+ Lint/ConstantDefinitionInBlock:
149
+ Exclude:
150
+ - 'lib/foreman_remote_execution/engine.rb'
151
+
152
+ # Offense count: 2
153
+ Lint/MissingSuper:
154
+ Exclude:
155
+ - 'app/services/ui_notifications/remote_execution_jobs/base_job_finish.rb'
156
+ - 'lib/foreman_remote_execution_core/log_filter.rb'
92
157
 
93
158
  # Offense count: 10
94
159
  # Cop supports --auto-correct.
95
160
  # Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments.
96
161
  Lint/UnusedBlockArgument:
97
- Enabled: false
162
+ Exclude:
163
+ - 'app/models/job_invocation_composer.rb'
164
+ - 'extra/cockpit/foreman-cockpit-session'
165
+ - 'lib/foreman_remote_execution/engine.rb'
166
+ - 'lib/foreman_remote_execution_core/script_runner.rb'
167
+ - 'test/factories/foreman_remote_execution_factories.rb'
98
168
 
99
169
  # Offense count: 15
100
170
  # Cop supports --auto-correct.
101
- # Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods.
171
+ # Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods.
102
172
  Lint/UnusedMethodArgument:
103
- Enabled: false
173
+ Exclude:
174
+ - 'app/helpers/concerns/foreman_remote_execution/hosts_helper_extensions.rb'
175
+ - 'app/helpers/remote_execution_helper.rb'
176
+ - 'app/lib/actions/remote_execution/run_host_job.rb'
177
+ - 'app/models/host_status/execution_status.rb'
178
+ - 'app/models/job_invocation.rb'
179
+ - 'app/models/job_invocation_composer.rb'
180
+ - 'app/models/job_template.rb'
181
+ - 'app/models/remote_execution_provider.rb'
182
+ - 'lib/foreman_remote_execution_core/script_runner.rb'
183
+ - 'test/benchmark/run_hosts_job_benchmark.rb'
184
+ - 'test/support/remote_execution_helper.rb'
104
185
 
105
186
  # Offense count: 4
106
187
  Lint/UselessAssignment:
107
- Enabled: false
188
+ Exclude:
189
+ - 'app/lib/foreman_remote_execution/renderer/scope/input.rb'
190
+ - 'app/models/job_template.rb'
191
+ - 'app/models/remote_execution_feature.rb'
192
+ - 'extra/cockpit/foreman-cockpit-session'
108
193
 
109
- # Offense count: 1
194
+ # Offense count: 31
195
+ # Cop supports --auto-correct.
196
+ Minitest/GlobalExpectations:
197
+ Exclude:
198
+ - 'test/helpers/remote_execution_helper_test.rb'
199
+ - 'test/unit/actions/run_hosts_job_test.rb'
200
+ - 'test/unit/concerns/foreman_tasks_cleaner_extensions_test.rb'
201
+ - 'test/unit/concerns/host_extensions_test.rb'
202
+ - 'test/unit/job_invocation_test.rb'
203
+ - 'test/unit/remote_execution_provider_test.rb'
204
+ - 'test/unit/targeting_test.rb'
205
+
206
+ # Offense count: 2
110
207
  Naming/AccessorMethodName:
111
- Enabled: false
208
+ Exclude:
209
+ - 'app/lib/actions/remote_execution/run_hosts_job.rb'
210
+ - 'app/models/concerns/foreman_remote_execution/host_extensions.rb'
112
211
 
113
- # Offense count: 5
114
- # Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts, AllowedAcronyms.
212
+ # Offense count: 6
213
+ # Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, Regex, IgnoreExecutableScripts, AllowedAcronyms.
115
214
  # AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
116
215
  Naming/FileName:
117
- Enabled: false
216
+ Exclude:
217
+ - 'db/seeds.d/100-assign_features_with_templates.rb'
218
+ - 'db/seeds.d/20-permissions.rb'
219
+ - 'db/seeds.d/50-notification_blueprints.rb'
220
+ - 'db/seeds.d/60-ssh_proxy_feature.rb'
221
+ - 'db/seeds.d/70-job_templates.rb'
222
+ - 'db/seeds.d/90-bookmarks.rb'
118
223
 
119
224
  # Offense count: 1
120
225
  # Configuration parameters: ForbiddenDelimiters.
121
226
  # ForbiddenDelimiters: (?-mix:(^|\s)(EO[A-Z]{1}|END)(\s|$))
122
227
  Naming/HeredocDelimiterNaming:
123
- Enabled: false
228
+ Exclude:
229
+ - 'lib/foreman_remote_execution_core/fake_script_runner.rb'
124
230
 
125
231
  # Offense count: 2
126
232
  # Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
127
- # AllowedNames: io, id, to, by, on, in, at, ip, db, os, pp
233
+ # AllowedNames: at, by, db, id, in, io, ip, of, on, os, pp, to
128
234
  Naming/MethodParameterName:
129
- Enabled: false
235
+ Exclude:
236
+ - 'app/helpers/remote_execution_helper.rb'
130
237
 
131
238
  # Offense count: 1
132
239
  # Cop supports --auto-correct.
133
240
  # Configuration parameters: PreferredName.
134
241
  Naming/RescuedExceptionsVariableName:
135
- Enabled: false
242
+ Exclude:
243
+ - 'Rakefile'
136
244
 
137
245
  # Offense count: 1
138
- # Configuration parameters: EnforcedStyle.
139
- # SupportedStyles: snake_case, normalcase, non_integer
140
- Naming/VariableNumber:
141
- Enabled: false
246
+ # Configuration parameters: MinSize.
247
+ Performance/CollectionLiteralInLoop:
248
+ Exclude:
249
+ - 'db/seeds.d/90-bookmarks.rb'
250
+
251
+ # Offense count: 11
252
+ # Cop supports --auto-correct.
253
+ Rails/ContentTag:
254
+ Exclude:
255
+ - 'app/helpers/job_invocations_helper.rb'
256
+ - 'app/helpers/remote_execution_helper.rb'
142
257
 
143
258
  # Offense count: 7
144
259
  # Configuration parameters: Include.
145
260
  # Include: db/migrate/*.rb
146
261
  Rails/CreateTableWithTimestamps:
147
- Enabled: false
262
+ Exclude:
263
+ - 'db/migrate/20150708133241_add_targeting.rb'
264
+ - 'db/migrate/20150708133242_add_invocation.rb'
265
+ - 'db/migrate/20150708133305_add_template_invocation.rb'
266
+ - 'db/migrate/20151124162300_create_job_template_effective_users.rb'
267
+ - 'db/migrate/20160108134600_create_template_input_sets.rb'
268
+ - 'db/migrate/20160118124600_create_remote_execution_features.rb'
148
269
 
149
270
  # Offense count: 1
150
271
  # Configuration parameters: EnforcedStyle.
151
272
  # SupportedStyles: strict, flexible
152
273
  Rails/Date:
153
- Enabled: false
274
+ Exclude:
275
+ - 'foreman_remote_execution.gemspec'
154
276
 
155
- # Offense count: 13
277
+ # Offense count: 11
156
278
  # Configuration parameters: Include.
157
279
  # Include: app/helpers/**/*.rb
158
280
  Rails/HelperInstanceVariable:
159
- Enabled: false
281
+ Exclude:
282
+ - 'app/helpers/job_invocation_output_helper.rb'
283
+ - 'app/helpers/job_invocations_chart_helper.rb'
284
+ - 'app/helpers/remote_execution_helper.rb'
160
285
 
161
286
  # Offense count: 13
162
287
  # Configuration parameters: Include.
163
288
  # Include: app/models/**/*.rb
164
289
  Rails/InverseOf:
165
- Enabled: false
290
+ Exclude:
291
+ - 'app/models/concerns/foreman_remote_execution/foreman_tasks_task_extensions.rb'
292
+ - 'app/models/concerns/foreman_remote_execution/foreman_tasks_triggering_extensions.rb'
293
+ - 'app/models/concerns/foreman_remote_execution/host_extensions.rb'
294
+ - 'app/models/concerns/foreman_remote_execution/template_extensions.rb'
295
+ - 'app/models/job_invocation_task_group.rb'
296
+ - 'app/models/job_template.rb'
297
+ - 'app/models/template_invocation.rb'
166
298
 
167
299
  # Offense count: 1
168
300
  # Configuration parameters: Include.
169
301
  # Include: app/controllers/**/*.rb
170
302
  Rails/LexicallyScopedActionFilter:
171
- Enabled: false
303
+ Exclude:
304
+ - 'app/controllers/api/v2/job_invocations_controller.rb'
172
305
 
173
306
  # Offense count: 1
307
+ # Cop supports --auto-correct.
174
308
  # Configuration parameters: Include.
175
309
  # Include: **/Rakefile, **/*.rake
176
310
  Rails/RakeEnvironment:
177
- Enabled: false
311
+ Exclude:
312
+ - 'lib/tasks/foreman_remote_execution_tasks.rake'
313
+
314
+ # Offense count: 3
315
+ # Cop supports --auto-correct.
316
+ Rails/RedundantForeignKey:
317
+ Exclude:
318
+ - 'app/models/job_template.rb'
319
+ - 'app/models/template_invocation.rb'
178
320
 
179
321
  # Offense count: 1
180
322
  Rails/ReflectionClassName:
181
- Enabled: false
323
+ Exclude:
324
+ - 'app/models/job_template.rb'
182
325
 
183
- # Offense count: 21
184
- # Configuration parameters: Blacklist, Whitelist.
185
- # Blacklist: decrement!, decrement_counter, increment!, increment_counter, toggle!, touch, update_all, update_attribute, update_column, update_columns, update_counters
326
+ # Offense count: 4
327
+ # Configuration parameters: ForbiddenMethods, AllowedMethods.
328
+ # ForbiddenMethods: decrement!, decrement_counter, increment!, increment_counter, insert, insert!, insert_all, insert_all!, toggle!, touch, touch_all, update_all, update_attribute, update_column, update_columns, update_counters, upsert, upsert_all
186
329
  Rails/SkipsModelValidations:
187
- Enabled: false
330
+ Exclude:
331
+ - 'app/lib/actions/middleware/bind_job_invocation.rb'
332
+ - 'app/models/concerns/foreman_remote_execution/smart_proxy_extensions.rb'
333
+ - 'test/unit/input_template_renderer_test.rb'
334
+ - 'test/unit/job_invocation_composer_test.rb'
188
335
 
189
336
  # Offense count: 6
190
337
  # Cop supports --auto-correct.
191
338
  # Configuration parameters: EnforcedStyle.
192
339
  # SupportedStyles: strict, flexible
193
340
  Rails/TimeZone:
194
- Enabled: false
341
+ Exclude:
342
+ - 'app/models/job_invocation_composer.rb'
343
+ - 'test/functional/api/v2/job_invocations_controller_test.rb'
344
+ - 'test/unit/job_invocation_composer_test.rb'
195
345
 
196
- # Offense count: 7
346
+ # Offense count: 2
197
347
  # Cop supports --auto-correct.
198
- # Configuration parameters: AutoCorrect, EnforcedStyle.
348
+ Style/CaseLikeIf:
349
+ Exclude:
350
+ - 'app/lib/actions/remote_execution/run_host_job.rb'
351
+ - 'app/models/job_invocation_composer.rb'
352
+
353
+ # Offense count: 5
354
+ # Cop supports --auto-correct.
355
+ # Configuration parameters: EnforcedStyle.
199
356
  # SupportedStyles: nested, compact
200
357
  Style/ClassAndModuleChildren:
201
- Enabled: false
358
+ Exclude:
359
+ - 'app/controllers/foreman_remote_execution/concerns/api/v2/registration_controller_extensions.rb'
360
+ - 'app/controllers/foreman_remote_execution/concerns/api/v2/subnets_controller_extensions.rb'
361
+ - 'app/models/concerns/foreman_remote_execution/orchestration/ssh.rb'
362
+ - 'app/models/host_status/execution_status.rb'
363
+ - 'app/models/setting/remote_execution.rb'
364
+
365
+ # Offense count: 3
366
+ # Cop supports --auto-correct.
367
+ # Configuration parameters: IgnoredMethods.
368
+ # IgnoredMethods: ==, equal?, eql?
369
+ Style/ClassEqualityComparison:
370
+ Exclude:
371
+ - 'app/helpers/job_invocations_chart_helper.rb'
372
+ - 'app/helpers/remote_execution_helper.rb'
373
+ - 'app/models/ssh_execution_provider.rb'
202
374
 
203
375
  # Offense count: 2
204
376
  # Cop supports --auto-correct.
205
377
  # Configuration parameters: Keywords.
206
- # Keywords: TODO, FIXME, OPTIMIZE, HACK, REVIEW
378
+ # Keywords: TODO, FIXME, OPTIMIZE, HACK, REVIEW, NOTE
207
379
  Style/CommentAnnotation:
208
- Enabled: false
209
-
210
- # Offense count: 1
211
- Style/DoubleNegation:
212
- Enabled: false
380
+ Exclude:
381
+ - 'app/models/job_invocation_composer.rb'
382
+ - 'db/seeds.d/90-bookmarks.rb'
213
383
 
214
384
  # Offense count: 1
215
385
  # Cop supports --auto-correct.
216
386
  Style/Encoding:
217
- Enabled: false
387
+ Exclude:
388
+ - 'foreman_remote_execution_core.gemspec'
218
389
 
219
390
  # Offense count: 8
220
391
  # Cop supports --auto-correct.
221
392
  Style/ExpandPathArguments:
222
- Enabled: false
393
+ Exclude:
394
+ - 'Rakefile'
395
+ - 'foreman_remote_execution.gemspec'
396
+ - 'foreman_remote_execution_core.gemspec'
397
+ - 'lib/foreman_remote_execution/engine.rb'
398
+ - 'lib/foreman_remote_execution_core/polling_script_runner.rb'
399
+ - 'test/benchmark/run_hosts_job_benchmark.rb'
400
+ - 'test/benchmark/targeting_benchmark.rb'
223
401
 
224
402
  # Offense count: 12
225
403
  # Cop supports --auto-correct.
226
404
  # Configuration parameters: EnforcedStyle.
227
405
  # SupportedStyles: format, sprintf, percent
228
406
  Style/FormatString:
229
- Enabled: false
230
-
231
- # Offense count: 62
232
- # Configuration parameters: EnforcedStyle.
407
+ Exclude:
408
+ - 'app/controllers/api/v2/job_invocations_controller.rb'
409
+ - 'app/controllers/job_templates_controller.rb'
410
+ - 'app/helpers/job_invocations_chart_helper.rb'
411
+ - 'app/lib/actions/remote_execution/run_host_job.rb'
412
+ - 'app/lib/actions/remote_execution/run_hosts_job.rb'
413
+ - 'app/models/job_invocation_composer.rb'
414
+ - 'app/models/remote_execution_provider.rb'
415
+ - 'app/models/ssh_execution_provider.rb'
416
+ - 'extra/cockpit/foreman-cockpit-session'
417
+
418
+ # Offense count: 61
419
+ # Configuration parameters: MaxUnannotatedPlaceholdersAllowed.
233
420
  # SupportedStyles: annotated, template, unannotated
234
421
  Style/FormatStringToken:
235
- Enabled: false
422
+ EnforcedStyle: template
236
423
 
237
- # Offense count: 21
424
+ # Offense count: 23
238
425
  # Configuration parameters: MinBodyLength.
239
426
  Style/GuardClause:
240
427
  Enabled: false
241
428
 
429
+ # Offense count: 1
430
+ # Cop supports --auto-correct.
242
431
  Style/HashEachMethods:
243
- Enabled: false
244
-
245
- Style/HashTransformKeys:
246
- Enabled: false
432
+ Exclude:
433
+ - 'app/models/concerns/foreman_remote_execution/errors_flattener.rb'
247
434
 
248
- Style/HashTransformValues:
249
- Enabled: false
250
-
251
- # Offense count: 26
435
+ # Offense count: 6
436
+ # Configuration parameters: AllowedMethods.
437
+ # AllowedMethods: respond_to_missing?
438
+ Style/OptionalBooleanParameter:
439
+ Exclude:
440
+ - 'app/helpers/job_invocations_chart_helper.rb'
441
+ - 'app/models/concerns/foreman_remote_execution/host_extensions.rb'
442
+ - 'app/models/input_template_renderer.rb'
443
+ - 'app/models/job_invocation.rb'
444
+ - 'app/models/job_invocation_composer.rb'
445
+
446
+ # Offense count: 29
252
447
  # Cop supports --auto-correct.
253
448
  # Configuration parameters: PreferredDelimiters.
254
449
  Style/PercentLiteralDelimiters:
@@ -256,18 +451,33 @@ Style/PercentLiteralDelimiters:
256
451
 
257
452
  # Offense count: 1
258
453
  # Cop supports --auto-correct.
259
- # Configuration parameters: EnforcedStyle.
454
+ # Configuration parameters: AllowedCompactTypes.
260
455
  # SupportedStyles: compact, exploded
261
456
  Style/RaiseArgs:
262
- Enabled: false
457
+ EnforcedStyle: exploded
263
458
 
264
- # Offense count: 15
459
+ # Offense count: 1
460
+ # Cop supports --auto-correct.
461
+ Style/RedundantBegin:
462
+ Exclude:
463
+ - 'extra/cockpit/foreman-cockpit-session'
464
+
465
+ # Offense count: 16
265
466
  # Cop supports --auto-correct.
266
467
  # Configuration parameters: AllowMultipleReturnValues.
267
468
  Style/RedundantReturn:
268
- Enabled: false
269
-
270
- # Offense count: 76
469
+ Exclude:
470
+ - 'app/helpers/remote_execution_helper.rb'
471
+ - 'app/models/concerns/foreman_remote_execution/errors_flattener.rb'
472
+ - 'app/models/foreign_input_set.rb'
473
+ - 'app/models/host_status/execution_status.rb'
474
+ - 'app/models/job_invocation.rb'
475
+ - 'extra/cockpit/foreman-cockpit-session'
476
+ - 'lib/foreman_remote_execution_core/polling_script_runner.rb'
477
+ - 'lib/foreman_remote_execution_core/script_runner.rb'
478
+ - 'test/support/remote_execution_helper.rb'
479
+
480
+ # Offense count: 79
271
481
  # Cop supports --auto-correct.
272
482
  Style/RedundantSelf:
273
483
  Enabled: false
@@ -275,25 +485,39 @@ Style/RedundantSelf:
275
485
  # Offense count: 3
276
486
  # Cop supports --auto-correct.
277
487
  Style/RescueModifier:
278
- Enabled: false
488
+ Exclude:
489
+ - 'extra/cockpit/foreman-cockpit-session'
490
+ - 'lib/foreman_remote_execution/engine.rb'
279
491
 
280
- # Offense count: 11
492
+ # Offense count: 13
281
493
  # Cop supports --auto-correct.
282
494
  # Configuration parameters: EnforcedStyle.
283
495
  # SupportedStyles: implicit, explicit
284
496
  Style/RescueStandardError:
285
- Enabled: false
497
+ Exclude:
498
+ - 'Rakefile'
499
+ - 'app/lib/actions/remote_execution/run_host_job.rb'
500
+ - 'app/lib/proxy_api/remote_execution_ssh.rb'
501
+ - 'app/models/concerns/foreman_remote_execution/orchestration/ssh.rb'
502
+ - 'app/models/input_template_renderer.rb'
503
+ - 'app/models/job_invocation_composer.rb'
504
+ - 'lib/foreman_remote_execution_core/polling_script_runner.rb'
505
+ - 'lib/foreman_remote_execution_core/script_runner.rb'
506
+ - 'lib/tasks/foreman_remote_execution_tasks.rake'
286
507
 
287
- # Offense count: 37
508
+ # Offense count: 1
288
509
  # Cop supports --auto-correct.
289
- # Configuration parameters: MinSize.
290
- # SupportedStyles: percent, brackets
291
- Style/SymbolArray:
292
- EnforcedStyle: brackets
510
+ # Configuration parameters: AllowModifier.
511
+ Style/SoleNestedConditional:
512
+ Exclude:
513
+ - 'app/helpers/concerns/foreman_remote_execution/job_templates_extensions.rb'
293
514
 
294
515
  # Offense count: 3
295
516
  # Cop supports --auto-correct.
296
517
  # Configuration parameters: IgnoredMethods.
297
518
  # IgnoredMethods: respond_to, define_method
298
519
  Style/SymbolProc:
299
- Enabled: false
520
+ Exclude:
521
+ - 'app/models/concerns/foreman_remote_execution/foreman_tasks_cleaner_extensions.rb'
522
+ - 'app/models/concerns/foreman_remote_execution/host_extensions.rb'
523
+ - 'app/models/job_invocation_composer.rb'