foreman_remote_execution 9.0.1 → 9.1.0
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/app/controllers/api/v2/job_invocations_controller.rb +1 -0
- data/app/controllers/job_invocations_controller.rb +10 -0
- data/app/controllers/ui_job_wizard_controller.rb +6 -1
- data/app/helpers/remote_execution_helper.rb +1 -1
- data/app/lib/actions/remote_execution/run_hosts_job.rb +28 -2
- data/app/models/remote_execution_feature.rb +11 -8
- data/app/views/api/v2/job_invocations/base.json.rabl +1 -1
- data/app/views/job_invocations/show.html.erb +1 -1
- data/app/views/job_invocations/welcome.html.erb +1 -1
- data/config/routes.rb +1 -0
- data/db/migrate/20210816100932_rex_setting_category_to_dsl.rb +1 -1
- data/db/migrate/20220426145007_add_unique_feature_label_index.rb +14 -0
- data/lib/foreman_remote_execution/engine.rb +1 -1
- data/lib/foreman_remote_execution/version.rb +1 -1
- data/locale/action_names.rb +1 -1
- data/locale/de/LC_MESSAGES/foreman_remote_execution.mo +0 -0
- data/locale/de/foreman_remote_execution.po +15 -12
- data/locale/en/LC_MESSAGES/foreman_remote_execution.mo +0 -0
- data/locale/en/foreman_remote_execution.po +4 -1
- data/locale/en_GB/LC_MESSAGES/foreman_remote_execution.mo +0 -0
- data/locale/en_GB/foreman_remote_execution.po +6 -3
- data/locale/es/LC_MESSAGES/foreman_remote_execution.mo +0 -0
- data/locale/es/foreman_remote_execution.po +16 -13
- data/locale/foreman_remote_execution.pot +25 -17
- data/locale/fr/LC_MESSAGES/foreman_remote_execution.mo +0 -0
- data/locale/fr/foreman_remote_execution.po +51 -48
- data/locale/ja/LC_MESSAGES/foreman_remote_execution.mo +0 -0
- data/locale/ja/foreman_remote_execution.po +17 -14
- data/locale/ko/LC_MESSAGES/foreman_remote_execution.mo +0 -0
- data/locale/ko/foreman_remote_execution.po +12 -9
- data/locale/pt_BR/LC_MESSAGES/foreman_remote_execution.mo +0 -0
- data/locale/pt_BR/foreman_remote_execution.po +13 -10
- data/locale/ru/LC_MESSAGES/foreman_remote_execution.mo +0 -0
- data/locale/ru/foreman_remote_execution.po +12 -9
- data/locale/zh_CN/LC_MESSAGES/foreman_remote_execution.mo +0 -0
- data/locale/zh_CN/foreman_remote_execution.po +16 -13
- data/locale/zh_TW/LC_MESSAGES/foreman_remote_execution.mo +0 -0
- data/locale/zh_TW/foreman_remote_execution.po +12 -9
- data/package.json +6 -6
- data/webpack/JobWizard/JobWizard.js +97 -32
- data/webpack/JobWizard/StartsBeforeErrorAlert.js +17 -0
- data/webpack/JobWizard/__tests__/__snapshots__/integration.test.js.snap +8 -0
- data/webpack/JobWizard/__tests__/fixtures.js +5 -0
- data/webpack/JobWizard/__tests__/integration.test.js +15 -0
- data/webpack/JobWizard/__tests__/validation.test.js +27 -0
- data/webpack/JobWizard/autofill.js +1 -0
- data/webpack/JobWizard/steps/AdvancedFields/__tests__/AdvancedFields.test.js +29 -10
- data/webpack/JobWizard/steps/AdvancedFields/__tests__/__snapshots__/AdvancedFields.test.js.snap +8 -0
- data/webpack/JobWizard/steps/HostsAndInputs/HostPreviewModal.js +3 -0
- data/webpack/JobWizard/steps/HostsAndInputs/__tests__/HostsAndInputs.test.js +38 -1
- data/webpack/JobWizard/steps/HostsAndInputs/buildHostQuery.js +16 -10
- data/webpack/JobWizard/steps/HostsAndInputs/index.js +51 -3
- data/webpack/JobWizard/steps/Schedule/__tests__/Schedule.test.js +33 -13
- data/webpack/JobWizard/steps/form/DateTimePicker.js +1 -1
- data/webpack/JobWizard/submit.js +14 -3
- metadata +4 -2
@@ -39,15 +39,35 @@ api.get.mockImplementation(({ handleSuccess, ...action }) => {
|
|
39
39
|
handleSuccess({
|
40
40
|
data: { results: [jobTemplateResponse.job_template] },
|
41
41
|
});
|
42
|
+
} else if (action.key === 'HOST_IDS') {
|
43
|
+
handleSuccess &&
|
44
|
+
handleSuccess({
|
45
|
+
data: { results: [{ name: 'host1' }, { name: 'host3' }] },
|
46
|
+
});
|
42
47
|
}
|
43
48
|
return { type: 'get', ...action };
|
44
49
|
});
|
45
50
|
|
46
51
|
const mockStore = configureMockStore([]);
|
47
|
-
const store = mockStore({
|
52
|
+
const store = mockStore({
|
53
|
+
HOSTS_API: {
|
54
|
+
response: {
|
55
|
+
subtotal: 3,
|
56
|
+
},
|
57
|
+
},
|
58
|
+
});
|
48
59
|
jest.useFakeTimers();
|
49
60
|
|
50
61
|
describe('Schedule', () => {
|
62
|
+
beforeEach(() => {
|
63
|
+
jest.spyOn(selectors, 'selectRouterSearch');
|
64
|
+
selectors.selectRouterSearch.mockImplementation(() => ({
|
65
|
+
'host_ids[]': ['105', '37'],
|
66
|
+
}));
|
67
|
+
});
|
68
|
+
afterEach(() => {
|
69
|
+
selectors.selectRouterSearch.mockRestore();
|
70
|
+
});
|
51
71
|
it('sub steps appear', () => {
|
52
72
|
render(
|
53
73
|
<Provider store={store}>
|
@@ -85,7 +105,7 @@ describe('Schedule', () => {
|
|
85
105
|
});
|
86
106
|
act(() => {
|
87
107
|
fireEvent.click(screen.getByRole('button', { name: 'Future execution' }));
|
88
|
-
jest.
|
108
|
+
jest.advanceTimersByTime(1000); // to handle pf4 date picker popover useTimer
|
89
109
|
});
|
90
110
|
|
91
111
|
const newStartAtDate = '2030/03/12';
|
@@ -115,7 +135,7 @@ describe('Schedule', () => {
|
|
115
135
|
fireEvent.change(startsBeforeTimeField(), {
|
116
136
|
target: { value: newStartBeforeTime },
|
117
137
|
});
|
118
|
-
jest.
|
138
|
+
jest.advanceTimersByTime(1000);
|
119
139
|
});
|
120
140
|
|
121
141
|
act(() => {
|
@@ -123,7 +143,7 @@ describe('Schedule', () => {
|
|
123
143
|
});
|
124
144
|
act(() => {
|
125
145
|
fireEvent.click(screen.getByRole('button', { name: 'Future execution' }));
|
126
|
-
jest.
|
146
|
+
jest.advanceTimersByTime(1000); // to handle pf4 date picker popover useTimer
|
127
147
|
});
|
128
148
|
expect(startsAtDateField().value).toBe(newStartAtDate);
|
129
149
|
expect(startsAtTimeField().value).toBe(newStartAtTime);
|
@@ -140,7 +160,7 @@ describe('Schedule', () => {
|
|
140
160
|
target: { value: '2030/03/11' },
|
141
161
|
});
|
142
162
|
await fireEvent.click(startsBeforeTimeField());
|
143
|
-
await jest.
|
163
|
+
await jest.advanceTimersByTime(1000);
|
144
164
|
});
|
145
165
|
expect(startsBeforeDateField().value).toBe('2030/03/11');
|
146
166
|
expect(
|
@@ -157,13 +177,13 @@ describe('Schedule', () => {
|
|
157
177
|
await fireEvent.change(startsAtDateField(), {
|
158
178
|
target: { value: '' },
|
159
179
|
});
|
160
|
-
jest.
|
180
|
+
jest.advanceTimersByTime(1000);
|
161
181
|
});
|
162
182
|
|
163
183
|
expect(startsBeforeDateField().value).toBe('2019/03/11');
|
164
184
|
expect(
|
165
185
|
screen.getAllByText("'Starts before' date must in the future")
|
166
|
-
).toHaveLength(
|
186
|
+
).toHaveLength(2);
|
167
187
|
});
|
168
188
|
|
169
189
|
it('Recurring execution - date pickers', async () => {
|
@@ -182,7 +202,7 @@ describe('Schedule', () => {
|
|
182
202
|
fireEvent.click(
|
183
203
|
screen.getByRole('button', { name: 'Recurring execution' })
|
184
204
|
);
|
185
|
-
jest.
|
205
|
+
jest.advanceTimersByTime(1000); // to handle pf4 date picker popover useTimer
|
186
206
|
});
|
187
207
|
|
188
208
|
const newStartAtDate = '2030/03/12';
|
@@ -207,7 +227,7 @@ describe('Schedule', () => {
|
|
207
227
|
fireEvent.change(startsAtTimeField(), {
|
208
228
|
target: { value: newStartAtTime },
|
209
229
|
});
|
210
|
-
jest.
|
230
|
+
jest.advanceTimersByTime(1000);
|
211
231
|
});
|
212
232
|
|
213
233
|
expect(endsAtDateField().disabled).toBeTruthy();
|
@@ -222,7 +242,7 @@ describe('Schedule', () => {
|
|
222
242
|
fireEvent.change(endsAtTimeField(), {
|
223
243
|
target: { value: newStartAtTime },
|
224
244
|
});
|
225
|
-
jest.
|
245
|
+
jest.advanceTimersByTime(1000);
|
226
246
|
});
|
227
247
|
|
228
248
|
act(() => {
|
@@ -232,7 +252,7 @@ describe('Schedule', () => {
|
|
232
252
|
fireEvent.click(
|
233
253
|
screen.getByRole('button', { name: 'Recurring execution' })
|
234
254
|
);
|
235
|
-
jest.
|
255
|
+
jest.advanceTimersByTime(1000); // to handle pf4 date picker popover useTimer
|
236
256
|
});
|
237
257
|
expect(startsAtDateField().value).toBe(newStartAtDate);
|
238
258
|
expect(startsAtTimeField().value).toBe(newStartAtTime);
|
@@ -266,7 +286,7 @@ describe('Schedule', () => {
|
|
266
286
|
fireEvent.click(
|
267
287
|
screen.getByRole('button', { name: 'Recurring execution' })
|
268
288
|
);
|
269
|
-
jest.
|
289
|
+
jest.advanceTimersByTime(1000); // to handle pf4 date picker popover useTimer
|
270
290
|
});
|
271
291
|
await act(async () => {
|
272
292
|
fireEvent.click(screen.getByLabelText('Daily', { selector: 'button' }));
|
@@ -294,7 +314,7 @@ describe('Schedule', () => {
|
|
294
314
|
fireEvent.click(
|
295
315
|
screen.getByRole('button', { name: 'Recurring execution' })
|
296
316
|
);
|
297
|
-
jest.
|
317
|
+
jest.advanceTimersByTime(1000);
|
298
318
|
});
|
299
319
|
expect(screen.queryAllByText('Recurring execution')).toHaveLength(3);
|
300
320
|
expect(cronline.value).toBe(newCronline);
|
data/webpack/JobWizard/submit.js
CHANGED
@@ -12,6 +12,8 @@ export const submit = ({
|
|
12
12
|
location,
|
13
13
|
organization,
|
14
14
|
feature,
|
15
|
+
provider,
|
16
|
+
advancedInputs,
|
15
17
|
dispatch,
|
16
18
|
}) => {
|
17
19
|
const {
|
@@ -37,6 +39,13 @@ export const submit = ({
|
|
37
39
|
keyPassphrase,
|
38
40
|
timeToPickup,
|
39
41
|
} = advancedValues;
|
42
|
+
const providerInputs = advancedInputs.filter(v => v.provider_input);
|
43
|
+
const providerValues = {};
|
44
|
+
providerInputs.forEach(({ name }) => {
|
45
|
+
providerValues[name] = advancedTemplateValues[name];
|
46
|
+
delete advancedTemplateValues[name];
|
47
|
+
});
|
48
|
+
|
40
49
|
const getCronLine = () => {
|
41
50
|
const [hour, minute] = repeatData.at
|
42
51
|
? repeatData.at.split(':')
|
@@ -104,14 +113,16 @@ export const submit = ({
|
|
104
113
|
concurrency_level: concurrencyLevel,
|
105
114
|
},
|
106
115
|
bookmark_id: null,
|
107
|
-
search_query:
|
108
|
-
buildHostQuery(selectedTargets, hostsSearchQuery) || 'name ~ *',
|
116
|
+
search_query: buildHostQuery(selectedTargets, hostsSearchQuery),
|
109
117
|
description_format: description,
|
110
118
|
execution_timeout_interval: timeoutToKill,
|
111
119
|
feature,
|
112
120
|
time_to_pickup: timeToPickup,
|
113
121
|
},
|
114
122
|
};
|
123
|
+
if (Object.keys(providerValues).length) {
|
124
|
+
api.job_invocation[provider] = providerValues;
|
125
|
+
}
|
115
126
|
|
116
127
|
dispatch(
|
117
128
|
post({
|
@@ -122,7 +133,7 @@ export const submit = ({
|
|
122
133
|
window.location.href = `/job_invocations/${id}`;
|
123
134
|
},
|
124
135
|
errorToast: ({ response }) =>
|
125
|
-
response?.
|
136
|
+
response?.data?.error?.message ||
|
126
137
|
response?.message ||
|
127
138
|
response?.statusText,
|
128
139
|
})
|
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: 9.0
|
4
|
+
version: 9.1.0
|
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: 2023-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: deface
|
@@ -327,6 +327,7 @@ files:
|
|
327
327
|
- db/migrate/20210816100932_rex_setting_category_to_dsl.rb
|
328
328
|
- db/migrate/20220321101835_rename_ssh_provider_to_script.rb
|
329
329
|
- db/migrate/20220331112719_add_ssh_user_to_job_invocation.rb
|
330
|
+
- db/migrate/20220426145007_add_unique_feature_label_index.rb
|
330
331
|
- db/migrate/20220713095705_create_template_invocation_events.rb
|
331
332
|
- db/migrate/20220822155946_add_time_to_pickup_to_job_invocation.rb
|
332
333
|
- db/migrate/20221129170145_redefine_template_invocation_events_index.rb
|
@@ -418,6 +419,7 @@ files:
|
|
418
419
|
- webpack/JobWizard/JobWizardHelpers.js
|
419
420
|
- webpack/JobWizard/JobWizardPageRerun.js
|
420
421
|
- webpack/JobWizard/JobWizardSelectors.js
|
422
|
+
- webpack/JobWizard/StartsBeforeErrorAlert.js
|
421
423
|
- webpack/JobWizard/__tests__/JobWizardPageRerun.test.js
|
422
424
|
- webpack/JobWizard/__tests__/__snapshots__/integration.test.js.snap
|
423
425
|
- webpack/JobWizard/__tests__/fixtures.js
|