foreman_remote_execution 10.0.3 → 10.0.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c6cbb748f9c9d67aba38a2fa62ad4e82306d665bd9ad0021c2125926207fd95f
4
- data.tar.gz: 435f4a1aee85997d3ef430abf68a24da459bd55a09832a130e51c405638dbfd0
3
+ metadata.gz: afb55ca9ac902c2d13fa825bb4bf6b2a31cd3729f9f073b98f1add34001fdfa2
4
+ data.tar.gz: a3155cf9f3c74f9d7588984015dc47ba6b7a81d4bea04bcb3b870c4ad6306405
5
5
  SHA512:
6
- metadata.gz: 2b3b8b5d63dfc60911069228a9f0ff136ccfe536331bb53bf348b902ee4e0cbb1fb2e26ca3d209a409a5d78a03530d5e490460a6d024baf7a584ae755bbe88d3
7
- data.tar.gz: e54b93592be98be9c6577f662d6a6e3298c36c9e7576b9325f4b1f981f94ff560865e37aaec4a87a8fe06ed933e433e66420326b9c7b5f6e72e13503b8ff4671
6
+ metadata.gz: d9e34ed092397296e54f100d3a5697ef18ee86e79f5a293e01c0fcf19b33c195d7cfdd1a8046079ab70fce503e2760b93ca616346ab3cd7a21c4df9ef2c10983
7
+ data.tar.gz: 54cb3b829257039f3f3568544ec3f944e247a966ffd8e06f6f9a4ef1d71c7a3aaf4d0b2b3f5cea78cec32fa0eaa7e67d818e264db5bcf8b63eb0ab0d7b4f1bff
data/.eslintrc CHANGED
@@ -1,5 +1,8 @@
1
1
  {
2
- "plugins": ["@theforeman/foreman"],
2
+ "plugins": [
3
+ "@theforeman/foreman",
4
+ "@theforeman/rules"
5
+ ],
3
6
  "extends": [
4
7
  "plugin:@theforeman/foreman/core",
5
8
  "plugin:@theforeman/foreman/plugins"
@@ -24,6 +24,9 @@ jobs:
24
24
  - name: Run plugin linter
25
25
  run: |
26
26
  npm run lint
27
+ - name: Run custom plugin linter
28
+ run: |
29
+ npm run lint:custom
27
30
  - name: Run plugin tests
28
31
  run: |
29
32
  npm run test
@@ -1,7 +1,7 @@
1
1
  class UiJobWizardController < ApplicationController
2
2
  include FiltersHelper
3
3
  def categories
4
- job_categories = resource_scope
4
+ job_categories = resource_scope(permission: action_permission)
5
5
  .search_for("job_category ~ \"#{params[:search]}\"")
6
6
  .where(:snippet => false)
7
7
  .select(:job_category).distinct
@@ -24,6 +24,10 @@
24
24
  <% end %>
25
25
  <% if job_invocation.execution_timeout_interval.present? %>
26
26
  <li><b><%= _("Timeout to kill after") %></b>: <%= job_invocation.execution_timeout_interval %> <%= _('seconds') %><br></li>
27
+ <% end %>
28
+ <% if job_invocation.time_to_pickup.present? %>
29
+ <li><b><%= _("Time to pickup") %></b>: <%= job_invocation.time_to_pickup %> <%= _('seconds') %><br>
30
+ </li>
27
31
  <% end %>
28
32
  </ul>
29
33
  </p>
@@ -1,7 +1,7 @@
1
1
  <div class="tab-pane" id="template_job">
2
2
 
3
3
  <%= autocomplete_f(f, :job_category,
4
- :search_query => '',
4
+ :search_query => @template.job_category,
5
5
  :placeholder => _("Job category") + ' ...',
6
6
  :disabled => @template.locked?) %>
7
7
  <%= text_f f, :description_format,
@@ -158,7 +158,7 @@ module ForemanRemoteExecution
158
158
  collection: proc { ForemanRemoteExecution.job_invocation_report_templates_select }
159
159
  setting 'remote_execution_time_to_pickup',
160
160
  type: :integer,
161
- description: N_('Time in seconds within which the host has to pick up a job. If the job is not picked up within this limit, the job will be cancelled. Defaults to 1 day.'),
161
+ description: N_('Time in seconds within which the host has to pick up a job. If the job is not picked up within this limit, the job will be cancelled. Defaults to 1 day. Applies only to pull-mqtt based jobs.'),
162
162
  default: 24 * 60 * 60,
163
163
  full_name: N_('Time to pickup')
164
164
  end
@@ -1,3 +1,3 @@
1
1
  module ForemanRemoteExecution
2
- VERSION = '10.0.3'.freeze
2
+ VERSION = '10.0.4'.freeze
3
3
  end
data/package.json CHANGED
@@ -4,6 +4,7 @@
4
4
  "license": "GPL-3.0",
5
5
  "scripts": {
6
6
  "lint": "tfm-lint --plugin -d /webpack",
7
+ "lint:custom": "eslint ./webpack",
7
8
  "test": "tfm-test --plugin",
8
9
  "test:watch": "tfm-test --plugin --watchAll",
9
10
  "test:current": "tfm-test --plugin --watch",
@@ -23,6 +24,7 @@
23
24
  "@babel/core": "^7.7.0",
24
25
  "@theforeman/builder": "^12.0.1",
25
26
  "@theforeman/eslint-plugin-foreman": "^12.0.1",
27
+ "@theforeman/eslint-plugin-rules": "^12.0.2",
26
28
  "@theforeman/test": "^12.0.1",
27
29
  "@theforeman/vendor-dev": "^12.0.1",
28
30
  "babel-eslint": "^10.0.0",
@@ -59,7 +59,7 @@ export const TimeToPickupField = ({ value, setValue }) => (
59
59
  label: __('Time to pickup'),
60
60
  labelIcon: helpLabel(
61
61
  __(
62
- 'Interval in seconds, if the job is not picked up by a client within this interval it will be cancelled.'
62
+ 'Interval in seconds, if the job is not picked up by a client within this interval it will be cancelled. Applies only to pull-mqtt based jobs'
63
63
  ),
64
64
  'time-to-pickup'
65
65
  ),
@@ -23,9 +23,8 @@ export const parseRepeat = (repeatType, repeatData) => {
23
23
  const daysKeys = Object.keys(repeatData.daysOfWeek).filter(
24
24
  k => repeatData.daysOfWeek[k]
25
25
  );
26
- const days = getWeekDays()
27
- .filter((d, index) => index in daysKeys)
28
- .join(', ');
26
+ const dayNames = getWeekDays();
27
+ const days = daysKeys.map(day => dayNames[day]).join(', ');
29
28
  return sprintf(__('Every week on %s at %s'), days, repeatData.at);
30
29
  }
31
30
  case repeatTypes.monthly:
@@ -30,6 +30,9 @@ import { WizardTitle } from '../form/WizardTitle';
30
30
  import { parseEnd, parseRepeat } from './helpers';
31
31
  import { HostPreviewModal } from '../HostsAndInputs/HostPreviewModal';
32
32
 
33
+ const maskValue = (isHidden, value) =>
34
+ isHidden ? '*'.repeat(value.length) : value;
35
+
33
36
  const ReviewDetails = ({
34
37
  jobCategory,
35
38
  jobTemplateID,
@@ -122,11 +125,11 @@ const ReviewDetails = ({
122
125
  ),
123
126
  value: stringHosts(),
124
127
  },
125
- ...templateInputs.map(({ name }) => ({
128
+ ...templateInputs.map(({ name, hidden_value: isHidden }) => ({
126
129
  label: (
127
130
  <StepButton stepName={WIZARD_TITLES.hostsAndInputs}>{name}</StepButton>
128
131
  ),
129
- value: templateValues[name],
132
+ value: maskValue(isHidden, templateValues[name]),
130
133
  })),
131
134
  {
132
135
  label: (
@@ -272,9 +275,9 @@ const ReviewDetails = ({
272
275
  ? __('Randomized')
273
276
  : __('Alphabetical'),
274
277
  },
275
- ...advancedTemplateInputs.map(({ name }) => ({
278
+ ...advancedTemplateInputs.map(({ name, hidden_value: isHidden }) => ({
276
279
  label: name,
277
- value: advancedValues.templateValues[name],
280
+ value: maskValue(isHidden, advancedValues.templateValues[name]),
278
281
  })),
279
282
  ];
280
283
 
@@ -1,6 +1,14 @@
1
1
  import React, { useEffect } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { TextInput, FormGroup, ValidatedOptions } from '@patternfly/react-core';
3
+ import {
4
+ List,
5
+ ListItem,
6
+ ListComponent,
7
+ OrderType,
8
+ TextInput,
9
+ FormGroup,
10
+ ValidatedOptions,
11
+ } from '@patternfly/react-core';
4
12
  import { translate as __ } from 'foremanReact/common/I18n';
5
13
  import { helpLabel } from '../form/FormHelpers';
6
14
 
@@ -19,15 +27,15 @@ export const RepeatCron = ({ repeatData, setRepeatData, setValid }) => {
19
27
  label={__('Cron line')}
20
28
  labelIcon={helpLabel(
21
29
  <div>
22
- {__("Cron line format 'a b c d e', where:")}
30
+ {__("Cron line format '1 2 3 4 5', where:")}
23
31
  <br />
24
- <ol>
25
- <li>{__('is minute (range: 0-59)')}</li>
26
- <li>{__('is hour (range: 0-23)')}</li>
27
- <li>{__('is day of month (range: 1-31)')}</li>
28
- <li>{__('is month (range: 1-12)')}</li>
29
- <li>{__('is day of week (range: 0-6)')}</li>
30
- </ol>
32
+ <List component={ListComponent.ol} type={OrderType.number}>
33
+ <ListItem>{__('is minute (range: 0-59)')}</ListItem>
34
+ <ListItem>{__('is hour (range: 0-23)')}</ListItem>
35
+ <ListItem>{__('is day of month (range: 1-31)')}</ListItem>
36
+ <ListItem>{__('is month (range: 1-12)')}</ListItem>
37
+ <ListItem>{__('is day of week (range: 0-6)')}</ListItem>
38
+ </List>
31
39
  </div>
32
40
  )}
33
41
  isRequired
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: 10.0.3
4
+ version: 10.0.4
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: 2023-06-20 00:00:00.000000000 Z
11
+ date: 2023-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: deface
@@ -576,7 +576,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
576
576
  - !ruby/object:Gem::Version
577
577
  version: '0'
578
578
  requirements: []
579
- rubygems_version: 3.4.13
579
+ rubygems_version: 3.4.16
580
580
  signing_key:
581
581
  specification_version: 4
582
582
  summary: A plugin bringing remote execution to the Foreman, completing the config