gitlab_quality-test_tooling 1.0.0 → 1.2.0

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: 989fdbc7beb98d23c28a6df0918b48db36962183f71e931d90c1ef70cb99b918
4
- data.tar.gz: 5edeaf64ee7042db858fdec5cd9a434a449f530abeef5a03eafbec873cabf0f4
3
+ metadata.gz: e05a68132442d20820791a87147d65bbd074dbaea120298b58139a60fefa63f9
4
+ data.tar.gz: f79996624aabd47398eef61a8eb216da3427c3c5e2e204bc951ac2710530527e
5
5
  SHA512:
6
- metadata.gz: 936dc55126b3e217b38a43cb7b5b6810bc01f6bbc74d8713414818422130a9158d779941a6f49c11a4ca7e290922cf8c53c19717d1164a0b55e9bc4ee1481aa9
7
- data.tar.gz: ebe5967dc286b06b72ed8efba01d3c713019e7e89c8b3bf30d26f6567832a4f939b0e4e15d39020acfa959352b3200a996562eb2b3bf43a40009ad6f4c96259b
6
+ metadata.gz: 1665a299d92b96ae41bc8f180f2eaa2d13e2a99c28b42eb61cc4ad5f3bdcdab65d657d5ed5219fd4d3b0f947a186fb02137dd36848bded57be2d6e99b035da42
7
+ data.tar.gz: 3a25b39e0d6e1dc1451e22686e3bdd9ed8db17df61abbe4e6054e15f32a74657630161097337c8f82d8e756e1746f63f98e988c827a9ace901356321bf1a24e1
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gitlab_quality-test_tooling (1.0.0)
5
- activesupport (>= 6.1, < 7.1)
4
+ gitlab_quality-test_tooling (1.2.0)
5
+ activesupport (>= 6.1, < 7.2)
6
6
  gitlab (~> 4.19)
7
7
  http (~> 5.0)
8
8
  nokogiri (~> 1.10)
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
@@ -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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module GitlabQuality
4
4
  module TestTooling
5
- VERSION = "1.0.0"
5
+ VERSION = "1.2.0"
6
6
  end
7
7
  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.0.0
4
+ version: 1.2.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-13 00:00:00.000000000 Z
11
+ date: 2023-10-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: climate_control
@@ -187,7 +187,7 @@ dependencies:
187
187
  version: '6.1'
188
188
  - - "<"
189
189
  - !ruby/object:Gem::Version
190
- version: '7.1'
190
+ version: '7.2'
191
191
  type: :runtime
192
192
  prerelease: false
193
193
  version_requirements: !ruby/object:Gem::Requirement
@@ -197,7 +197,7 @@ dependencies:
197
197
  version: '6.1'
198
198
  - - "<"
199
199
  - !ruby/object:Gem::Version
200
- version: '7.1'
200
+ version: '7.2'
201
201
  - !ruby/object:Gem::Dependency
202
202
  name: gitlab
203
203
  requirement: !ruby/object:Gem::Requirement