gitlab_quality-test_tooling 1.0.0 → 1.1.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 +3 -0
- data/exe/relate-failure-issue +4 -0
- data/lib/gitlab_quality/test_tooling/gitlab_issue_client.rb +3 -2
- data/lib/gitlab_quality/test_tooling/report/merge_request_slow_tests_report.rb +5 -0
- data/lib/gitlab_quality/test_tooling/report/report_as_issue.rb +7 -3
- data/lib/gitlab_quality/test_tooling/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: 57cea55a73290299387eff651dac61af423656f7404afb4bd954d08d6f5d71f1
|
4
|
+
data.tar.gz: 4ef22d91d38fa5f85fe71d022e5a77a6081b4c9d536310e1f37d614d1b672d81
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be4e9f1eea90fa1407058e8fe9cc1bf7dc02e86d9cbe4c3d69a30919e989505fe6ef882abdfdc6a29a3c5a0dbdfb61588c1e359fa800366f38e8f67355230a8f
|
7
|
+
data.tar.gz: 36419f06e594ff1d9c39b307d3868d1265bf4cbd68cfbc3e2ea991b594958b8d1e7280380e44526beaf4866376e8493722e2f564744c874824ce783f15b83b24
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -85,6 +85,9 @@ Usage: exe/relate-failure-issue [options]
|
|
85
85
|
-t, --token TOKEN A valid access token with `api` scope and Maintainer permission in PROJECT
|
86
86
|
--system-log-files SYSTEM_LOG_FILES
|
87
87
|
Include errors from system logs in failure issues
|
88
|
+
--base-issue-labels BASE_ISSUE_LABELS
|
89
|
+
Labels to add to new failure issues
|
90
|
+
--confidential Makes created new issues confidential
|
88
91
|
--dry-run Perform a dry-run (don't create or update issues)
|
89
92
|
-v, --version Show the version
|
90
93
|
-h, --help Show the usage
|
data/exe/relate-failure-issue
CHANGED
@@ -37,6 +37,10 @@ options = OptionParser.new do |opts|
|
|
37
37
|
params[:base_issue_labels] = base_issue_labels.split(',')
|
38
38
|
end
|
39
39
|
|
40
|
+
opts.on('--confidential', "Makes created new issues confidential") do
|
41
|
+
params[:confidential] = true
|
42
|
+
end
|
43
|
+
|
40
44
|
opts.on('--dry-run', "Perform a dry-run (don't create or update issues)") do
|
41
45
|
params[:dry_run] = true
|
42
46
|
end
|
@@ -61,13 +61,14 @@ module GitlabQuality
|
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
64
|
-
def create_issue(title:, description:, labels:, issue_type: 'issue', assignee_id: nil, due_date: nil)
|
64
|
+
def create_issue(title:, description:, labels:, issue_type: 'issue', assignee_id: nil, due_date: nil, confidential: false)
|
65
65
|
attrs = {
|
66
66
|
issue_type: issue_type,
|
67
67
|
description: description,
|
68
68
|
labels: labels,
|
69
69
|
assignee_id: assignee_id,
|
70
|
-
due_date: due_date
|
70
|
+
due_date: due_date,
|
71
|
+
confidential: confidential
|
71
72
|
}.compact
|
72
73
|
|
73
74
|
handle_gitlab_client_exceptions do
|
@@ -6,6 +6,8 @@ module GitlabQuality
|
|
6
6
|
class MergeRequestSlowTestsReport
|
7
7
|
SLOW_TEST_MESSAGE = '<!-- slow-test -->'
|
8
8
|
SLOW_TEST_LABEL = '/label ~"rspec:slow test detected"'
|
9
|
+
SLOW_TEST_NOTE_SOURCE_CODE = 'Generated by [`gitlab_quality-test_tooling`](https://gitlab.com/gitlab-org/ruby/gems/gitlab_quality-test_tooling/-/blob/main/lib/gitlab_quality/test_tooling/report/merge_request_slow_tests_report.rb).'
|
10
|
+
SLOW_TEST_NOTE_FEEDBACK = 'Please [share your feedback and suggestions](https://gitlab.com/gitlab-org/quality/engineering-productivity/team/-/issues/289).'
|
9
11
|
|
10
12
|
def initialize(token:, input_files:, merge_request_iid:, project: nil, dry_run: false, **_kwargs)
|
11
13
|
@project = project
|
@@ -61,6 +63,9 @@ module GitlabQuality
|
|
61
63
|
[
|
62
64
|
SLOW_TEST_MESSAGE,
|
63
65
|
SLOW_TEST_LABEL,
|
66
|
+
":tools: #{SLOW_TEST_NOTE_SOURCE_CODE}\n",
|
67
|
+
":recycle: #{SLOW_TEST_NOTE_FEEDBACK}\n",
|
68
|
+
"---\n",
|
64
69
|
':snail: Slow tests detected in this merge request, might be related with changed RSpec files.',
|
65
70
|
'| Job | File | Name | Duration | Expected duration |',
|
66
71
|
'| --- | --- | --- | --- | --- |'
|
@@ -8,10 +8,11 @@ module GitlabQuality
|
|
8
8
|
class ReportAsIssue
|
9
9
|
include Concerns::Utils
|
10
10
|
|
11
|
-
def initialize(token:, input_files:, project: nil, dry_run: false, **_kwargs)
|
11
|
+
def initialize(token:, input_files:, project: nil, confidential: false, dry_run: false, **_kwargs)
|
12
12
|
@project = project
|
13
13
|
@gitlab = (dry_run ? GitlabIssueDryClient : GitlabIssueClient).new(token: token, project: project)
|
14
14
|
@files = Array(input_files)
|
15
|
+
@confidential = confidential
|
15
16
|
end
|
16
17
|
|
17
18
|
def invoke!
|
@@ -22,7 +23,7 @@ module GitlabQuality
|
|
22
23
|
|
23
24
|
private
|
24
25
|
|
25
|
-
attr_reader :gitlab, :files, :project, :issue_type
|
26
|
+
attr_reader :gitlab, :files, :project, :issue_type, :confidential
|
26
27
|
|
27
28
|
def run!
|
28
29
|
raise NotImplementedError
|
@@ -85,7 +86,8 @@ module GitlabQuality
|
|
85
86
|
labels: new_issue_labels(test).to_a,
|
86
87
|
issue_type: issue_type,
|
87
88
|
assignee_id: new_issue_assignee_id(test),
|
88
|
-
due_date: new_issue_due_date(test)
|
89
|
+
due_date: new_issue_due_date(test),
|
90
|
+
confidential: confidential
|
89
91
|
}.compact
|
90
92
|
issue = gitlab.create_issue(**attrs)
|
91
93
|
|
@@ -142,6 +144,8 @@ module GitlabQuality
|
|
142
144
|
'found:pre.gitlab.com'
|
143
145
|
when 'nightly', Runtime::Env.default_branch, 'staging-ref', 'release'
|
144
146
|
"found:#{pipeline}"
|
147
|
+
when 'customers-gitlab-com'
|
148
|
+
'found:customers.stg.gitlab.com'
|
145
149
|
else
|
146
150
|
raise "No `found:*` label for the `#{pipeline}` pipeline!"
|
147
151
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitlab_quality-test_tooling
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GitLab Quality
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-09-
|
11
|
+
date: 2023-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: climate_control
|