gitlab-triage 1.43.2 → 1.44.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a798446c17c114304fd6f6eb8ce1b9af17a1e960d09d7c140bc595743c31eca1
4
- data.tar.gz: dcb29d111ef5b330ef7c1d57054911ef1b93c9017a3c0632bf675c9dc6dd6c05
3
+ metadata.gz: 1989fbcf91e2dc16796f87fdf597cd383902a65f51406409066cb8952b869b24
4
+ data.tar.gz: 706fe85fc28143854dcce8e88d2ca09b5b69890c83d2fd39d5e3892a3e14ff50
5
5
  SHA512:
6
- metadata.gz: 30e9a32abb469bbe1ddc8b16f8dd0a20583ef18b5aad4013e8fa245ba6614de02cc8ba9bf6496b1bfe36ccaa21cceffbd81f94437033c6d00d21395da5bb205a
7
- data.tar.gz: 486e978b4146930da3022d9bf097d09a3f393fba2b1a6bf02399a6d1830b0fcb7d07424ef81490733c85e495dbb1794ebb31a92a0c1acb2e403168f027db668f
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.2)
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'
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Gitlab
4
4
  module Triage
5
- VERSION = '1.43.2'
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.2
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-24 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