foreman_remote_execution 7.0.0 → 7.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/.github/workflows/ruby_ci.yml +2 -0
- data/app/models/concerns/foreman_remote_execution/foreman_tasks_task_extensions.rb +6 -0
- data/app/models/job_template.rb +2 -0
- data/app/models/template_invocation.rb +2 -0
- data/lib/foreman_remote_execution/version.rb +1 -1
- data/webpack/JobWizard/steps/AdvancedFields/AdvancedFields.js +9 -0
- data/webpack/JobWizard/steps/AdvancedFields/Fields.js +21 -0
- data/webpack/JobWizard/steps/AdvancedFields/__tests__/AdvancedFields.test.js +5 -0
- data/webpack/JobWizard/steps/ReviewDetails/index.js +1 -0
- data/webpack/JobWizard/submit.js +2 -0
- data/webpack/react_app/components/FeaturesDropdown/index.js +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7c8e05850731a1f10e902deaa2e6797b869bb3363607af339e6a683225fa78a
|
4
|
+
data.tar.gz: b5a2001957310aeb3a7353efa65592bae1dbb3fcabb68677516220674cea94b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03daea7eb15788a97f841d80fddeb3c40c89e79bba550ca7ef9a2eab5ad6646ec13de8d134490a5fb5171d8aeb937e792a88f62588a468613a71948cb0212ba3
|
7
|
+
data.tar.gz: e1ed8ff83ae15794ca4bcca7bdeb7cd7fef930f6c41394538e14fafa5fcb5f738535a3e1096bd6ee1856f3b95a4299ebdb6cf50aafa94ea233724599cea67395
|
@@ -4,6 +4,12 @@ module ForemanRemoteExecution
|
|
4
4
|
|
5
5
|
included do
|
6
6
|
has_many :job_invocations, :dependent => :destroy, :foreign_key => 'task_id'
|
7
|
+
has_one :template_invocation, :inverse_of => :run_host_job_task, :foreign_key => 'run_host_job_task_id', :dependent => :nullify
|
8
|
+
has_one :template, :through => :template_invocation
|
9
|
+
has_many :remote_execution_features, :through => :template
|
10
|
+
|
11
|
+
scoped_search :relation => :remote_execution_features, :on => :name, :rename => 'remote_execution_feature.name'
|
12
|
+
scoped_search :relation => :remote_execution_features, :on => :label, :rename => 'remote_execution_feature.label'
|
7
13
|
end
|
8
14
|
end
|
9
15
|
end
|
data/app/models/job_template.rb
CHANGED
@@ -32,6 +32,8 @@ class JobTemplate < ::Template
|
|
32
32
|
scoped_search :on => :snippet, :complete_value => {:true => true, :false => false}
|
33
33
|
scoped_search :on => :provider_type, :complete_value => true
|
34
34
|
scoped_search :on => :template
|
35
|
+
scoped_search :relation => :remote_execution_features, :on => :name, :rename => 'feature.name'
|
36
|
+
scoped_search :relation => :remote_execution_features, :on => :label, :rename => 'feature.label'
|
35
37
|
|
36
38
|
# with proc support, default_scope can no longer be chained
|
37
39
|
# include all default scoping here
|
@@ -16,6 +16,7 @@ class TemplateInvocation < ApplicationRecord
|
|
16
16
|
belongs_to :host, :class_name => 'Host::Managed', :foreign_key => :host_id
|
17
17
|
has_one :host_group, :through => :host, :source => :hostgroup
|
18
18
|
belongs_to :run_host_job_task, :class_name => 'ForemanTasks::Task'
|
19
|
+
has_many :remote_execution_features, :through => :template
|
19
20
|
|
20
21
|
validates_associated :input_values
|
21
22
|
validate :provides_required_input_values
|
@@ -25,6 +26,7 @@ class TemplateInvocation < ApplicationRecord
|
|
25
26
|
scoped_search :relation => :host_group, :on => :name, :rename => 'host_group.name', :complete_value => true
|
26
27
|
scoped_search :relation => :template, :on => :job_category, :complete_value => true
|
27
28
|
scoped_search :relation => :template, :on => :name, :complete_value => true
|
29
|
+
scoped_search :relation => :remote_execution_features, :on => :name, :rename => 'feature'
|
28
30
|
|
29
31
|
class TaskResultMap
|
30
32
|
MAP = {
|
@@ -16,6 +16,7 @@ import {
|
|
16
16
|
TimeSpanLevelField,
|
17
17
|
TemplateInputsFields,
|
18
18
|
ExecutionOrderingField,
|
19
|
+
SSHUserField,
|
19
20
|
} from './Fields';
|
20
21
|
import { DescriptionField } from './DescriptionField';
|
21
22
|
import { WIZARD_TITLES } from '../../JobWizardConstants';
|
@@ -40,6 +41,14 @@ export const AdvancedFields = ({
|
|
40
41
|
value={advancedValues.templateValues}
|
41
42
|
setValue={newValue => setAdvancedValues({ templateValues: newValue })}
|
42
43
|
/>
|
44
|
+
<SSHUserField
|
45
|
+
value={advancedValues.sshUser}
|
46
|
+
setValue={newValue =>
|
47
|
+
setAdvancedValues({
|
48
|
+
sshUser: newValue,
|
49
|
+
})
|
50
|
+
}
|
51
|
+
/>
|
43
52
|
{effectiveUser?.overridable && (
|
44
53
|
<EffectiveUserField
|
45
54
|
value={advancedValues.effectiveUserValue}
|
@@ -203,6 +203,24 @@ export const ExecutionOrderingField = ({ isRandomizedOrdering, setValue }) => (
|
|
203
203
|
export const TemplateInputsFields = ({ inputs, value, setValue }) => (
|
204
204
|
<>{inputs?.map(input => formatter(input, value, setValue))}</>
|
205
205
|
);
|
206
|
+
|
207
|
+
export const SSHUserField = ({ value, setValue }) => (
|
208
|
+
<FormGroup
|
209
|
+
label={__('SSH user')}
|
210
|
+
labelIcon={helpLabel(__('A user to be used for SSH.'), 'ssh-user')}
|
211
|
+
fieldId="ssh-user"
|
212
|
+
>
|
213
|
+
<TextInput
|
214
|
+
aria-label="ssh user"
|
215
|
+
autoComplete="ssh-user"
|
216
|
+
id="ssh-user"
|
217
|
+
type="text"
|
218
|
+
value={value}
|
219
|
+
onChange={newValue => setValue(newValue)}
|
220
|
+
/>
|
221
|
+
</FormGroup>
|
222
|
+
);
|
223
|
+
|
206
224
|
EffectiveUserField.propTypes = {
|
207
225
|
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
208
226
|
setValue: PropTypes.func.isRequired,
|
@@ -240,3 +258,6 @@ TemplateInputsFields.propTypes = {
|
|
240
258
|
TemplateInputsFields.defaultProps = {
|
241
259
|
value: {},
|
242
260
|
};
|
261
|
+
|
262
|
+
SSHUserField.propTypes = EffectiveUserField.propTypes;
|
263
|
+
SSHUserField.defaultProps = EffectiveUserField.defaultProps;
|
@@ -165,6 +165,11 @@ describe('AdvancedFields', () => {
|
|
165
165
|
fireEvent.click(screen.getByText('Advanced fields'));
|
166
166
|
});
|
167
167
|
|
168
|
+
expect(
|
169
|
+
screen.getByLabelText('ssh user', {
|
170
|
+
selector: 'input',
|
171
|
+
}).value
|
172
|
+
).toBe('');
|
168
173
|
expect(
|
169
174
|
screen.getByLabelText('effective user', {
|
170
175
|
selector: 'input',
|
@@ -125,6 +125,7 @@ const ReviewDetails = ({
|
|
125
125
|
].filter(d => d);
|
126
126
|
|
127
127
|
const advancedFields = [
|
128
|
+
{ label: __('SSH user'), value: advancedValues.sshUser },
|
128
129
|
{ label: __('Effective user'), value: advancedValues.effectiveUserValue },
|
129
130
|
{ label: __('Description Template'), value: advancedValues.description },
|
130
131
|
{ label: __('Timeout to kill'), value: advancedValues.timeoutToKill },
|
data/webpack/JobWizard/submit.js
CHANGED
@@ -23,6 +23,7 @@ export const submit = ({
|
|
23
23
|
purpose,
|
24
24
|
} = scheduleValue;
|
25
25
|
const {
|
26
|
+
sshUser,
|
26
27
|
effectiveUserValue,
|
27
28
|
effectiveUserPassword,
|
28
29
|
description,
|
@@ -64,6 +65,7 @@ export const submit = ({
|
|
64
65
|
: 'dynamic_query',
|
65
66
|
randomized_ordering: isRandomizedOrdering,
|
66
67
|
inputs: { ...templateValues, ...advancedTemplateValues },
|
68
|
+
ssh_user: sshUser,
|
67
69
|
ssh: {
|
68
70
|
effective_user: effectiveUserValue,
|
69
71
|
effective_user_password: effectiveUserPassword,
|
@@ -52,7 +52,7 @@ const FeaturesDropdown = ({ hostId }) => {
|
|
52
52
|
toggle={
|
53
53
|
<DropdownToggle
|
54
54
|
splitButtonItems={scheduleJob}
|
55
|
-
toggleVariant="
|
55
|
+
toggleVariant="secondary"
|
56
56
|
onToggle={() => setIsOpen(prev => !prev)}
|
57
57
|
isDisabled={status === STATUS.PENDING}
|
58
58
|
splitButtonVariant="action"
|
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: 7.
|
4
|
+
version: 7.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: 2022-
|
11
|
+
date: 2022-06-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: deface
|