foreman_leapp 0.1.7 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/config/routes.rb +2 -1
- data/db/seeds.d/10_leapp_preupgrade.rb +8 -0
- data/lib/foreman_leapp/engine.rb +30 -21
- data/lib/foreman_leapp/version.rb +1 -1
- data/webpack/__mocks__/foremanReact/components/Pagination.js +2 -0
- data/webpack/components/PreupgradeReports/PreupgradeReportsHelpers.js +2 -2
- data/webpack/components/PreupgradeReports/__tests__/__snapshots__/PreupgradeReportsHelpers.test.js.snap +1 -25
- data/webpack/components/PreupgradeReportsList/__tests__/__snapshots__/PreupgradeReportsList.test.js.snap +2 -30
- data/webpack/components/PreupgradeReportsList/index.js +2 -4
- metadata +8 -28
- data/webpack/__mocks__/foremanReact/components/Pagination/PaginationWrapper.js +0 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1891f98edb810793eaf892578ca6a2fdafe87be017e1e3ee370ebbd008baaeb
|
4
|
+
data.tar.gz: 3a618bb3303b275113dc3ddaae440971f6f17939d274e4d0263c66424d5511b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 652a75504d5ccfb8b20580043c02335547d0ab1d763f936329558499d9e4bdfe1958c6fc091c76fc8c55a77babeb8b2beb89c655afc8c5ae33f48cf4494a0372
|
7
|
+
data.tar.gz: 05b6c03d647d507262bb8f7847c87da4cb97facc0ea20d139fd90e788e37bc51664de0bd56d5bba0f89c0731e40eff8f02daadf0beba2dc890a6a2fced63e44e
|
data/config/routes.rb
CHANGED
@@ -4,7 +4,8 @@ Rails.application.routes.draw do
|
|
4
4
|
resources :preupgrade_reports, :only => %i[index]
|
5
5
|
|
6
6
|
namespace :api, defaults: { format: 'json' } do
|
7
|
-
scope '(:apiv)', module: :v2, defaults: { apiv: 'v2' }, apiv: /v2/,
|
7
|
+
scope '(:apiv)', module: :v2, defaults: { apiv: 'v2' }, apiv: /v2/,
|
8
|
+
constraints: ApiConstraints.new( version: 2, default: true) do
|
8
9
|
resources :preupgrade_reports, only: %i[index show]
|
9
10
|
get 'job_invocations/:id/preupgrade_reports', to: 'preupgrade_reports#job_invocation'
|
10
11
|
end
|
@@ -4,6 +4,14 @@ organizations = Organization.unscoped.all
|
|
4
4
|
locations = Location.unscoped.all
|
5
5
|
User.as_anonymous_admin do
|
6
6
|
RemoteExecutionFeature.without_auditing do
|
7
|
+
if Rails.env.test? || Foreman.in_rake?
|
8
|
+
# If this file tries to import a template with a REX feature in a SeedsTest,
|
9
|
+
# it will fail - the REX feature isn't registered on SeedsTest because
|
10
|
+
# DatabaseCleaner truncates the db before every test.
|
11
|
+
# During db:seed, we also want to know the feature is registered before
|
12
|
+
# seeding the template
|
13
|
+
ForemanLeapp::Engine.register_rex_features
|
14
|
+
end
|
7
15
|
JobTemplate.without_auditing do
|
8
16
|
Dir[File.join("#{ForemanLeapp::Engine.root}/app/views/foreman_leapp/"\
|
9
17
|
'job_templates/**/*.erb')].each do |template|
|
data/lib/foreman_leapp/engine.rb
CHANGED
@@ -21,7 +21,7 @@ module ForemanLeapp
|
|
21
21
|
|
22
22
|
initializer 'foreman_leapp.register_plugin', before: :finisher_hook do |_app|
|
23
23
|
Foreman::Plugin.register :foreman_leapp do
|
24
|
-
requires_foreman '>= 2
|
24
|
+
requires_foreman '>= 3.2'
|
25
25
|
|
26
26
|
apipie_documented_controllers ["#{ForemanLeapp::Engine.root}/app/controllers/api/v2/*.rb"]
|
27
27
|
extend_template_helpers ForemanLeapp::TemplateHelper
|
@@ -36,6 +36,11 @@ module ForemanLeapp
|
|
36
36
|
::Helpers::JobHelper.correct_feature?(subject, 'leapp_remediation_plan')
|
37
37
|
}
|
38
38
|
end
|
39
|
+
|
40
|
+
security_block :foreman_leapp do
|
41
|
+
permission :view_job_invocations, { :preupgrade_reports => %i[index show job_invocation],
|
42
|
+
'api/v2/preupgrade_reports' => %i[index show job_invocation] }
|
43
|
+
end
|
39
44
|
end
|
40
45
|
end
|
41
46
|
|
@@ -48,26 +53,7 @@ module ForemanLeapp
|
|
48
53
|
Rails.logger.warn "ForemanLeapp: skipping engine hook (#{e})"
|
49
54
|
end
|
50
55
|
|
51
|
-
|
52
|
-
:leapp_preupgrade,
|
53
|
-
N_('Preupgrade check with Leapp'),
|
54
|
-
description: N_('Upgradeability check for RHEL 7 host'),
|
55
|
-
host_action_button: false
|
56
|
-
)
|
57
|
-
|
58
|
-
RemoteExecutionFeature.register(
|
59
|
-
:leapp_upgrade,
|
60
|
-
N_('Upgrade with Leapp'),
|
61
|
-
description: N_('Run Leapp upgrade job for RHEL 7 host'),
|
62
|
-
host_action_button: false
|
63
|
-
)
|
64
|
-
|
65
|
-
RemoteExecutionFeature.register(
|
66
|
-
:leapp_remediation_plan,
|
67
|
-
N_('Remediation plan'),
|
68
|
-
description: N_('Run Remediation plan with Leapp'),
|
69
|
-
host_action_button: false
|
70
|
-
)
|
56
|
+
ForemanLeapp::Engine.register_rex_features
|
71
57
|
end
|
72
58
|
|
73
59
|
rake_tasks do
|
@@ -97,5 +83,28 @@ module ForemanLeapp
|
|
97
83
|
initializer 'foreman_leapp.apipie' do
|
98
84
|
Apipie.configuration.checksum_path += ['/api/']
|
99
85
|
end
|
86
|
+
|
87
|
+
def self.register_rex_features
|
88
|
+
RemoteExecutionFeature.register(
|
89
|
+
:leapp_preupgrade,
|
90
|
+
N_('Preupgrade check with Leapp'),
|
91
|
+
description: N_('Upgradeability check for RHEL 7 host'),
|
92
|
+
host_action_button: false
|
93
|
+
)
|
94
|
+
|
95
|
+
RemoteExecutionFeature.register(
|
96
|
+
:leapp_upgrade,
|
97
|
+
N_('Upgrade with Leapp'),
|
98
|
+
description: N_('Run Leapp upgrade job for RHEL 7 host'),
|
99
|
+
host_action_button: false
|
100
|
+
)
|
101
|
+
|
102
|
+
RemoteExecutionFeature.register(
|
103
|
+
:leapp_remediation_plan,
|
104
|
+
N_('Remediation plan'),
|
105
|
+
description: N_('Run Remediation plan with Leapp'),
|
106
|
+
host_action_button: false
|
107
|
+
)
|
108
|
+
end
|
100
109
|
end
|
101
110
|
end
|
@@ -57,9 +57,9 @@ export const idsForInvocationFromReports = reports =>
|
|
57
57
|
idsForInvocationFromEntries(flattenEntries(reports));
|
58
58
|
|
59
59
|
export const entriesPage = (entries, pagination) => {
|
60
|
-
const offset = (pagination.page - 1) * pagination.
|
60
|
+
const offset = (pagination.page - 1) * pagination.per_page;
|
61
61
|
|
62
|
-
return entries.slice(offset, offset + pagination.
|
62
|
+
return entries.slice(offset, offset + pagination.per_page);
|
63
63
|
};
|
64
64
|
|
65
65
|
export const filterEntries = (attribute, value, entries) => {
|
@@ -131,31 +131,7 @@ Array [
|
|
131
131
|
]
|
132
132
|
`;
|
133
133
|
|
134
|
-
exports[`PreupgradeReportsHelpers should return entries page 1`] = `
|
135
|
-
Array [
|
136
|
-
Object {
|
137
|
-
"flags": Array [],
|
138
|
-
"hostname": "foo.example.com",
|
139
|
-
"id": 45,
|
140
|
-
"severity": "low",
|
141
|
-
"title": "Not enough credits",
|
142
|
-
},
|
143
|
-
Object {
|
144
|
-
"flags": Array [],
|
145
|
-
"hostname": "foo.example.com",
|
146
|
-
"id": 46,
|
147
|
-
"severity": "medium",
|
148
|
-
"title": "SELinux is turned off",
|
149
|
-
},
|
150
|
-
Object {
|
151
|
-
"flags": Array [],
|
152
|
-
"hostname": "foo.example.com",
|
153
|
-
"id": 47,
|
154
|
-
"severity": "medium",
|
155
|
-
"title": "Root password is too short",
|
156
|
-
},
|
157
|
-
]
|
158
|
-
`;
|
134
|
+
exports[`PreupgradeReportsHelpers should return entries page 1`] = `Array []`;
|
159
135
|
|
160
136
|
exports[`PreupgradeReportsHelpers should return fixable entries 1`] = `
|
161
137
|
Array [
|
@@ -59,23 +59,9 @@ exports[`PreupgradeReportsList should render 1`] = `
|
|
59
59
|
key="3"
|
60
60
|
toggleSelected={[Function]}
|
61
61
|
/>
|
62
|
-
<
|
63
|
-
dropdownButtonId="preupgrade-report-entries-pagination-dropdown"
|
62
|
+
<Pagination
|
64
63
|
itemCount={4}
|
65
64
|
onChange={[Function]}
|
66
|
-
pagination={
|
67
|
-
Object {
|
68
|
-
"page": 1,
|
69
|
-
"perPage": 20,
|
70
|
-
"perPageOptions": Array [
|
71
|
-
5,
|
72
|
-
10,
|
73
|
-
20,
|
74
|
-
30,
|
75
|
-
50,
|
76
|
-
],
|
77
|
-
}
|
78
|
-
}
|
79
65
|
viewType="list"
|
80
66
|
/>
|
81
67
|
</ListView>
|
@@ -140,23 +126,9 @@ exports[`PreupgradeReportsList should render when working 1`] = `
|
|
140
126
|
key="3"
|
141
127
|
toggleSelected={[Function]}
|
142
128
|
/>
|
143
|
-
<
|
144
|
-
dropdownButtonId="preupgrade-report-entries-pagination-dropdown"
|
129
|
+
<Pagination
|
145
130
|
itemCount={4}
|
146
131
|
onChange={[Function]}
|
147
|
-
pagination={
|
148
|
-
Object {
|
149
|
-
"page": 1,
|
150
|
-
"perPage": 20,
|
151
|
-
"perPageOptions": Array [
|
152
|
-
5,
|
153
|
-
10,
|
154
|
-
20,
|
155
|
-
30,
|
156
|
-
50,
|
157
|
-
],
|
158
|
-
}
|
159
|
-
}
|
160
132
|
viewType="list"
|
161
133
|
/>
|
162
134
|
</ListView>
|
@@ -2,7 +2,7 @@ import React, { useState } from 'react';
|
|
2
2
|
import { ListView } from 'patternfly-react';
|
3
3
|
import PropTypes from 'prop-types';
|
4
4
|
|
5
|
-
import Pagination from 'foremanReact/components/Pagination
|
5
|
+
import Pagination from 'foremanReact/components/Pagination';
|
6
6
|
import { useForemanSettings } from 'foremanReact/Root/Context/ForemanContext';
|
7
7
|
|
8
8
|
import PreupgradeReportEntry from './components/PreupgradeReportEntry';
|
@@ -22,7 +22,7 @@ const PreupgradeReportsList = ({
|
|
22
22
|
const { perPage, perPageOptions } = useForemanSettings();
|
23
23
|
const [pagination, setPagination] = useState({
|
24
24
|
page: 1,
|
25
|
-
perPage,
|
25
|
+
per_page: perPage,
|
26
26
|
perPageOptions,
|
27
27
|
});
|
28
28
|
|
@@ -44,9 +44,7 @@ const PreupgradeReportsList = ({
|
|
44
44
|
<Pagination
|
45
45
|
viewType="list"
|
46
46
|
itemCount={allEntries.length}
|
47
|
-
pagination={pagination}
|
48
47
|
onChange={newPage => setPagination({ ...pagination, ...newPage })}
|
49
|
-
dropdownButtonId="preupgrade-report-entries-pagination-dropdown"
|
50
48
|
/>
|
51
49
|
</ListView>
|
52
50
|
);
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_leapp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Foreman Leapp team
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-04-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: foreman_remote_execution
|
@@ -17,9 +17,6 @@ dependencies:
|
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '3.2'
|
20
|
-
- - "<"
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: '5.0'
|
23
20
|
type: :runtime
|
24
21
|
prerelease: false
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -27,9 +24,6 @@ dependencies:
|
|
27
24
|
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '3.2'
|
30
|
-
- - "<"
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: '5.0'
|
33
27
|
- !ruby/object:Gem::Dependency
|
34
28
|
name: foreman_ansible
|
35
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -58,20 +52,6 @@ dependencies:
|
|
58
52
|
- - "~>"
|
59
53
|
- !ruby/object:Gem::Version
|
60
54
|
version: '6.2'
|
61
|
-
- !ruby/object:Gem::Dependency
|
62
|
-
name: rubocop
|
63
|
-
requirement: !ruby/object:Gem::Requirement
|
64
|
-
requirements:
|
65
|
-
- - "~>"
|
66
|
-
- !ruby/object:Gem::Version
|
67
|
-
version: '0.80'
|
68
|
-
type: :development
|
69
|
-
prerelease: false
|
70
|
-
version_requirements: !ruby/object:Gem::Requirement
|
71
|
-
requirements:
|
72
|
-
- - "~>"
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
version: '0.80'
|
75
55
|
description: A Foreman plugin to support inplace RHEL 7 -> RHEL 8 upgrades with Leapp
|
76
56
|
utility.
|
77
57
|
email:
|
@@ -134,7 +114,7 @@ files:
|
|
134
114
|
- test/unit/helpers/job_helper_test.rb
|
135
115
|
- webpack/__mocks__/foremanReact/Root/Context/ForemanContext.js
|
136
116
|
- webpack/__mocks__/foremanReact/common/I18n.js
|
137
|
-
- webpack/__mocks__/foremanReact/components/Pagination
|
117
|
+
- webpack/__mocks__/foremanReact/components/Pagination.js
|
138
118
|
- webpack/__mocks__/foremanReact/components/common/EmptyState.js
|
139
119
|
- webpack/__mocks__/foremanReact/components/common/MessageBox.js
|
140
120
|
- webpack/components/PreupgradeReports/PreupgradeReports.js
|
@@ -199,11 +179,11 @@ files:
|
|
199
179
|
- webpack/index.js
|
200
180
|
- webpack/reducer.js
|
201
181
|
- webpack/testSetup.js
|
202
|
-
homepage: https://github.com/
|
182
|
+
homepage: https://github.com/theforeman/foreman_leapp
|
203
183
|
licenses:
|
204
184
|
- GPL-3.0
|
205
185
|
metadata: {}
|
206
|
-
post_install_message:
|
186
|
+
post_install_message:
|
207
187
|
rdoc_options: []
|
208
188
|
require_paths:
|
209
189
|
- lib
|
@@ -218,8 +198,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
218
198
|
- !ruby/object:Gem::Version
|
219
199
|
version: '0'
|
220
200
|
requirements: []
|
221
|
-
rubygems_version: 3.
|
222
|
-
signing_key:
|
201
|
+
rubygems_version: 3.3.7
|
202
|
+
signing_key:
|
223
203
|
specification_version: 4
|
224
204
|
summary: A Foreman plugin for Leapp utility.
|
225
205
|
test_files:
|