gitlab-triage 1.55.0 → 1.56.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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6ceaf6c8bfcc9a562d9bb91eb3eed9a8a3a7dc0eb1e7b93f6d1d8349ade568fe
|
|
4
|
+
data.tar.gz: c42d21663fce9f736d9dd9ab5b90abaad1cb7758c0c793ae08bb4e32ea152b53
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8f394bd327179891cda8f588c13b6027387fcb29521b0881d756d6c9ffd171184c1e9ae5eacea82eeb42bb685e97ccb4ce18c778d193ae5908994a464de556fa
|
|
7
|
+
data.tar.gz: 3720d5cd0a6d44fba15674292af90fe927cb55741651759f47c7617cf80ede1d76cd339b83e0296d9a7dec13022cb70869fd2c4eb2eabf09f196292c0919f9a9
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -1367,6 +1367,8 @@ The following placeholders are supported for `summary`:
|
|
|
1367
1367
|
> - Placeholders work regularly for `item`, but for `summary` only `{{title}}`,
|
|
1368
1368
|
> `{{items}}`, `{{type}}` are supported because it's not tied to a particular
|
|
1369
1369
|
> resource like the comment action.
|
|
1370
|
+
> - `labels`, `assignees`, `due_date`, `milestone`, and `confidential` can read
|
|
1371
|
+
> `{{type}}`, `{{items}}`, and `resource[:items]`.
|
|
1370
1372
|
> - No issues will be created if:
|
|
1371
1373
|
> - the specific policy doesn't yield any resources; or
|
|
1372
1374
|
> - the source type is a group and `destination` is not set.
|
|
@@ -1928,6 +1930,17 @@ resource_rules:
|
|
|
1928
1930
|
#{'/label ~P3' unless has_priority_label?}
|
|
1929
1931
|
```
|
|
1930
1932
|
|
|
1933
|
+
A plugin can also set a filter that receives every `comment` and
|
|
1934
|
+
`comment_on_summary` body before it is posted or printed in dry-run mode,
|
|
1935
|
+
and returns the body to post. An empty or `nil` result posts nothing. The
|
|
1936
|
+
filter is process-wide and does not apply to `summarize`, `issue`, or
|
|
1937
|
+
`work_item` descriptions. This example drops every line that starts with a
|
|
1938
|
+
slash, so adapt it to your needs:
|
|
1939
|
+
|
|
1940
|
+
```ruby
|
|
1941
|
+
Gitlab::Triage::Action::Comment.filter = ->(body) { body.gsub(%r{^/\w+.*$\n?}, '') }
|
|
1942
|
+
```
|
|
1943
|
+
|
|
1931
1944
|
### API Response Caching (`--cache-dir`)
|
|
1932
1945
|
|
|
1933
1946
|
In large CI pipelines with many concurrent triage jobs, each job independently fetches the same paginated API responses (e.g., group members). This results in many redundant API calls.
|
|
@@ -9,6 +9,14 @@ module Gitlab
|
|
|
9
9
|
module Triage
|
|
10
10
|
module Action
|
|
11
11
|
class Comment < Base
|
|
12
|
+
class << self
|
|
13
|
+
attr_accessor :filter
|
|
14
|
+
|
|
15
|
+
def apply_filter(text)
|
|
16
|
+
(filter ? filter.call(text) : text).to_s.strip
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
|
|
12
20
|
class Dry < Comment
|
|
13
21
|
def act
|
|
14
22
|
puts "The following comments would be posted for the rule **#{policy.name}**:\n\n"
|
|
@@ -30,7 +38,7 @@ module Gitlab
|
|
|
30
38
|
end
|
|
31
39
|
|
|
32
40
|
policy.resources.each do |resource|
|
|
33
|
-
comment = build_comment(resource)
|
|
41
|
+
comment = Comment.apply_filter(build_comment(resource))
|
|
34
42
|
|
|
35
43
|
perform(resource, comment) unless comment.empty?
|
|
36
44
|
end
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require_relative 'base'
|
|
4
|
+
require_relative 'comment'
|
|
4
5
|
require_relative '../command_builders/text_content_builder'
|
|
5
6
|
|
|
6
7
|
module Gitlab
|
|
@@ -30,7 +31,7 @@ module Gitlab
|
|
|
30
31
|
|
|
31
32
|
def act
|
|
32
33
|
policy.resources.each do |resource|
|
|
33
|
-
comment = build_comment(resource)
|
|
34
|
+
comment = Comment.apply_filter(build_comment(resource))
|
|
34
35
|
|
|
35
36
|
perform(comment) unless comment.empty?
|
|
36
37
|
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.
|
|
4
|
+
version: 1.56.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- GitLab
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-10-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|