gitlab-triage 1.43.1 → 1.44.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e9477540c0d56866682afeb01649483e1b1d1eb7401906e7d2b74459426f9cbd
4
- data.tar.gz: f68223b942d7617c0caadd7c928f192c751573c6fd2df012afec95650c7e25c9
3
+ metadata.gz: 1989fbcf91e2dc16796f87fdf597cd383902a65f51406409066cb8952b869b24
4
+ data.tar.gz: 706fe85fc28143854dcce8e88d2ca09b5b69890c83d2fd39d5e3892a3e14ff50
5
5
  SHA512:
6
- metadata.gz: bc6d78e35535fa13116db621b8d7e32ceed744d1d020d5d38e52ece77363d70f01bbc5aa9eaaa8e02fc13e0f4bee1677392d145bf7c9f1eb21d4df109e5d95e6
7
- data.tar.gz: 351c4c8e9a2cbf255682391a3911f0049d9bca0ab247ef96eae9e576f3d0e811792b4a4154bed4efa60836b1ad1b93284b8b94f3beec54a286d075cc65db799c
6
+ metadata.gz: 621c8a5ac785f25c05995843691607f2469010e86104d98b8d7365a123d67e3ebb195b8bf919492988808625a84fa124610bf5d7190c71ca92cbf1b12aff7e0b
7
+ data.tar.gz: 86e66520931275689b3b487f2a41435b68ba536f82ec52167f07994affdb0bc8b6ff476e0aff4e97ed33c09fd3da86cabc62b780d369631a4317f6867446eab9
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gitlab-triage (1.43.1)
4
+ gitlab-triage (1.44.0)
5
5
  activesupport (>= 5.1)
6
6
  globalid (~> 1.0, >= 1.0.1)
7
7
  graphql (< 2.1.0)
data/README.md CHANGED
@@ -177,6 +177,7 @@ Available condition types:
177
177
  - [`labels` condition](#labels-condition)
178
178
  - [`forbidden_labels` condition](#forbidden-labels-condition)
179
179
  - [`no_additional_labels` condition](#no-additional-labels-condition)
180
+ - [`author_username` condition](#author-username-condition)
180
181
  - [`author_member` condition](#author-member-condition)
181
182
  - [`assignee_member` condition](#assignee-member-condition)
182
183
  - [`draft` condition](#draft-condition)
@@ -489,6 +490,17 @@ conditions:
489
490
  no_additional_labels: true
490
491
  ```
491
492
 
493
+ ##### Author username condition
494
+
495
+ Accepts the username to filter on.
496
+
497
+ Example:
498
+
499
+ ```yml
500
+ conditions:
501
+ author_username: gitlab-bot
502
+ ```
503
+
492
504
  ##### Author Member condition
493
505
 
494
506
  This condition determines whether the author of a resource is a member of the specified group or project.
@@ -501,6 +501,7 @@ module Gitlab
501
501
 
502
502
  # rubocop:disable Metrics/AbcSize
503
503
  # rubocop:disable Metrics/CyclomaticComplexity
504
+ # rubocop:disable Metrics/PerceivedComplexity
504
505
  def build_get_url(resource_type, conditions)
505
506
  # Example issues query with state and labels
506
507
  # https://gitlab.com/api/v4/projects/test-triage%2Fissue-project/issues?state=open&labels=project%20label%20with%20spaces,group_label_no_spaces
@@ -510,6 +511,8 @@ module Gitlab
510
511
 
511
512
  condition_builders = []
512
513
  condition_builders << APIQueryBuilders::SingleQueryParamBuilder.new('iids', options.resource_reference[1..]) if options.resource_reference
514
+ author_username = conditions[:author_username]
515
+ condition_builders << APIQueryBuilders::SingleQueryParamBuilder.new('author_username', author_username) if author_username
513
516
 
514
517
  condition_builders << APIQueryBuilders::MultiQueryParamBuilder.new('labels', conditions[:labels], ',') if conditions[:labels]
515
518
 
@@ -560,6 +563,7 @@ module Gitlab
560
563
  end
561
564
  # rubocop:enable Metrics/AbcSize
562
565
  # rubocop:enable Metrics/CyclomaticComplexity
566
+ # rubocop:enable Metrics/PerceivedComplexity
563
567
 
564
568
  def milestone_condition_builder(resource_type, milestone_condition)
565
569
  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,7 +152,7 @@ module Gitlab
151
152
  args =
152
153
  case condition.to_s
153
154
  when 'forbidden_labels'
154
- ['labelName', condition_params, { negated: true }]
155
+ ['labels', condition_params, { negated: true }]
155
156
  when 'labels'
156
157
  ['labelName', condition_params, {}]
157
158
  else
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Gitlab
4
4
  module Triage
5
- VERSION = '1.43.1'
5
+ VERSION = '1.44.0'
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.1
4
+ version: 1.44.0
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-20 00:00:00.000000000 Z
11
+ date: 2024-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport