gitlab-triage 1.43.2 → 1.44.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +12 -0
- data/lib/gitlab/triage/engine.rb +4 -0
- data/lib/gitlab/triage/graphql_queries/query_builder.rb +1 -0
- data/lib/gitlab/triage/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1989fbcf91e2dc16796f87fdf597cd383902a65f51406409066cb8952b869b24
|
4
|
+
data.tar.gz: 706fe85fc28143854dcce8e88d2ca09b5b69890c83d2fd39d5e3892a3e14ff50
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 621c8a5ac785f25c05995843691607f2469010e86104d98b8d7365a123d67e3ebb195b8bf919492988808625a84fa124610bf5d7190c71ca92cbf1b12aff7e0b
|
7
|
+
data.tar.gz: 86e66520931275689b3b487f2a41435b68ba536f82ec52167f07994affdb0bc8b6ff476e0aff4e97ed33c09fd3da86cabc62b780d369631a4317f6867446eab9
|
data/Gemfile.lock
CHANGED
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.
|
data/lib/gitlab/triage/engine.rb
CHANGED
@@ -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'
|
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.
|
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-
|
11
|
+
date: 2024-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|