foreman_remote_execution 4.2.0 → 4.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/js_ci.yml +29 -0
- data/.github/workflows/{ci.yml → ruby_ci.yml} +22 -50
- data/.prettierrc +4 -0
- data/.rubocop.yml +13 -49
- data/.rubocop_todo.yml +326 -102
- data/Gemfile +1 -4
- data/app/controllers/api/v2/job_invocations_controller.rb +1 -1
- data/app/controllers/ui_job_wizard_controller.rb +18 -0
- data/app/lib/actions/remote_execution/run_host_job.rb +38 -1
- data/app/lib/foreman_remote_execution/renderer/scope/input.rb +1 -0
- data/app/models/foreign_input_set.rb +1 -1
- data/app/models/host_status/execution_status.rb +7 -0
- data/app/models/job_invocation.rb +1 -1
- data/app/models/job_invocation_composer.rb +1 -1
- data/app/views/template_invocations/show.html.erb +30 -23
- data/config/routes.rb +4 -0
- data/foreman_remote_execution.gemspec +1 -2
- data/lib/foreman_remote_execution/engine.rb +12 -1
- data/lib/foreman_remote_execution/version.rb +1 -1
- data/lib/tasks/foreman_remote_execution_tasks.rake +1 -18
- data/test/functional/api/v2/job_invocations_controller_test.rb +24 -4
- data/test/functional/api/v2/registration_controller_test.rb +4 -13
- data/test/functional/ui_job_wizard_controller_test.rb +16 -0
- data/webpack/JobWizard/JobWizard.js +32 -0
- data/webpack/JobWizard/index.js +32 -0
- data/webpack/Routes/routes.js +12 -0
- data/webpack/__mocks__/foremanReact/history.js +1 -0
- data/webpack/global_index.js +4 -0
- data/webpack/react_app/components/TargetingHosts/TargetingHostsPage.js +1 -1
- data/webpack/react_app/components/TargetingHosts/TargetingHostsPage.scss +0 -3
- data/webpack/react_app/components/TargetingHosts/__tests__/__snapshots__/TargetingHostsPage.test.js.snap +1 -1
- metadata +15 -19
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'test_plugin_helper'
|
2
|
+
|
3
|
+
class UiJobWizardControllerTest < ActionController::TestCase
|
4
|
+
def setup
|
5
|
+
FactoryBot.create(:job_template, :job_category => 'cat1')
|
6
|
+
FactoryBot.create(:job_template, :job_category => 'cat2')
|
7
|
+
FactoryBot.create(:job_template, :job_category => 'cat2')
|
8
|
+
end
|
9
|
+
|
10
|
+
test 'should respond with categories' do
|
11
|
+
get :categories, :params => {}, :session => set_session_user
|
12
|
+
assert_response :success
|
13
|
+
res = JSON.parse @response.body
|
14
|
+
assert_equal ['cat1','cat2'], res['job_categories']
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { Wizard } from '@patternfly/react-core';
|
3
|
+
import { translate as __ } from 'foremanReact/common/I18n';
|
4
|
+
import history from 'foremanReact/history';
|
5
|
+
|
6
|
+
export const JobWizard = () => {
|
7
|
+
const steps = [
|
8
|
+
{
|
9
|
+
name: __('Category and template'),
|
10
|
+
component: <p>Category and template</p>,
|
11
|
+
},
|
12
|
+
{ name: __('Target hosts'), component: <p>TargetHosts </p> },
|
13
|
+
{ name: __('Advanced fields'), component: <p> AdvancedFields </p> },
|
14
|
+
{ name: __('Schedule'), component: <p>Schedule</p> },
|
15
|
+
{
|
16
|
+
name: __('Review details'),
|
17
|
+
component: <p>ReviewDetails</p>,
|
18
|
+
nextButtonText: 'Run',
|
19
|
+
},
|
20
|
+
];
|
21
|
+
const title = __('Run Job');
|
22
|
+
return (
|
23
|
+
<Wizard
|
24
|
+
onClose={() => history.goBack()}
|
25
|
+
navAriaLabel={`${title} steps`}
|
26
|
+
steps={steps}
|
27
|
+
height="70vh"
|
28
|
+
/>
|
29
|
+
);
|
30
|
+
};
|
31
|
+
|
32
|
+
export default JobWizard;
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { Title, Divider } from '@patternfly/react-core';
|
3
|
+
import { translate as __ } from 'foremanReact/common/I18n';
|
4
|
+
import PageLayout from 'foremanReact/routes/common/PageLayout/PageLayout';
|
5
|
+
import { JobWizard } from './JobWizard';
|
6
|
+
|
7
|
+
const JobWizardPage = () => {
|
8
|
+
const title = __('Run job');
|
9
|
+
const breadcrumbOptions = {
|
10
|
+
breadcrumbItems: [
|
11
|
+
{ caption: __('Jobs'), url: `/jobs` },
|
12
|
+
{ caption: title },
|
13
|
+
],
|
14
|
+
};
|
15
|
+
return (
|
16
|
+
<PageLayout
|
17
|
+
header={title}
|
18
|
+
breadcrumbOptions={breadcrumbOptions}
|
19
|
+
searchable={false}
|
20
|
+
>
|
21
|
+
<React.Fragment>
|
22
|
+
<Title headingLevel="h2" size="2xl">
|
23
|
+
{title}
|
24
|
+
</Title>
|
25
|
+
<Divider component="div" />
|
26
|
+
<JobWizard />
|
27
|
+
</React.Fragment>
|
28
|
+
</PageLayout>
|
29
|
+
);
|
30
|
+
};
|
31
|
+
|
32
|
+
export default JobWizardPage;
|
@@ -0,0 +1 @@
|
|
1
|
+
export default { goBack: () => null };
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_remote_execution
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Foreman Remote Execution team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-04-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: deface
|
@@ -64,14 +64,14 @@ dependencies:
|
|
64
64
|
requirements:
|
65
65
|
- - ">="
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version: 0.
|
67
|
+
version: 4.0.0
|
68
68
|
type: :runtime
|
69
69
|
prerelease: false
|
70
70
|
version_requirements: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
72
|
- - ">="
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
version: 0.
|
74
|
+
version: 4.0.0
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
76
|
name: factory_bot_rails
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,20 +86,6 @@ dependencies:
|
|
86
86
|
- - "~>"
|
87
87
|
- !ruby/object:Gem::Version
|
88
88
|
version: 4.8.0
|
89
|
-
- !ruby/object:Gem::Dependency
|
90
|
-
name: rubocop
|
91
|
-
requirement: !ruby/object:Gem::Requirement
|
92
|
-
requirements:
|
93
|
-
- - "~>"
|
94
|
-
- !ruby/object:Gem::Version
|
95
|
-
version: 0.80.0
|
96
|
-
type: :development
|
97
|
-
prerelease: false
|
98
|
-
version_requirements: !ruby/object:Gem::Requirement
|
99
|
-
requirements:
|
100
|
-
- - "~>"
|
101
|
-
- !ruby/object:Gem::Version
|
102
|
-
version: 0.80.0
|
103
89
|
- !ruby/object:Gem::Dependency
|
104
90
|
name: rdoc
|
105
91
|
requirement: !ruby/object:Gem::Requirement
|
@@ -127,8 +113,10 @@ files:
|
|
127
113
|
- ".babelrc.js"
|
128
114
|
- ".eslintignore"
|
129
115
|
- ".eslintrc"
|
130
|
-
- ".github/workflows/
|
116
|
+
- ".github/workflows/js_ci.yml"
|
117
|
+
- ".github/workflows/ruby_ci.yml"
|
131
118
|
- ".gitignore"
|
119
|
+
- ".prettierrc"
|
132
120
|
- ".rubocop.yml"
|
133
121
|
- ".rubocop_todo.yml"
|
134
122
|
- ".tx/config"
|
@@ -160,6 +148,7 @@ files:
|
|
160
148
|
- app/controllers/job_templates_controller.rb
|
161
149
|
- app/controllers/remote_execution_features_controller.rb
|
162
150
|
- app/controllers/template_invocations_controller.rb
|
151
|
+
- app/controllers/ui_job_wizard_controller.rb
|
163
152
|
- app/helpers/concerns/foreman_remote_execution/hosts_helper_extensions.rb
|
164
153
|
- app/helpers/concerns/foreman_remote_execution/job_templates_extensions.rb
|
165
154
|
- app/helpers/job_invocation_output_helper.rb
|
@@ -385,6 +374,7 @@ files:
|
|
385
374
|
- test/functional/cockpit_controller_test.rb
|
386
375
|
- test/functional/job_invocations_controller_test.rb
|
387
376
|
- test/functional/job_templates_controller_test.rb
|
377
|
+
- test/functional/ui_job_wizard_controller_test.rb
|
388
378
|
- test/helpers/remote_execution_helper_test.rb
|
389
379
|
- test/models/orchestration/ssh_test.rb
|
390
380
|
- test/support/remote_execution_helper.rb
|
@@ -405,13 +395,18 @@ files:
|
|
405
395
|
- test/unit/renderer_scope_input.rb
|
406
396
|
- test/unit/targeting_test.rb
|
407
397
|
- test/unit/template_invocation_input_value_test.rb
|
398
|
+
- webpack/JobWizard/JobWizard.js
|
399
|
+
- webpack/JobWizard/index.js
|
400
|
+
- webpack/Routes/routes.js
|
408
401
|
- webpack/__mocks__/foremanReact/common/I18n.js
|
409
402
|
- webpack/__mocks__/foremanReact/components/Pagination/PaginationWrapper.js
|
410
403
|
- webpack/__mocks__/foremanReact/components/SearchBar.js
|
411
404
|
- webpack/__mocks__/foremanReact/components/common/ActionButtons/ActionButtons.js
|
412
405
|
- webpack/__mocks__/foremanReact/constants.js
|
406
|
+
- webpack/__mocks__/foremanReact/history.js
|
413
407
|
- webpack/__mocks__/foremanReact/redux/API/APISelectors.js
|
414
408
|
- webpack/__mocks__/foremanReact/redux/middlewares/IntervalMiddleware/IntervalSelectors.js
|
409
|
+
- webpack/global_index.js
|
415
410
|
- webpack/index.js
|
416
411
|
- webpack/react_app/components/TargetingHosts/TargetingHosts.js
|
417
412
|
- webpack/react_app/components/TargetingHosts/TargetingHostsConsts.js
|
@@ -480,6 +475,7 @@ test_files:
|
|
480
475
|
- test/functional/cockpit_controller_test.rb
|
481
476
|
- test/functional/job_invocations_controller_test.rb
|
482
477
|
- test/functional/job_templates_controller_test.rb
|
478
|
+
- test/functional/ui_job_wizard_controller_test.rb
|
483
479
|
- test/helpers/remote_execution_helper_test.rb
|
484
480
|
- test/models/orchestration/ssh_test.rb
|
485
481
|
- test/support/remote_execution_helper.rb
|