gitlab-triage 1.55.1 → 1.56.1
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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +11 -0
- data/lib/gitlab/triage/action/comment.rb +9 -1
- data/lib/gitlab/triage/action/comment_on_summary.rb +2 -1
- data/lib/gitlab/triage/rest_api_network.rb +3 -1
- 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: 9420b956227ae89432c05b78279b5c8267bf98e721c4feb2cde5fee21a7d611a
|
|
4
|
+
data.tar.gz: ffde105e64820dca1e873e4c368bbe65d4039080aba864e114e67e7c6d3efaa3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4475319216eee8897599eef75260c58e3d677043d3a8b86cbe1ef44b6146faafb967786d3004731879b8a9c4996a21620a50956196f978aa94c704f9e2c2ef96
|
|
7
|
+
data.tar.gz: 42b71bf2233e9daeeec8834b2bb3d651f620f758f83cb3e4e17701208aa40fbf55473532d5eff574dde327afc4c3d97029c370ee5c34198d22bf784a51af932d
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -1930,6 +1930,17 @@ resource_rules:
|
|
|
1930
1930
|
#{'/label ~P3' unless has_priority_label?}
|
|
1931
1931
|
```
|
|
1932
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
|
+
|
|
1933
1944
|
### API Response Caching (`--cache-dir`)
|
|
1934
1945
|
|
|
1935
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
|
|
@@ -52,7 +52,9 @@ module Gitlab
|
|
|
52
52
|
when Array
|
|
53
53
|
resources.concat(results)
|
|
54
54
|
when Hash
|
|
55
|
-
|
|
55
|
+
message = results['message']
|
|
56
|
+
|
|
57
|
+
if message.is_a?(Hash) || message.is_a?(Array) || message.to_s.match?(/404 Group|Project Not Found/)
|
|
56
58
|
raise_unexpected_response(results)
|
|
57
59
|
else
|
|
58
60
|
resources << results
|
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.1
|
|
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-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|