gitlab-triage 1.43.0 → 1.44.5

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: 95d1d38e50b3032593baffe5e3122da139f542294529cadaaffa5e2861d0a428
4
- data.tar.gz: 83ac90f1c5815c5a39a6cb5d3d84b34112a1a3a72f2dd9a9481291bc171648c3
3
+ metadata.gz: d7dcf562327f4c1cb9000f202742fef19e6f98d4cb2c1366fdc4e4ddc12e92e3
4
+ data.tar.gz: c4d846bf074fd836674a00243214cd46bf4646533f5491e135411d1fd70bfc1d
5
5
  SHA512:
6
- metadata.gz: 8d0aef0429e6892959468c199b0bddbb18ecf02bf864ee038f59b01f35e779a200724e8841b3f603add6267a5a6b3c7746520d10bc48d77c2a6a025e5d3ddaa2
7
- data.tar.gz: 70ea6376e7855ce5ac2207d0f0dc779d8d4e32eb800192c5d3ec8cbfa546425797087525c6a281bfd5513b4d8d4619cf6a81e7fd2e59b7c48d77972653ca5b37
6
+ metadata.gz: d530580eb38b4ebdd08607854caf8472dbb818a5371ba94e086f3ce0c94fe9df4d46c600fd82f54c1d200b006cf2ba3a644bcb07fe0eb9e343e7528cc873d5df
7
+ data.tar.gz: 31c116393ec4e4c4941737ed595efba31dc6f7060c0ff0ef7cb5b8549bc3ae9af619ec0155f157600c4d1358ef337d39888ad1ed9677421d2311a66426101b46
data/.gitignore CHANGED
@@ -3,7 +3,6 @@
3
3
  /.rspec
4
4
  /.bundle/
5
5
  /.yardoc
6
- /Gemfile.lock
7
6
  /_yardoc/
8
7
  /coverage/
9
8
  /pkg/
@@ -1,8 +1,11 @@
1
- <!-- Replace `<PREVIOUS_VERSION>` with the previous version number here, `<COMMIT_UPDATING_VERSION>` with the latest
1
+ <!--1. Modify /Gemfile.lock, updating specs: gitlab-triage to the new release. See the project's git tags for the latest release. -->
2
+ <!--2. Modify /lib/gitlab/triage/version.rb, updating the version to the new release. -->
3
+ <!--3. Open a merge request with this template -->
4
+ <!--4. Replace `<PREVIOUS_VERSION>` with the previous version number here, `<COMMIT_UPDATING_VERSION>` with the latest
2
5
  commit from this merge request, and `<NEW_VERSION>` with the upcoming version number. -->
3
6
  ## Diff
4
7
 
5
- https://gitlab.com/gitlab-org/ruby/gems/gitlab-triage/-/compare/v<PREVIOUS_VERSION>...<COMMIT_UPDATING_VERSION>
8
+ https://gitlab.com/gitlab-org/ruby/gems/gitlab-triage/-/compare/<PREVIOUS_VERSION>...<COMMIT_UPDATING_VERSION>
6
9
 
7
10
  ## Checklist
8
11
 
data/.gitlab-ci.yml CHANGED
@@ -7,26 +7,27 @@ stages:
7
7
  default:
8
8
  tags:
9
9
  - gitlab-org
10
-
10
+
11
11
  .ruby-cache: &ruby-cache
12
12
  cache:
13
13
  key:
14
14
  files:
15
- - Gemfile
16
- - gitlab-triage.gemspec
15
+ - Gemfile.lock
17
16
  paths:
18
17
  - vendor/ruby
19
- - Gemfile.lock
20
18
  policy: pull
21
19
 
22
20
  .use-ruby:
23
21
  image: ruby:3.2
24
22
  <<: *ruby-cache
23
+ variables:
24
+ BUNDLE_FROZEN: "true"
25
+ BUNDLE_PATH: "vendor"
25
26
  before_script:
26
27
  - ruby --version
27
28
  - gem install bundler --no-document
28
29
  - bundle --version
29
- - bundle install --jobs $(nproc) --path=vendor --retry 3 --quiet
30
+ - bundle install --jobs $(nproc) --retry 3 --quiet
30
31
  - bundle check
31
32
 
32
33
  workflow:
data/.rubocop_todo.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config --exclude-limit 10000`
3
- # on 2024-04-16 16:23:46 UTC using RuboCop version 1.57.2.
3
+ # on 2024-06-13 12:56:53 UTC using RuboCop version 1.62.1.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
@@ -25,6 +25,17 @@ CodeReuse/ActiveRecord:
25
25
  - 'spec/support/shared_examples/label_command_shared_examples.rb'
26
26
  - 'spec/support/stub_api.rb'
27
27
 
28
+ # Offense count: 4
29
+ # This cop supports unsafe autocorrection (--autocorrect-all).
30
+ # Configuration parameters: Categories, ExpectedOrder.
31
+ # ExpectedOrder: module_inclusion, constants, public_class_methods, initializer, public_methods, protected_methods, private_methods
32
+ Layout/ClassStructure:
33
+ Exclude:
34
+ - 'lib/gitlab/triage/filters/base_conditions_filter.rb'
35
+ - 'lib/gitlab/triage/filters/member_conditions_filter.rb'
36
+ - 'lib/gitlab/triage/graphql_queries/query_builder.rb'
37
+ - 'lib/gitlab/triage/limiters/base_limiter.rb'
38
+
28
39
  # Offense count: 1
29
40
  Lint/ToEnumArguments:
30
41
  Exclude:
@@ -43,6 +54,51 @@ Performance/MethodObjectAsBlock:
43
54
  RSpec/MultipleMemoizedHelpers:
44
55
  Max: 10
45
56
 
57
+ # Offense count: 305
58
+ # Configuration parameters: EnforcedStyle, IgnoreSharedExamples.
59
+ # SupportedStyles: always, named_only
60
+ RSpec/NamedSubject:
61
+ Exclude:
62
+ - 'spec/gitlab/triage/action/comment_on_summary_spec.rb'
63
+ - 'spec/gitlab/triage/action/comment_spec.rb'
64
+ - 'spec/gitlab/triage/action/delete_spec.rb'
65
+ - 'spec/gitlab/triage/action/issue_spec.rb'
66
+ - 'spec/gitlab/triage/action/summarize_spec.rb'
67
+ - 'spec/gitlab/triage/action_spec.rb'
68
+ - 'spec/gitlab/triage/engine_spec.rb'
69
+ - 'spec/gitlab/triage/entity_builders/issue_builder_spec.rb'
70
+ - 'spec/gitlab/triage/entity_builders/summary_builder_spec.rb'
71
+ - 'spec/gitlab/triage/expand_condition/expansion_spec.rb'
72
+ - 'spec/gitlab/triage/expand_condition/list_spec.rb'
73
+ - 'spec/gitlab/triage/expand_condition/sequence_spec.rb'
74
+ - 'spec/gitlab/triage/expand_condition_spec.rb'
75
+ - 'spec/gitlab/triage/filters/branch_date_filter_spec.rb'
76
+ - 'spec/gitlab/triage/filters/discussions_conditions_filter_spec.rb'
77
+ - 'spec/gitlab/triage/filters/issue_date_conditions_filter_spec.rb'
78
+ - 'spec/gitlab/triage/filters/merge_request_date_conditions_filter_spec.rb'
79
+ - 'spec/gitlab/triage/filters/no_additional_labels_conditions_filter_spec.rb'
80
+ - 'spec/gitlab/triage/filters/ruby_conditions_filter_spec.rb'
81
+ - 'spec/gitlab/triage/filters/votes_conditions_filter_spec.rb'
82
+ - 'spec/gitlab/triage/limiters/date_field_limiter_spec.rb'
83
+ - 'spec/gitlab/triage/network_adapters/httparty_adapter_spec.rb'
84
+ - 'spec/gitlab/triage/policies/base_policy_spec.rb'
85
+ - 'spec/gitlab/triage/policies/rule_policy_spec.rb'
86
+ - 'spec/gitlab/triage/policies/summary_policy_spec.rb'
87
+ - 'spec/gitlab/triage/resource/base_spec.rb'
88
+ - 'spec/gitlab/triage/resource/context_spec.rb'
89
+ - 'spec/gitlab/triage/resource/epic_spec.rb'
90
+ - 'spec/gitlab/triage/resource/instance_version_spec.rb'
91
+ - 'spec/gitlab/triage/resource/issue_spec.rb'
92
+ - 'spec/gitlab/triage/resource/label_event_spec.rb'
93
+ - 'spec/gitlab/triage/resource/label_spec.rb'
94
+ - 'spec/gitlab/triage/resource/linked_issue_spec.rb'
95
+ - 'spec/gitlab/triage/resource/merge_request_spec.rb'
96
+ - 'spec/gitlab/triage/resource/milestone_spec.rb'
97
+ - 'spec/gitlab/triage/resource/shared/issuable_spec.rb'
98
+ - 'spec/gitlab/triage/rest_api_network_spec.rb'
99
+ - 'spec/gitlab/triage/retryable_spec.rb'
100
+ - 'spec/gitlab/triage/url_builders/url_builder_spec.rb'
101
+
46
102
  # Offense count: 10
47
103
  # Configuration parameters: AllowedPatterns.
48
104
  # AllowedPatterns: ^expect_, ^assert_
@@ -54,13 +110,6 @@ RSpec/NoExpectationExample:
54
110
  - 'spec/integration/redact_confidentials_spec.rb'
55
111
  - 'spec/integration/summary_policies_spec.rb'
56
112
 
57
- # Offense count: 1
58
- # Configuration parameters: Include.
59
- # Include: **/*_spec*rb*, **/spec/**/*
60
- RSpec/SpecFilePathSuffix:
61
- Exclude:
62
- - 'spec/integration/issue_action_policy.rb'
63
-
64
113
  # Offense count: 12
65
114
  # Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
66
115
  RSpec/VerifiedDoubles:
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.2.3
1
+ 3.2.4
data/.tool-versions CHANGED
@@ -1 +1 @@
1
- ruby 3.2.3
1
+ ruby 3.2.4
data/CONTRIBUTING.md CHANGED
@@ -1,9 +1,9 @@
1
1
  ## Developer Certificate of Origin + License
2
2
 
3
- By contributing to GitLab B.V., You accept and agree to the following terms and
4
- conditions for Your present and future Contributions submitted to GitLab B.V.
5
- Except for the license granted herein to GitLab B.V. and recipients of software
6
- distributed by GitLab B.V., You reserve all right, title, and interest in and to
3
+ By contributing to GitLab Inc., You accept and agree to the following terms and
4
+ conditions for Your present and future Contributions submitted to GitLab Inc.
5
+ Except for the license granted herein to GitLab Inc. and recipients of software
6
+ distributed by GitLab Inc., You reserve all right, title, and interest in and to
7
7
  Your Contributions. All Contributions are subject to the following DCO + License
8
8
  terms.
9
9
 
data/Gemfile.lock ADDED
@@ -0,0 +1,239 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ gitlab-triage (1.44.5)
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/LICENSE.md CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2011-2017 GitLab B.V.
1
+ Copyright (c) 2011-2024 GitLab Inc.
2
2
 
3
3
  With regard to the GitLab Software:
4
4
 
data/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  # GitLab Triage Project
4
4
 
5
+ [[_TOC_]]
6
+
5
7
  This project allows to automate triaging of issues and merge requests for GitLab projects or groups.
6
8
 
7
9
  ## Note this Gem is not supported by the GitLab Support team
@@ -177,6 +179,7 @@ Available condition types:
177
179
  - [`labels` condition](#labels-condition)
178
180
  - [`forbidden_labels` condition](#forbidden-labels-condition)
179
181
  - [`no_additional_labels` condition](#no-additional-labels-condition)
182
+ - [`author_username` condition](#author-username-condition)
180
183
  - [`author_member` condition](#author-member-condition)
181
184
  - [`assignee_member` condition](#assignee-member-condition)
182
185
  - [`draft` condition](#draft-condition)
@@ -489,6 +492,17 @@ conditions:
489
492
  no_additional_labels: true
490
493
  ```
491
494
 
495
+ ##### Author username condition
496
+
497
+ Accepts the username to filter on.
498
+
499
+ Example:
500
+
501
+ ```yml
502
+ conditions:
503
+ author_username: gitlab-bot
504
+ ```
505
+
492
506
  ##### Author Member condition
493
507
 
494
508
  This condition determines whether the author of a resource is a member of the specified group or project.
@@ -1155,14 +1169,15 @@ resource_rules:
1155
1169
  issues:
1156
1170
  rules:
1157
1171
  - name: Issues requiring extra testing
1158
- labels:
1159
- - needs-testing
1172
+ conditions:
1173
+ labels:
1174
+ - needs-testing
1160
1175
  actions:
1161
1176
  issue:
1162
1177
  title: |
1163
- Testing: {{ title }}
1178
+ Testing: {{title}}
1164
1179
  description: |
1165
- The issue {{ full_reference }} needs testing.
1180
+ The issue {{full_reference}} needs testing.
1166
1181
 
1167
1182
  Please take care of them before the end of #{7.days.from_now.strftime('%Y-%m-%d')}
1168
1183
 
@@ -40,18 +40,15 @@ Gem::Specification.new do |spec|
40
40
  # see: https://github.com/github/graphql-client/pull/314
41
41
  # We can remove this check once PR 314 is merged and released
42
42
  spec.add_dependency 'graphql', '< 2.1.0'
43
- spec.add_dependency 'httparty', '~> 0.17'
43
+ # Matching version of triage-ops's httparty
44
+ spec.add_dependency 'httparty', '~> 0.20.0'
44
45
 
45
46
  spec.add_development_dependency 'gitlab-dangerfiles', '~> 2.11.0'
46
- spec.add_development_dependency 'gitlab-styles', '~> 10.0'
47
+ spec.add_development_dependency 'gitlab-styles', '~> 12.0'
47
48
  spec.add_development_dependency 'guard-rspec', '~> 4.7.3'
48
49
  spec.add_development_dependency 'lefthook', '~> 1.3'
49
50
  spec.add_development_dependency 'rake', '~> 13.2'
50
51
  spec.add_development_dependency 'rspec', '~> 3.8'
51
- # we do not commit the bundle lockfile, so this temporary workaround needs to be
52
- # present until 2.21.3 or 2.22.x is released
53
- # See https://gitlab.com/gitlab-org/ruby/gems/gitlab-styles/-/issues/63
54
- spec.add_development_dependency 'rubocop-rails', '!= 2.21.2'
55
52
  spec.add_development_dependency 'webmock', '~> 3.4'
56
53
  spec.add_development_dependency 'yard'
57
54
  end
@@ -61,6 +61,16 @@ module Gitlab
61
61
  end
62
62
 
63
63
  def perform(resource, comment)
64
+ if network.options.debug
65
+ if policy.actions.fetch(:redact_confidential_resources, true) && resource[:confidential]
66
+ puts Gitlab::Triage::UI.debug "Comment action resource: (confidential)"
67
+ else
68
+ puts Gitlab::Triage::UI.debug "Comment action resource: #{resource.inspect}"
69
+ end
70
+
71
+ puts Gitlab::Triage::UI.debug "Comment action content: #{comment}"
72
+ end
73
+
64
74
  network.post_api(
65
75
  build_post_url(resource),
66
76
  post_body(comment))
@@ -79,7 +89,7 @@ module Gitlab
79
89
  # POST /(groups|projects)/:id/(epics|issues|merge_requests)/:iid/notes
80
90
  post_url = UrlBuilders::UrlBuilder.new(url_builder_opts).build
81
91
 
82
- puts Gitlab::Triage::UI.debug "post_url: #{post_url}" if network.options.debug
92
+ puts Gitlab::Triage::UI.debug "Comment action post_url: #{post_url}" if network.options.debug
83
93
 
84
94
  post_url
85
95
  end
@@ -168,7 +168,7 @@ module Gitlab
168
168
  raise(
169
169
  ArgumentError,
170
170
  "--resource-reference can only start with '#' or '!' when --source=projects is passed " \
171
- "('#{options.resource_reference}' passed)!"
171
+ "('#{options.resource_reference}' passed)!"
172
172
  )
173
173
  end
174
174
  end
@@ -450,7 +450,7 @@ module Gitlab
450
450
 
451
451
  FILTER_MAP.each do |condition_key, filter_value|
452
452
  # Skips to the next key value pair if the condition is not applicable
453
- next unless conditions[condition_key]
453
+ next if conditions[condition_key].nil?
454
454
 
455
455
  case filter_value
456
456
  when Hash
@@ -469,9 +469,12 @@ module Gitlab
469
469
 
470
470
  # If the :ruby condition exists then filter based off of conditions
471
471
  # else we base off of the `conditions[condition_key]`.
472
+
472
473
  result =
473
474
  if condition_key.to_s == 'no_additional_labels'
474
475
  filter.new(resource, conditions[:labels]).calculate
476
+ elsif condition_key.to_s == 'protected'
477
+ filter.new(resource, conditions[:protected]).calculate
475
478
  elsif filter.instance_method(:initialize).arity == 2
476
479
  filter.new(resource, conditions[condition_key]).calculate
477
480
  else
@@ -501,6 +504,7 @@ module Gitlab
501
504
 
502
505
  # rubocop:disable Metrics/AbcSize
503
506
  # rubocop:disable Metrics/CyclomaticComplexity
507
+ # rubocop:disable Metrics/PerceivedComplexity
504
508
  def build_get_url(resource_type, conditions)
505
509
  # Example issues query with state and labels
506
510
  # https://gitlab.com/api/v4/projects/test-triage%2Fissue-project/issues?state=open&labels=project%20label%20with%20spaces,group_label_no_spaces
@@ -510,6 +514,8 @@ module Gitlab
510
514
 
511
515
  condition_builders = []
512
516
  condition_builders << APIQueryBuilders::SingleQueryParamBuilder.new('iids', options.resource_reference[1..]) if options.resource_reference
517
+ author_username = conditions[:author_username]
518
+ condition_builders << APIQueryBuilders::SingleQueryParamBuilder.new('author_username', author_username) if author_username
513
519
 
514
520
  condition_builders << APIQueryBuilders::MultiQueryParamBuilder.new('labels', conditions[:labels], ',') if conditions[:labels]
515
521
 
@@ -560,6 +566,7 @@ module Gitlab
560
566
  end
561
567
  # rubocop:enable Metrics/AbcSize
562
568
  # rubocop:enable Metrics/CyclomaticComplexity
569
+ # rubocop:enable Metrics/PerceivedComplexity
563
570
 
564
571
  def milestone_condition_builder(resource_type, milestone_condition)
565
572
  milestone_value = Array(milestone_condition)[0].to_s # back-compatibility
@@ -91,6 +91,7 @@ module Gitlab
91
91
 
92
92
  conditions.each do |condition, condition_params|
93
93
  condition_queries << QueryParamBuilders::DateParamBuilder.new(condition_params) if condition.to_s == 'date'
94
+ condition_queries << QueryParamBuilders::BaseParamBuilder.new('authorUsername', condition_params) if condition.to_s == 'author_username'
94
95
  condition_queries << QueryParamBuilders::BaseParamBuilder.new('milestoneTitle', condition_params) if condition.to_s == 'milestone'
95
96
  condition_queries << QueryParamBuilders::BaseParamBuilder.new('state', condition_params, with_quotes: false) if condition.to_s == 'state'
96
97
  condition_queries << QueryParamBuilders::BaseParamBuilder.new('iids', '$iids', with_quotes: false) if condition.to_s == 'iids'
@@ -151,9 +152,9 @@ module Gitlab
151
152
  args =
152
153
  case condition.to_s
153
154
  when 'forbidden_labels'
154
- ['labels', condition_params, { negated: true }]
155
+ ['labelName', condition_params, { negated: true }]
155
156
  when 'labels'
156
- ['labels', condition_params, {}]
157
+ ['labelName', condition_params, {}]
157
158
  else
158
159
  return nil
159
160
  end
@@ -21,7 +21,7 @@ module Gitlab
21
21
  end
22
22
 
23
23
  def name
24
- @name ||= (policy_spec[:name] || "#{type}-#{object_id}")
24
+ @name ||= policy_spec[:name] || "#{type}-#{object_id}"
25
25
  end
26
26
 
27
27
  def source
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Gitlab
4
4
  module Triage
5
- VERSION = '1.43.0'
5
+ VERSION = '1.44.5'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab-triage
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.43.0
4
+ version: 1.44.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitLab
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-11 00:00:00.000000000 Z
11
+ date: 2025-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -78,14 +78,14 @@ dependencies:
78
78
  requirements:
79
79
  - - "~>"
80
80
  - !ruby/object:Gem::Version
81
- version: '0.17'
81
+ version: 0.20.0
82
82
  type: :runtime
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - "~>"
87
87
  - !ruby/object:Gem::Version
88
- version: '0.17'
88
+ version: 0.20.0
89
89
  - !ruby/object:Gem::Dependency
90
90
  name: gitlab-dangerfiles
91
91
  requirement: !ruby/object:Gem::Requirement
@@ -106,14 +106,14 @@ dependencies:
106
106
  requirements:
107
107
  - - "~>"
108
108
  - !ruby/object:Gem::Version
109
- version: '10.0'
109
+ version: '12.0'
110
110
  type: :development
111
111
  prerelease: false
112
112
  version_requirements: !ruby/object:Gem::Requirement
113
113
  requirements:
114
114
  - - "~>"
115
115
  - !ruby/object:Gem::Version
116
- version: '10.0'
116
+ version: '12.0'
117
117
  - !ruby/object:Gem::Dependency
118
118
  name: guard-rspec
119
119
  requirement: !ruby/object:Gem::Requirement
@@ -170,20 +170,6 @@ dependencies:
170
170
  - - "~>"
171
171
  - !ruby/object:Gem::Version
172
172
  version: '3.8'
173
- - !ruby/object:Gem::Dependency
174
- name: rubocop-rails
175
- requirement: !ruby/object:Gem::Requirement
176
- requirements:
177
- - - "!="
178
- - !ruby/object:Gem::Version
179
- version: 2.21.2
180
- type: :development
181
- prerelease: false
182
- version_requirements: !ruby/object:Gem::Requirement
183
- requirements:
184
- - - "!="
185
- - !ruby/object:Gem::Version
186
- version: 2.21.2
187
173
  - !ruby/object:Gem::Dependency
188
174
  name: webmock
189
175
  requirement: !ruby/object:Gem::Requirement
@@ -237,6 +223,7 @@ files:
237
223
  - CONTRIBUTING.md
238
224
  - Dangerfile
239
225
  - Gemfile
226
+ - Gemfile.lock
240
227
  - Guardfile
241
228
  - LICENSE.md
242
229
  - README.md
@@ -352,7 +339,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
352
339
  - !ruby/object:Gem::Version
353
340
  version: '0'
354
341
  requirements: []
355
- rubygems_version: 3.3.27
342
+ rubygems_version: 3.5.22
356
343
  signing_key:
357
344
  specification_version: 4
358
345
  summary: GitLab triage automation project.