gitlab-triage 1.43.2 → 1.44.1

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: a798446c17c114304fd6f6eb8ce1b9af17a1e960d09d7c140bc595743c31eca1
4
- data.tar.gz: dcb29d111ef5b330ef7c1d57054911ef1b93c9017a3c0632bf675c9dc6dd6c05
3
+ metadata.gz: ac5a7d628801b6d055cd8d08a93e46ada848bd9cc723877d797d55eda27d0d23
4
+ data.tar.gz: e10f32f3573d1fe7408de87cff5e96a8160aa87f6a75b6ef3114b868fbd4949c
5
5
  SHA512:
6
- metadata.gz: 30e9a32abb469bbe1ddc8b16f8dd0a20583ef18b5aad4013e8fa245ba6614de02cc8ba9bf6496b1bfe36ccaa21cceffbd81f94437033c6d00d21395da5bb205a
7
- data.tar.gz: 486e978b4146930da3022d9bf097d09a3f393fba2b1a6bf02399a6d1830b0fcb7d07424ef81490733c85e495dbb1794ebb31a92a0c1acb2e403168f027db668f
6
+ metadata.gz: a0690585541ba68dd3bf6a9f8b08b9252489daa1292bfe86dc8a4d6042663fef2c18451acc23469a8d3f29c645b27318fe35efb4a2b6f7b25373d92940d6c198
7
+ data.tar.gz: 60d649bc2acfe7cb3321579f8c8c9dbd039b1ec7d38f6bcb9c1b45b9ee9a11031e135319a7c8938df951c309cf3c3631ea02951d0242a4e5d08218c972193ae1
@@ -2,7 +2,7 @@
2
2
  commit from this merge request, and `<NEW_VERSION>` with the upcoming version number. -->
3
3
  ## Diff
4
4
 
5
- https://gitlab.com/gitlab-org/ruby/gems/gitlab-triage/-/compare/v<PREVIOUS_VERSION>...<COMMIT_UPDATING_VERSION>
5
+ https://gitlab.com/gitlab-org/ruby/gems/gitlab-triage/-/compare/<PREVIOUS_VERSION>...<COMMIT_UPDATING_VERSION>
6
6
 
7
7
  ## Checklist
8
8
 
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.2.3
1
+ 3.2.4
data/.tool-versions CHANGED
@@ -1 +1 @@
1
- ruby 3.1.5
1
+ ruby 3.2.4
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.1)
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.
@@ -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'
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Gitlab
4
4
  module Triage
5
- VERSION = '1.43.2'
5
+ VERSION = '1.44.1'
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.1
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-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport