gitlab-triage 1.42.2 → 1.43.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.git-blame-ignore-revs +43 -0
- data/.gitignore +0 -1
- data/.gitlab-ci.yml +56 -54
- data/.rubocop.yml +27 -0
- data/.rubocop_todo.yml +47 -434
- data/.ruby-version +1 -1
- data/.tool-versions +1 -1
- data/Gemfile +2 -0
- data/Gemfile.lock +239 -0
- data/Guardfile +2 -0
- data/Rakefile +2 -0
- data/bin/gitlab-triage +1 -0
- data/gitlab-triage.gemspec +8 -8
- data/lib/gitlab/triage/action/base.rb +5 -3
- data/lib/gitlab/triage/action.rb +2 -0
- data/lib/gitlab/triage/api_query_builders/base_query_param_builder.rb +2 -0
- data/lib/gitlab/triage/api_query_builders/date_query_param_builder.rb +3 -1
- data/lib/gitlab/triage/api_query_builders/multi_query_param_builder.rb +2 -0
- data/lib/gitlab/triage/api_query_builders/single_query_param_builder.rb +2 -0
- data/lib/gitlab/triage/command_builders/base_command_builder.rb +2 -0
- data/lib/gitlab/triage/command_builders/cc_command_builder.rb +2 -0
- data/lib/gitlab/triage/command_builders/comment_command_builder.rb +2 -0
- data/lib/gitlab/triage/command_builders/label_command_builder.rb +3 -1
- data/lib/gitlab/triage/command_builders/move_command_builder.rb +2 -0
- data/lib/gitlab/triage/command_builders/remove_label_command_builder.rb +2 -0
- data/lib/gitlab/triage/command_builders/status_command_builder.rb +2 -0
- data/lib/gitlab/triage/command_builders/text_content_builder.rb +2 -2
- data/lib/gitlab/triage/engine.rb +8 -3
- data/lib/gitlab/triage/errors/network.rb +2 -0
- data/lib/gitlab/triage/errors.rb +2 -0
- data/lib/gitlab/triage/expand_condition/expansion.rb +2 -0
- data/lib/gitlab/triage/expand_condition/list.rb +3 -1
- data/lib/gitlab/triage/expand_condition/sequence.rb +3 -1
- data/lib/gitlab/triage/expand_condition.rb +2 -0
- data/lib/gitlab/triage/filters/assignee_member_conditions_filter.rb +2 -0
- data/lib/gitlab/triage/filters/author_member_conditions_filter.rb +2 -0
- data/lib/gitlab/triage/filters/base_conditions_filter.rb +3 -3
- data/lib/gitlab/triage/filters/branch_date_filter.rb +2 -0
- data/lib/gitlab/triage/filters/branch_protected_filter.rb +2 -0
- data/lib/gitlab/triage/filters/discussions_conditions_filter.rb +2 -0
- data/lib/gitlab/triage/filters/issue_date_conditions_filter.rb +2 -0
- data/lib/gitlab/triage/filters/member_conditions_filter.rb +4 -4
- data/lib/gitlab/triage/filters/merge_request_date_conditions_filter.rb +2 -0
- data/lib/gitlab/triage/filters/name_conditions_filter.rb +2 -0
- data/lib/gitlab/triage/filters/no_additional_labels_conditions_filter.rb +2 -0
- data/lib/gitlab/triage/filters/ruby_conditions_filter.rb +2 -0
- data/lib/gitlab/triage/filters/votes_conditions_filter.rb +2 -0
- data/lib/gitlab/triage/graphql_network.rb +2 -0
- data/lib/gitlab/triage/graphql_queries/query_builder.rb +5 -3
- data/lib/gitlab/triage/graphql_queries/query_param_builders/array_param_builder.rb +2 -0
- data/lib/gitlab/triage/graphql_queries/query_param_builders/base_param_builder.rb +2 -0
- data/lib/gitlab/triage/graphql_queries/query_param_builders/date_param_builder.rb +3 -1
- data/lib/gitlab/triage/limiters/base_limiter.rb +2 -0
- data/lib/gitlab/triage/limiters/date_field_limiter.rb +2 -0
- data/lib/gitlab/triage/network.rb +2 -0
- data/lib/gitlab/triage/network_adapters/base_adapter.rb +2 -0
- data/lib/gitlab/triage/network_adapters/graphql_adapter.rb +2 -0
- data/lib/gitlab/triage/network_adapters/httparty_adapter.rb +2 -0
- data/lib/gitlab/triage/network_adapters/test_adapter.rb +3 -1
- data/lib/gitlab/triage/option_parser.rb +2 -0
- data/lib/gitlab/triage/options.rb +2 -0
- data/lib/gitlab/triage/param_builders/date_param_builder.rb +2 -0
- data/lib/gitlab/triage/policies/base_policy.rb +1 -1
- data/lib/gitlab/triage/resource/base.rb +3 -0
- data/lib/gitlab/triage/resource/instance_version.rb +2 -0
- data/lib/gitlab/triage/resource/milestone.rb +2 -0
- data/lib/gitlab/triage/rest_api_network.rb +2 -0
- data/lib/gitlab/triage/retryable.rb +2 -0
- data/lib/gitlab/triage/ui.rb +2 -0
- data/lib/gitlab/triage/url_builders/url_builder.rb +2 -0
- data/lib/gitlab/triage/utils.rb +2 -0
- data/lib/gitlab/triage/validators/limiter_validator.rb +3 -3
- data/lib/gitlab/triage/validators/params_validator.rb +3 -3
- data/lib/gitlab/triage/version.rb +1 -1
- data/lib/gitlab/triage.rb +2 -0
- metadata +16 -27
data/Gemfile.lock
ADDED
@@ -0,0 +1,239 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
gitlab-triage (1.43.1)
|
5
|
+
activesupport (>= 5.1)
|
6
|
+
globalid (~> 1.0, >= 1.0.1)
|
7
|
+
graphql (< 2.1.0)
|
8
|
+
graphql-client (~> 0.16)
|
9
|
+
httparty (~> 0.20.0)
|
10
|
+
|
11
|
+
GEM
|
12
|
+
remote: https://rubygems.org/
|
13
|
+
specs:
|
14
|
+
activesupport (7.1.3.4)
|
15
|
+
base64
|
16
|
+
bigdecimal
|
17
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
18
|
+
connection_pool (>= 2.2.5)
|
19
|
+
drb
|
20
|
+
i18n (>= 1.6, < 2)
|
21
|
+
minitest (>= 5.1)
|
22
|
+
mutex_m
|
23
|
+
tzinfo (~> 2.0)
|
24
|
+
addressable (2.8.6)
|
25
|
+
public_suffix (>= 2.0.2, < 6.0)
|
26
|
+
ast (2.4.2)
|
27
|
+
base64 (0.2.0)
|
28
|
+
bigdecimal (3.1.8)
|
29
|
+
claide (1.1.0)
|
30
|
+
claide-plugins (0.9.2)
|
31
|
+
cork
|
32
|
+
nap
|
33
|
+
open4 (~> 1.3)
|
34
|
+
coderay (1.1.3)
|
35
|
+
colored2 (3.1.2)
|
36
|
+
concurrent-ruby (1.3.3)
|
37
|
+
connection_pool (2.4.1)
|
38
|
+
cork (0.3.0)
|
39
|
+
colored2 (~> 3.1)
|
40
|
+
crack (1.0.0)
|
41
|
+
bigdecimal
|
42
|
+
rexml
|
43
|
+
danger (9.4.3)
|
44
|
+
claide (~> 1.0)
|
45
|
+
claide-plugins (>= 0.9.2)
|
46
|
+
colored2 (~> 3.1)
|
47
|
+
cork (~> 0.1)
|
48
|
+
faraday (>= 0.9.0, < 3.0)
|
49
|
+
faraday-http-cache (~> 2.0)
|
50
|
+
git (~> 1.13)
|
51
|
+
kramdown (~> 2.3)
|
52
|
+
kramdown-parser-gfm (~> 1.0)
|
53
|
+
no_proxy_fix
|
54
|
+
octokit (>= 4.0)
|
55
|
+
terminal-table (>= 1, < 4)
|
56
|
+
danger-gitlab (8.0.0)
|
57
|
+
danger
|
58
|
+
gitlab (~> 4.2, >= 4.2.0)
|
59
|
+
diff-lcs (1.5.1)
|
60
|
+
drb (2.2.1)
|
61
|
+
faraday (2.9.1)
|
62
|
+
faraday-net_http (>= 2.0, < 3.2)
|
63
|
+
faraday-http-cache (2.5.1)
|
64
|
+
faraday (>= 0.8)
|
65
|
+
faraday-net_http (3.1.0)
|
66
|
+
net-http
|
67
|
+
ffi (1.17.0)
|
68
|
+
formatador (1.1.0)
|
69
|
+
git (1.19.1)
|
70
|
+
addressable (~> 2.8)
|
71
|
+
rchardet (~> 1.8)
|
72
|
+
gitlab (4.19.0)
|
73
|
+
httparty (~> 0.20)
|
74
|
+
terminal-table (>= 1.5.1)
|
75
|
+
gitlab-dangerfiles (2.11.0)
|
76
|
+
danger (>= 8.4.5)
|
77
|
+
danger-gitlab (>= 8.0.0)
|
78
|
+
gitlab-styles (12.0.1)
|
79
|
+
rubocop (~> 1.62.1)
|
80
|
+
rubocop-factory_bot (~> 2.25.1)
|
81
|
+
rubocop-graphql (~> 1.5.0)
|
82
|
+
rubocop-performance (~> 1.20.2)
|
83
|
+
rubocop-rails (~> 2.24.0)
|
84
|
+
rubocop-rspec (~> 2.27.1)
|
85
|
+
globalid (1.2.1)
|
86
|
+
activesupport (>= 6.1)
|
87
|
+
graphql (2.0.31)
|
88
|
+
base64
|
89
|
+
graphql-client (0.22.0)
|
90
|
+
activesupport (>= 3.0)
|
91
|
+
graphql (>= 1.13.0)
|
92
|
+
guard (2.18.1)
|
93
|
+
formatador (>= 0.2.4)
|
94
|
+
listen (>= 2.7, < 4.0)
|
95
|
+
lumberjack (>= 1.0.12, < 2.0)
|
96
|
+
nenv (~> 0.1)
|
97
|
+
notiffany (~> 0.0)
|
98
|
+
pry (>= 0.13.0)
|
99
|
+
shellany (~> 0.0)
|
100
|
+
thor (>= 0.18.1)
|
101
|
+
guard-compat (1.2.1)
|
102
|
+
guard-rspec (4.7.3)
|
103
|
+
guard (~> 2.1)
|
104
|
+
guard-compat (~> 1.1)
|
105
|
+
rspec (>= 2.99.0, < 4.0)
|
106
|
+
hashdiff (1.1.0)
|
107
|
+
httparty (0.20.0)
|
108
|
+
mime-types (~> 3.0)
|
109
|
+
multi_xml (>= 0.5.2)
|
110
|
+
i18n (1.14.5)
|
111
|
+
concurrent-ruby (~> 1.0)
|
112
|
+
json (2.7.2)
|
113
|
+
kramdown (2.4.0)
|
114
|
+
rexml
|
115
|
+
kramdown-parser-gfm (1.1.0)
|
116
|
+
kramdown (~> 2.0)
|
117
|
+
language_server-protocol (3.17.0.3)
|
118
|
+
lefthook (1.6.16)
|
119
|
+
listen (3.9.0)
|
120
|
+
rb-fsevent (~> 0.10, >= 0.10.3)
|
121
|
+
rb-inotify (~> 0.9, >= 0.9.10)
|
122
|
+
lumberjack (1.2.10)
|
123
|
+
method_source (1.1.0)
|
124
|
+
mime-types (3.5.2)
|
125
|
+
mime-types-data (~> 3.2015)
|
126
|
+
mime-types-data (3.2024.0305)
|
127
|
+
minitest (5.23.1)
|
128
|
+
multi_xml (0.6.0)
|
129
|
+
mutex_m (0.2.0)
|
130
|
+
nap (1.1.0)
|
131
|
+
nenv (0.3.0)
|
132
|
+
net-http (0.4.1)
|
133
|
+
uri
|
134
|
+
no_proxy_fix (0.1.2)
|
135
|
+
notiffany (0.1.3)
|
136
|
+
nenv (~> 0.1)
|
137
|
+
shellany (~> 0.0)
|
138
|
+
octokit (9.1.0)
|
139
|
+
faraday (>= 1, < 3)
|
140
|
+
sawyer (~> 0.9)
|
141
|
+
open4 (1.3.4)
|
142
|
+
parallel (1.25.1)
|
143
|
+
parser (3.3.3.0)
|
144
|
+
ast (~> 2.4.1)
|
145
|
+
racc
|
146
|
+
pry (0.14.2)
|
147
|
+
coderay (~> 1.1)
|
148
|
+
method_source (~> 1.0)
|
149
|
+
public_suffix (5.0.5)
|
150
|
+
racc (1.8.0)
|
151
|
+
rack (3.1.3)
|
152
|
+
rainbow (3.1.1)
|
153
|
+
rake (13.2.1)
|
154
|
+
rb-fsevent (0.11.2)
|
155
|
+
rb-inotify (0.11.1)
|
156
|
+
ffi (~> 1.0)
|
157
|
+
rchardet (1.8.0)
|
158
|
+
regexp_parser (2.9.2)
|
159
|
+
rexml (3.3.0)
|
160
|
+
strscan
|
161
|
+
rspec (3.13.0)
|
162
|
+
rspec-core (~> 3.13.0)
|
163
|
+
rspec-expectations (~> 3.13.0)
|
164
|
+
rspec-mocks (~> 3.13.0)
|
165
|
+
rspec-core (3.13.0)
|
166
|
+
rspec-support (~> 3.13.0)
|
167
|
+
rspec-expectations (3.13.0)
|
168
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
169
|
+
rspec-support (~> 3.13.0)
|
170
|
+
rspec-mocks (3.13.1)
|
171
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
172
|
+
rspec-support (~> 3.13.0)
|
173
|
+
rspec-support (3.13.1)
|
174
|
+
rubocop (1.62.1)
|
175
|
+
json (~> 2.3)
|
176
|
+
language_server-protocol (>= 3.17.0)
|
177
|
+
parallel (~> 1.10)
|
178
|
+
parser (>= 3.3.0.2)
|
179
|
+
rainbow (>= 2.2.2, < 4.0)
|
180
|
+
regexp_parser (>= 1.8, < 3.0)
|
181
|
+
rexml (>= 3.2.5, < 4.0)
|
182
|
+
rubocop-ast (>= 1.31.1, < 2.0)
|
183
|
+
ruby-progressbar (~> 1.7)
|
184
|
+
unicode-display_width (>= 2.4.0, < 3.0)
|
185
|
+
rubocop-ast (1.31.3)
|
186
|
+
parser (>= 3.3.1.0)
|
187
|
+
rubocop-capybara (2.21.0)
|
188
|
+
rubocop (~> 1.41)
|
189
|
+
rubocop-factory_bot (2.25.1)
|
190
|
+
rubocop (~> 1.41)
|
191
|
+
rubocop-graphql (1.5.2)
|
192
|
+
rubocop (>= 0.90, < 2)
|
193
|
+
rubocop-performance (1.20.2)
|
194
|
+
rubocop (>= 1.48.1, < 2.0)
|
195
|
+
rubocop-ast (>= 1.30.0, < 2.0)
|
196
|
+
rubocop-rails (2.24.1)
|
197
|
+
activesupport (>= 4.2.0)
|
198
|
+
rack (>= 1.1)
|
199
|
+
rubocop (>= 1.33.0, < 2.0)
|
200
|
+
rubocop-ast (>= 1.31.1, < 2.0)
|
201
|
+
rubocop-rspec (2.27.1)
|
202
|
+
rubocop (~> 1.40)
|
203
|
+
rubocop-capybara (~> 2.17)
|
204
|
+
rubocop-factory_bot (~> 2.22)
|
205
|
+
ruby-progressbar (1.13.0)
|
206
|
+
sawyer (0.9.2)
|
207
|
+
addressable (>= 2.3.5)
|
208
|
+
faraday (>= 0.17.3, < 3)
|
209
|
+
shellany (0.0.1)
|
210
|
+
strscan (3.1.0)
|
211
|
+
terminal-table (3.0.2)
|
212
|
+
unicode-display_width (>= 1.1.1, < 3)
|
213
|
+
thor (1.3.1)
|
214
|
+
tzinfo (2.0.6)
|
215
|
+
concurrent-ruby (~> 1.0)
|
216
|
+
unicode-display_width (2.5.0)
|
217
|
+
uri (0.13.0)
|
218
|
+
webmock (3.23.1)
|
219
|
+
addressable (>= 2.8.0)
|
220
|
+
crack (>= 0.3.2)
|
221
|
+
hashdiff (>= 0.4.0, < 2.0.0)
|
222
|
+
yard (0.9.36)
|
223
|
+
|
224
|
+
PLATFORMS
|
225
|
+
ruby
|
226
|
+
|
227
|
+
DEPENDENCIES
|
228
|
+
gitlab-dangerfiles (~> 2.11.0)
|
229
|
+
gitlab-styles (~> 12.0)
|
230
|
+
gitlab-triage!
|
231
|
+
guard-rspec (~> 4.7.3)
|
232
|
+
lefthook (~> 1.3)
|
233
|
+
rake (~> 13.2)
|
234
|
+
rspec (~> 3.8)
|
235
|
+
webmock (~> 3.4)
|
236
|
+
yard
|
237
|
+
|
238
|
+
BUNDLED WITH
|
239
|
+
2.5.11
|
data/Guardfile
CHANGED
data/Rakefile
CHANGED
data/bin/gitlab-triage
CHANGED
data/gitlab-triage.gemspec
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
lib = File.expand_path('lib', __dir__)
|
2
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
5
|
require 'gitlab/triage/version'
|
@@ -14,6 +16,7 @@ Gem::Specification.new do |spec|
|
|
14
16
|
spec.required_ruby_version = Gem::Requirement.new(">= 3.0.0")
|
15
17
|
|
16
18
|
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
19
|
+
spec.metadata["rubygems_mfa_required"] = 'false'
|
17
20
|
|
18
21
|
spec.metadata["homepage_uri"] = spec.homepage
|
19
22
|
spec.metadata["source_code_uri"] = "https://gitlab.com/gitlab-org/ruby/gems/gitlab-triage"
|
@@ -22,7 +25,7 @@ Gem::Specification.new do |spec|
|
|
22
25
|
# Specify which files should be added to the gem when it is released.
|
23
26
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
24
27
|
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
25
|
-
`git ls-files -z`.split("\x0").
|
28
|
+
`git ls-files -z`.split("\x0").grep_v(%r{^(docs?|spec|tmp)/})
|
26
29
|
end
|
27
30
|
spec.bindir = 'bin'
|
28
31
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
@@ -37,18 +40,15 @@ Gem::Specification.new do |spec|
|
|
37
40
|
# see: https://github.com/github/graphql-client/pull/314
|
38
41
|
# We can remove this check once PR 314 is merged and released
|
39
42
|
spec.add_dependency 'graphql', '< 2.1.0'
|
40
|
-
|
43
|
+
# Matching version of triage-ops's httparty
|
44
|
+
spec.add_dependency 'httparty', '~> 0.20.0'
|
41
45
|
|
42
46
|
spec.add_development_dependency 'gitlab-dangerfiles', '~> 2.11.0'
|
43
|
-
spec.add_development_dependency 'gitlab-styles', '~>
|
47
|
+
spec.add_development_dependency 'gitlab-styles', '~> 12.0'
|
44
48
|
spec.add_development_dependency 'guard-rspec', '~> 4.7.3'
|
45
49
|
spec.add_development_dependency 'lefthook', '~> 1.3'
|
46
|
-
spec.add_development_dependency 'rake', '~>
|
50
|
+
spec.add_development_dependency 'rake', '~> 13.2'
|
47
51
|
spec.add_development_dependency 'rspec', '~> 3.8'
|
48
|
-
# we do not commit the bundle lockfile, so this temporary workaround needs to be
|
49
|
-
# present until 2.21.3 or 2.22.x is released
|
50
|
-
# See https://gitlab.com/gitlab-org/ruby/gems/gitlab-styles/-/issues/63
|
51
|
-
spec.add_development_dependency 'rubocop-rails', '!= 2.21.2'
|
52
52
|
spec.add_development_dependency 'webmock', '~> 3.4'
|
53
53
|
spec.add_development_dependency 'yard'
|
54
54
|
end
|
@@ -1,12 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Gitlab
|
2
4
|
module Triage
|
3
5
|
module Action
|
4
6
|
class Base
|
5
7
|
attr_reader :policy, :network
|
6
8
|
|
7
|
-
def initialize(
|
8
|
-
@policy = policy
|
9
|
-
@network = network
|
9
|
+
def initialize(**args)
|
10
|
+
@policy = args[:policy]
|
11
|
+
@network = args[:network]
|
10
12
|
end
|
11
13
|
end
|
12
14
|
end
|
data/lib/gitlab/triage/action.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require_relative '../param_builders/date_param_builder'
|
2
4
|
require_relative 'base_query_param_builder'
|
3
5
|
|
@@ -25,7 +27,7 @@ module Gitlab
|
|
25
27
|
private
|
26
28
|
|
27
29
|
def build_param_name(condition_hash)
|
28
|
-
prefix = condition_hash[:attribute].to_s.
|
30
|
+
prefix = condition_hash[:attribute].to_s.delete_suffix('_at')
|
29
31
|
suffix =
|
30
32
|
case condition_hash[:condition].to_sym
|
31
33
|
when :older_than
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require_relative 'base_command_builder'
|
2
4
|
|
3
5
|
module Gitlab
|
@@ -22,7 +24,7 @@ module Gitlab
|
|
22
24
|
|
23
25
|
unless Resource::Label.new(label_opts, network: network).exist?
|
24
26
|
raise Resource::Label::LabelDoesntExistError,
|
25
|
-
|
27
|
+
"Label `#{label}` doesn't exist!"
|
26
28
|
end
|
27
29
|
end
|
28
30
|
end
|
@@ -35,7 +35,7 @@ module Gitlab
|
|
35
35
|
items: "{{items}}",
|
36
36
|
name: "{{name}}"
|
37
37
|
}.freeze
|
38
|
-
PLACEHOLDER_REGEX = /{{([\w
|
38
|
+
PLACEHOLDER_REGEX = /{{([\w.]+)}}/
|
39
39
|
|
40
40
|
def initialize(
|
41
41
|
items, resource: nil, network: nil, redact_confidentials: true)
|
@@ -69,7 +69,7 @@ module Gitlab
|
|
69
69
|
SUPPORTED_PLACEHOLDERS.inject(item) do |comment, (placeholder, template)|
|
70
70
|
next comment unless comment.include?("{{#{placeholder}}}")
|
71
71
|
|
72
|
-
path = template[/.*#{PLACEHOLDER_REGEX}
|
72
|
+
path = template[/.*#{PLACEHOLDER_REGEX}.*/o, 1]
|
73
73
|
attributes = extract_attributes(path)
|
74
74
|
|
75
75
|
formatted_text = attributes.map do |attribute|
|
data/lib/gitlab/triage/engine.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: false
|
2
|
+
|
1
3
|
require 'active_support/all'
|
2
4
|
require 'active_support/inflector'
|
3
5
|
|
@@ -166,7 +168,7 @@ module Gitlab
|
|
166
168
|
raise(
|
167
169
|
ArgumentError,
|
168
170
|
"--resource-reference can only start with '#' or '!' when --source=projects is passed " \
|
169
|
-
|
171
|
+
"('#{options.resource_reference}' passed)!"
|
170
172
|
)
|
171
173
|
end
|
172
174
|
end
|
@@ -425,7 +427,7 @@ module Gitlab
|
|
425
427
|
def decorate_resources_with_graphql_data(resources, graphql_resources)
|
426
428
|
return if graphql_resources.nil?
|
427
429
|
|
428
|
-
graphql_resources_by_id = graphql_resources.
|
430
|
+
graphql_resources_by_id = graphql_resources.index_by { |resource| resource[:id] }
|
429
431
|
resources.each { |resource| resource.merge!(graphql_resources_by_id[resource[:id]].to_h) }
|
430
432
|
end
|
431
433
|
|
@@ -467,7 +469,7 @@ module Gitlab
|
|
467
469
|
|
468
470
|
# If the :ruby condition exists then filter based off of conditions
|
469
471
|
# else we base off of the `conditions[condition_key]`.
|
470
|
-
|
472
|
+
result =
|
471
473
|
if condition_key.to_s == 'no_additional_labels'
|
472
474
|
filter.new(resource, conditions[:labels]).calculate
|
473
475
|
elsif filter.instance_method(:initialize).arity == 2
|
@@ -475,6 +477,8 @@ module Gitlab
|
|
475
477
|
else
|
476
478
|
filter.new(resource, conditions[condition_key], network).calculate
|
477
479
|
end
|
480
|
+
|
481
|
+
results << result
|
478
482
|
end
|
479
483
|
end
|
480
484
|
results.all?
|
@@ -580,6 +584,7 @@ module Gitlab
|
|
580
584
|
else
|
581
585
|
['iteration_title', iteration_value]
|
582
586
|
end
|
587
|
+
|
583
588
|
APIQueryBuilders::SingleQueryParamBuilder.new(*args)
|
584
589
|
end
|
585
590
|
|
data/lib/gitlab/triage/errors.rb
CHANGED
@@ -1,10 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require_relative 'expansion'
|
2
4
|
|
3
5
|
module Gitlab
|
4
6
|
module Triage
|
5
7
|
module ExpandCondition
|
6
8
|
module List
|
7
|
-
PATTERN = /\{.+?,.+?\}/m
|
9
|
+
PATTERN = /\{.+?,.+?\}/m
|
8
10
|
|
9
11
|
def self.expand(conditions)
|
10
12
|
labels = conditions[:labels]
|
@@ -1,10 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require_relative 'expansion'
|
2
4
|
|
3
5
|
module Gitlab
|
4
6
|
module Triage
|
5
7
|
module ExpandCondition
|
6
8
|
module Sequence
|
7
|
-
PATTERN = /\{\s*(\d+)\s*\.\.\s*(\d+)\s*\}
|
9
|
+
PATTERN = /\{\s*(\d+)\s*\.\.\s*(\d+)\s*\}/
|
8
10
|
|
9
11
|
def self.expand(conditions)
|
10
12
|
labels = conditions[:labels]
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'active_support/all'
|
2
4
|
require_relative '../validators/params_validator'
|
3
5
|
|
@@ -22,9 +24,7 @@ module Gitlab
|
|
22
24
|
def self.params_filter_names(params = nil)
|
23
25
|
params ||= filter_parameters
|
24
26
|
|
25
|
-
params.
|
26
|
-
param[:name]
|
27
|
-
end
|
27
|
+
params.pluck(:name)
|
28
28
|
end
|
29
29
|
|
30
30
|
def self.all_params_filter_names
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require_relative 'base_conditions_filter'
|
2
4
|
require_relative '../url_builders/url_builder'
|
3
5
|
|
@@ -43,9 +45,7 @@ module Gitlab
|
|
43
45
|
end
|
44
46
|
|
45
47
|
def condition_value
|
46
|
-
members.
|
47
|
-
member[:username]
|
48
|
-
end
|
48
|
+
members.pluck(:username)
|
49
49
|
end
|
50
50
|
|
51
51
|
def calculate
|
@@ -55,7 +55,7 @@ module Gitlab
|
|
55
55
|
when :member_of
|
56
56
|
condition_value.include?(resource_value)
|
57
57
|
when :not_member_of
|
58
|
-
|
58
|
+
condition_value.exclude?(resource_value)
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|