foreman-tasks 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/.github/workflows/ruby_tests.yml +15 -63
- data/.rubocop.yml +1 -1
- data/app/lib/actions/bulk_action.rb +8 -1
- data/app/models/foreman_tasks/concerns/action_triggering.rb +8 -8
- data/app/services/foreman_tasks/proxy_selector.rb +3 -3
- data/lib/foreman_tasks/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 959e8a5bbb07d3d1b6b0d1f0b57f502b4397d5797ccc3037b1e9f77a8229b06a
|
4
|
+
data.tar.gz: f0bef4b1aca4d471a2616e6b41751f1da2165eb23d9da65be87bf055bc4fab05
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2740338c22e5f0371358d037212a2964d4a46119dd2d2275dc290b91742be20bdd2b74ef8b9b036f60e975b4e798424b20776eabfeaa9f49049f24a2389d48c7
|
7
|
+
data.tar.gz: 43ae242cf9b8d2e7e873ab9fa99b5be157d1f9467e931d163ccf0e831d1e1969cd81ceb0391d1397f1d6606ee159b62e88e97202ddeac112579a34cc74f3d698
|
@@ -1,68 +1,20 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
DATABASE_CLEANER_ALLOW_REMOTE_DATABASE_URL: true
|
7
|
-
BUNDLE_WITHOUT: "journald:development:console:mysql2:sqlite:libvirt"
|
1
|
+
---
|
2
|
+
name: CI
|
3
|
+
|
4
|
+
on: pull_request
|
5
|
+
|
8
6
|
concurrency:
|
9
|
-
group: ${{ github.
|
7
|
+
group: ${{ github.ref_name }}-${{ github.workflow }}
|
10
8
|
cancel-in-progress: true
|
9
|
+
|
11
10
|
jobs:
|
12
11
|
rubocop:
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
with:
|
19
|
-
ruby-version: 2.7
|
20
|
-
bundler-cache: true
|
21
|
-
- name: Run rubocop
|
22
|
-
run: bundle exec rubocop
|
23
|
-
test_ruby:
|
24
|
-
runs-on: ubuntu-latest
|
12
|
+
name: Rubocop
|
13
|
+
uses: theforeman/actions/.github/workflows/rubocop.yml@v0
|
14
|
+
|
15
|
+
test:
|
16
|
+
name: Ruby
|
25
17
|
needs: rubocop
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
image: postgres:12.1
|
30
|
-
ports: ['5432:5432']
|
31
|
-
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
32
|
-
strategy:
|
33
|
-
fail-fast: false
|
34
|
-
matrix:
|
35
|
-
foreman-core-branch: [develop]
|
36
|
-
ruby-version: [2.7]
|
37
|
-
node-version: [12]
|
38
|
-
steps:
|
39
|
-
- run: sudo apt-get update
|
40
|
-
- run: sudo apt-get install build-essential libcurl4-openssl-dev zlib1g-dev libpq-dev
|
41
|
-
- uses: actions/checkout@v2
|
42
|
-
with:
|
43
|
-
repository: theforeman/foreman
|
44
|
-
ref: ${{ matrix.foreman-core-branch }}
|
45
|
-
- uses: actions/checkout@v2
|
46
|
-
with:
|
47
|
-
path: foreman-tasks
|
48
|
-
- name: Setup Plugin in Foreman
|
49
|
-
run: |
|
50
|
-
echo "gem 'foreman-tasks', path: './foreman-tasks'" > bundler.d/foreman-tasks.local.rb
|
51
|
-
echo "gem 'sqlite3'" >> bundler.d/foreman-tasks.local.rb
|
52
|
-
- name: Setup Ruby
|
53
|
-
uses: ruby/setup-ruby@v1
|
54
|
-
with:
|
55
|
-
ruby-version: ${{ matrix.ruby-version }}
|
56
|
-
bundler-cache: true
|
57
|
-
- name: Setup Node
|
58
|
-
uses: actions/setup-node@v1
|
59
|
-
with:
|
60
|
-
node-version: ${{ matrix.node-version }}
|
61
|
-
- name: Prepare test env
|
62
|
-
run: |
|
63
|
-
bundle exec rake db:create
|
64
|
-
bundle exec rake db:migrate
|
65
|
-
- name: Run plugin tests
|
66
|
-
run: |
|
67
|
-
bundle exec rake test:foreman_tasks
|
68
|
-
bundle exec rake test TEST="test/unit/foreman/access_permissions_test.rb"
|
18
|
+
uses: theforeman/actions/.github/workflows/foreman_plugin.yml@v0
|
19
|
+
with:
|
20
|
+
plugin: foreman-tasks
|
data/.rubocop.yml
CHANGED
@@ -9,7 +9,8 @@ module Actions
|
|
9
9
|
# Arguments that all the targets share
|
10
10
|
def plan(action_class, targets, *args, concurrency_limit: nil, **kwargs)
|
11
11
|
check_targets!(targets)
|
12
|
-
|
12
|
+
extracted_concurrency_limit = extract_concurrency_limit(args, concurrency_limit)
|
13
|
+
limit_concurrency_level!(extracted_concurrency_limit) if extracted_concurrency_limit
|
13
14
|
plan_self(:action_class => action_class.to_s,
|
14
15
|
:target_ids => targets.map(&:id),
|
15
16
|
:target_class => targets.first.class.to_s,
|
@@ -72,5 +73,11 @@ module Actions
|
|
72
73
|
def total_count
|
73
74
|
input[:target_ids].count
|
74
75
|
end
|
76
|
+
|
77
|
+
private
|
78
|
+
|
79
|
+
def extract_concurrency_limit(args = [], limit = nil)
|
80
|
+
args.find { |arg| arg.is_a?(Hash) && arg.key?(:concurrency_limit) }&.fetch(:concurrency_limit) || limit
|
81
|
+
end
|
75
82
|
end
|
76
83
|
end
|
@@ -23,12 +23,12 @@ module ForemanTasks
|
|
23
23
|
# @override
|
24
24
|
def destroy_action; end
|
25
25
|
|
26
|
-
def save(
|
27
|
-
dynflow_task_wrap(:save) { super(
|
26
|
+
def save(...)
|
27
|
+
dynflow_task_wrap(:save) { super(...) }
|
28
28
|
end
|
29
29
|
|
30
|
-
def save!(
|
31
|
-
dynflow_task_wrap(:save) { super(
|
30
|
+
def save!(...)
|
31
|
+
dynflow_task_wrap(:save) { super(...) }
|
32
32
|
end
|
33
33
|
|
34
34
|
def destroy
|
@@ -37,14 +37,14 @@ module ForemanTasks
|
|
37
37
|
|
38
38
|
# In order to use host.<attribute>_changed?, we must assign_attributes to
|
39
39
|
# the host record for these update and update! methods.
|
40
|
-
def update(
|
41
|
-
assign_attributes(
|
40
|
+
def update(...)
|
41
|
+
assign_attributes(...)
|
42
42
|
dynflow_task_wrap(:save) { save }
|
43
43
|
end
|
44
44
|
alias update_attributes update
|
45
45
|
|
46
|
-
def update!(
|
47
|
-
assign_attributes(
|
46
|
+
def update!(...)
|
47
|
+
assign_attributes(...)
|
48
48
|
dynflow_task_wrap(:save) { save! }
|
49
49
|
end
|
50
50
|
alias update_attributes! update!
|
@@ -11,12 +11,12 @@ module ForemanTasks
|
|
11
11
|
[:subnet, :fallback, :global]
|
12
12
|
end
|
13
13
|
|
14
|
-
def available_proxies(*_args)
|
14
|
+
def available_proxies(*_args, **_kwargs)
|
15
15
|
raise NotImplementedError
|
16
16
|
end
|
17
17
|
|
18
|
-
def determine_proxy(*args)
|
19
|
-
available_proxies = self.available_proxies(*args)
|
18
|
+
def determine_proxy(*args, **kwargs)
|
19
|
+
available_proxies = self.available_proxies(*args, **kwargs)
|
20
20
|
return :not_defined if available_proxies.empty? || available_proxies.values.all?(&:empty?)
|
21
21
|
proxy = nil
|
22
22
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman-tasks
|
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
|
- Ivan Nečas
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-02-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dynflow
|
@@ -613,7 +613,7 @@ homepage: https://github.com/theforeman/foreman-tasks
|
|
613
613
|
licenses:
|
614
614
|
- GPL-3.0
|
615
615
|
metadata: {}
|
616
|
-
post_install_message:
|
616
|
+
post_install_message:
|
617
617
|
rdoc_options: []
|
618
618
|
require_paths:
|
619
619
|
- lib
|
@@ -628,8 +628,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
628
628
|
- !ruby/object:Gem::Version
|
629
629
|
version: '0'
|
630
630
|
requirements: []
|
631
|
-
rubygems_version: 3.
|
632
|
-
signing_key:
|
631
|
+
rubygems_version: 3.3.26
|
632
|
+
signing_key:
|
633
633
|
specification_version: 4
|
634
634
|
summary: Foreman plugin for showing tasks information for resources and users
|
635
635
|
test_files:
|