foreman_remote_execution 1.5.0 → 1.5.1
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/.babelrc +9 -0
- data/.eslintignore +3 -0
- data/.eslintrc +49 -0
- data/.gitignore +1 -0
- data/.hound.yml +5 -0
- data/.rubocop.yml +4 -1
- data/.rubocop_todo.yml +63 -35
- data/.travis.yml +6 -0
- data/app/assets/javascripts/foreman_remote_execution/template_invocation.js +1 -1
- data/app/assets/stylesheets/foreman_remote_execution/job_invocations.css.scss +0 -14
- data/app/controllers/job_invocations_controller.rb +18 -0
- data/app/helpers/job_invocations_chart_helper.rb +77 -0
- data/app/helpers/job_invocations_helper.rb +79 -0
- data/app/helpers/remote_execution_helper.rb +10 -50
- data/app/models/job_invocation.rb +4 -0
- data/app/models/remote_execution_provider.rb +4 -0
- data/app/views/job_invocations/_card_results.html.erb +11 -0
- data/app/views/job_invocations/_card_schedule.html.erb +32 -0
- data/app/views/job_invocations/_card_target_hosts.html.erb +33 -0
- data/app/views/job_invocations/_card_user_input.html.erb +16 -0
- data/app/views/job_invocations/_tab_hosts.html.erb +1 -1
- data/app/views/job_invocations/_tab_overview.html.erb +25 -55
- data/app/views/job_invocations/_tab_preview_templates.html.erb +20 -0
- data/app/views/job_invocations/_user_input.html.erb +21 -0
- data/app/views/job_invocations/show.html.erb +14 -8
- data/app/views/job_invocations/show.js.erb +3 -6
- data/config/routes.rb +1 -0
- data/lib/foreman_remote_execution/engine.rb +2 -2
- data/lib/foreman_remote_execution/version.rb +1 -1
- data/package.json +62 -0
- data/test/unit/job_invocation_test.rb +15 -0
- data/webpack/index.js +29 -0
- data/webpack/react_app/components/jobInvocations/AggregateStatus/index.js +34 -0
- data/webpack/react_app/components/jobInvocations/AggregateStatus/index.test.js +36 -0
- data/webpack/react_app/components/jobInvocations/index.js +58 -0
- data/webpack/react_app/redux/actions/jobInvocations/index.js +74 -0
- data/webpack/react_app/redux/consts.js +6 -0
- data/webpack/react_app/redux/reducers/index.js +6 -0
- data/webpack/react_app/redux/reducers/jobInvocations/index.fixtures.js +78 -0
- data/webpack/react_app/redux/reducers/jobInvocations/index.js +32 -0
- data/webpack/react_app/redux/reducers/jobInvocations/index.test.js +37 -0
- data/webpack/test_setup.js +11 -0
- metadata +26 -2
@@ -0,0 +1,32 @@
|
|
1
|
+
import Immutable from 'seamless-immutable';
|
2
|
+
|
3
|
+
import {
|
4
|
+
JOB_INVOCATIONS_GET_JOB_INVOCATIONS,
|
5
|
+
JOB_INVOCATIONS_POLLING_STARTED,
|
6
|
+
JOB_INVOCATIONS_JOB_FINISHED,
|
7
|
+
} from '../../consts';
|
8
|
+
|
9
|
+
const initialState = Immutable({
|
10
|
+
isPolling: false,
|
11
|
+
jobInvocations: [],
|
12
|
+
statuses: [],
|
13
|
+
});
|
14
|
+
|
15
|
+
export default (state = initialState, action) => {
|
16
|
+
const { payload } = action;
|
17
|
+
switch (action.type) {
|
18
|
+
case JOB_INVOCATIONS_POLLING_STARTED:
|
19
|
+
return state.set('isPolling', true);
|
20
|
+
case JOB_INVOCATIONS_JOB_FINISHED:
|
21
|
+
return state
|
22
|
+
.set('isPolling', false)
|
23
|
+
.set('jobInvocations', payload.jobInvocations.job_invocations)
|
24
|
+
.set('statuses', payload.jobInvocations.statuses);
|
25
|
+
case JOB_INVOCATIONS_GET_JOB_INVOCATIONS:
|
26
|
+
return state
|
27
|
+
.set('jobInvocations', payload.jobInvocations.job_invocations)
|
28
|
+
.set('statuses', payload.jobInvocations.statuses);
|
29
|
+
default:
|
30
|
+
return state;
|
31
|
+
}
|
32
|
+
};
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import {
|
2
|
+
JOB_INVOCATIONS_GET_JOB_INVOCATIONS,
|
3
|
+
JOB_INVOCATIONS_POLLING_STARTED,
|
4
|
+
JOB_INVOCATIONS_JOB_FINISHED,
|
5
|
+
} from '../../consts';
|
6
|
+
|
7
|
+
import {
|
8
|
+
initialState,
|
9
|
+
pollingStarted,
|
10
|
+
jobInvocationsPayload,
|
11
|
+
jobInvocationsReceived,
|
12
|
+
} from './index.fixtures';
|
13
|
+
|
14
|
+
import reducer from './index';
|
15
|
+
|
16
|
+
describe('job invocations chart reducer', () => {
|
17
|
+
it('should return the initial state', () => {
|
18
|
+
expect(reducer(undefined, {})).toEqual(initialState);
|
19
|
+
});
|
20
|
+
it('should start polling given POLLING_STARTED', () => {
|
21
|
+
expect(reducer(initialState, {
|
22
|
+
type: JOB_INVOCATIONS_POLLING_STARTED,
|
23
|
+
})).toEqual(pollingStarted);
|
24
|
+
});
|
25
|
+
it('should stop polling given JOB_FINISHED', () => {
|
26
|
+
expect(reducer(pollingStarted, {
|
27
|
+
type: JOB_INVOCATIONS_JOB_FINISHED,
|
28
|
+
payload: { jobInvocations: { job_invocations: [], statuses: [] } },
|
29
|
+
})).toEqual(initialState);
|
30
|
+
});
|
31
|
+
it('should receive job invocations given GET_JOB_INVOCATIONS', () => {
|
32
|
+
expect(reducer(pollingStarted, {
|
33
|
+
type: JOB_INVOCATIONS_GET_JOB_INVOCATIONS,
|
34
|
+
payload: jobInvocationsPayload,
|
35
|
+
})).toEqual(jobInvocationsReceived);
|
36
|
+
});
|
37
|
+
});
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import 'babel-polyfill';
|
2
|
+
|
3
|
+
import { configure } from 'enzyme';
|
4
|
+
import Adapter from 'enzyme-adapter-react-16';
|
5
|
+
|
6
|
+
configure({ adapter: new Adapter() });
|
7
|
+
|
8
|
+
// Mocking translation function
|
9
|
+
global.__ = str => str;
|
10
|
+
global.n__ = str => str;
|
11
|
+
global.Jed = { sprintf: str => str };
|
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: 1.5.
|
4
|
+
version: 1.5.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: 2018-04-
|
11
|
+
date: 2018-04-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: deface
|
@@ -124,10 +124,14 @@ extra_rdoc_files:
|
|
124
124
|
- README.md
|
125
125
|
- LICENSE
|
126
126
|
files:
|
127
|
+
- ".babelrc"
|
128
|
+
- ".eslintignore"
|
129
|
+
- ".eslintrc"
|
127
130
|
- ".gitignore"
|
128
131
|
- ".hound.yml"
|
129
132
|
- ".rubocop.yml"
|
130
133
|
- ".rubocop_todo.yml"
|
134
|
+
- ".travis.yml"
|
131
135
|
- ".tx/config"
|
132
136
|
- Gemfile
|
133
137
|
- LICENSE
|
@@ -157,6 +161,8 @@ files:
|
|
157
161
|
- app/helpers/concerns/foreman_remote_execution/hosts_helper_extensions.rb
|
158
162
|
- app/helpers/concerns/foreman_remote_execution/job_templates_extensions.rb
|
159
163
|
- app/helpers/job_invocation_output_helper.rb
|
164
|
+
- app/helpers/job_invocations_chart_helper.rb
|
165
|
+
- app/helpers/job_invocations_helper.rb
|
160
166
|
- app/helpers/remote_execution_helper.rb
|
161
167
|
- app/lib/actions/middleware/bind_job_invocation.rb
|
162
168
|
- app/lib/actions/remote_execution/run_host_job.rb
|
@@ -225,6 +231,10 @@ files:
|
|
225
231
|
- app/views/api/v2/template_inputs/show.json.rabl
|
226
232
|
- app/views/dashboard/.gitkeep
|
227
233
|
- app/views/job_invocation_task_groups/_job_invocation_task_groups.html.erb
|
234
|
+
- app/views/job_invocations/_card_results.html.erb
|
235
|
+
- app/views/job_invocations/_card_schedule.html.erb
|
236
|
+
- app/views/job_invocations/_card_target_hosts.html.erb
|
237
|
+
- app/views/job_invocations/_card_user_input.html.erb
|
228
238
|
- app/views/job_invocations/_description_fields.html.erb
|
229
239
|
- app/views/job_invocations/_form.html.erb
|
230
240
|
- app/views/job_invocations/_host_actions_td.html.erb
|
@@ -234,6 +244,8 @@ files:
|
|
234
244
|
- app/views/job_invocations/_preview_hosts_modal.html.erb
|
235
245
|
- app/views/job_invocations/_tab_hosts.html.erb
|
236
246
|
- app/views/job_invocations/_tab_overview.html.erb
|
247
|
+
- app/views/job_invocations/_tab_preview_templates.html.erb
|
248
|
+
- app/views/job_invocations/_user_input.html.erb
|
237
249
|
- app/views/job_invocations/index.html.erb
|
238
250
|
- app/views/job_invocations/new.html.erb
|
239
251
|
- app/views/job_invocations/refresh.js.erb
|
@@ -341,6 +353,7 @@ files:
|
|
341
353
|
- locale/zh_CN/foreman_remote_execution.po
|
342
354
|
- locale/zh_TW/LC_MESSAGES/foreman_remote_execution.mo
|
343
355
|
- locale/zh_TW/foreman_remote_execution.po
|
356
|
+
- package.json
|
344
357
|
- test/benchmark/run_hosts_job_benchmark.rb
|
345
358
|
- test/benchmark/targeting_benchmark.rb
|
346
359
|
- test/factories/foreman_remote_execution_factories.rb
|
@@ -367,6 +380,17 @@ files:
|
|
367
380
|
- test/unit/targeting_test.rb
|
368
381
|
- test/unit/template_input_test.rb
|
369
382
|
- test/unit/template_invocation_input_value_test.rb
|
383
|
+
- webpack/index.js
|
384
|
+
- webpack/react_app/components/jobInvocations/AggregateStatus/index.js
|
385
|
+
- webpack/react_app/components/jobInvocations/AggregateStatus/index.test.js
|
386
|
+
- webpack/react_app/components/jobInvocations/index.js
|
387
|
+
- webpack/react_app/redux/actions/jobInvocations/index.js
|
388
|
+
- webpack/react_app/redux/consts.js
|
389
|
+
- webpack/react_app/redux/reducers/index.js
|
390
|
+
- webpack/react_app/redux/reducers/jobInvocations/index.fixtures.js
|
391
|
+
- webpack/react_app/redux/reducers/jobInvocations/index.js
|
392
|
+
- webpack/react_app/redux/reducers/jobInvocations/index.test.js
|
393
|
+
- webpack/test_setup.js
|
370
394
|
homepage: https://github.com/theforeman/foreman_remote_execution
|
371
395
|
licenses: []
|
372
396
|
metadata: {}
|