gitlab-qa 6.13.0 → 6.15.3

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: '0692b909c3bf06d12d5f0846dc3296b93755d0c58c5969a71773e9664b298a8c'
4
- data.tar.gz: 3aac312bb7b6dd2244d92b9bbf9ce1ecf561c65caae723abca625b155c00cfa4
3
+ metadata.gz: c3d066c13bb7ff790bdfc0e7ed6f6cbe70f65c9ecfe2400c3c804c8fc91e6db1
4
+ data.tar.gz: 85e35e3017cac986d7ccec3927e1f3543164443e2806803e4020830dfe0eebb1
5
5
  SHA512:
6
- metadata.gz: 05c3a6b9ad1eec8d6adf2892ae3b90568bbfebc7f7def626126ae2b14da9be902b71edd8d45a7c98a3cb89b596fa6cee6b352da159f7e3ae1ca2daf8b37dc176
7
- data.tar.gz: 4554af9b7849516651be2e5f32f4fd5d57690b4af2787292d4b18e6a8838fad92201a9d101edcbc9c2391327322fdaca96a37393fe6ea1a3111f734be7934d2f
6
+ metadata.gz: 2c4e9dffbbaff6dd23ee878b3601e6d3cfa13cb2928f5f360abeba0b75ec1841d45050fbd220c41960690c620da742c48862110857667c3c99566ed62aa80249
7
+ data.tar.gz: 8658c0b57a0693c335e515b07770b5bff1938fc307be9ad971724713a90b101cd9c1ec7b7c7b5527c9b5cc2c9d594a88ba88fcf6f5b4502801a243e7f754142c
@@ -1,8 +1,8 @@
1
1
  stages:
2
2
  - check
3
- - release
4
3
  - test
5
4
  - report
5
+ - deploy
6
6
  - notify
7
7
 
8
8
  default:
@@ -35,13 +35,6 @@ workflow:
35
35
  # For triggers from GitLab MR pipelines (and pipelines from other projects), create a pipeline
36
36
  - if: '$CI_PIPELINE_SOURCE == "pipeline"'
37
37
 
38
- .default-rules:
39
- rules:
40
- - if: '$CI_COMMIT_TAG || $RELEASE'
41
- when: never
42
- - if: '$RELEASE == null && $CI_JOB_NAME =~ /staging/'
43
- when: manual
44
-
45
38
  variables:
46
39
  DOCKER_DRIVER: overlay2
47
40
  DOCKER_HOST: tcp://docker:2375
@@ -65,21 +58,6 @@ rubocop:
65
58
  rspec:
66
59
  extends: .check-base
67
60
 
68
- release:
69
- stage: release
70
- rules:
71
- - if: '$CI_COMMIT_TAG'
72
- script:
73
- - gem update --system
74
- - ruby --version
75
- - gem env version
76
- - gem build gitlab-qa.gemspec
77
- - gem push gitlab-qa*.gem
78
- artifacts:
79
- paths:
80
- - gitlab-qa*.gem
81
- expire_in: 30 days
82
-
83
61
  .test:
84
62
  stage: test
85
63
  services:
@@ -107,6 +85,10 @@ release:
107
85
  variables:
108
86
  DEFAULT_RELEASE: "CE"
109
87
  rules:
88
+ # Don't run E2E jobs on release pipelines
89
+ - if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_PATH == "gitlab-org/gitlab-qa" && $RELEASE == null'
90
+ changes: ["lib/**/version.rb"]
91
+ when: never
110
92
  - if: '$CI_COMMIT_TAG || $RELEASE =~ /gitlab-ee/'
111
93
  when: never
112
94
  - if: '$RELEASE == null && $CI_JOB_NAME =~ /quarantine|custom/'
@@ -121,6 +103,10 @@ release:
121
103
  variables:
122
104
  DEFAULT_RELEASE: "EE"
123
105
  rules:
106
+ # Don't run E2E jobs on release pipelines
107
+ - if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_PATH == "gitlab-org/gitlab-qa" && $RELEASE == null'
108
+ changes: ["lib/**/version.rb"]
109
+ when: never
124
110
  - if: '$CI_COMMIT_TAG || $RELEASE =~ /gitlab-ce/'
125
111
  when: never
126
112
  - if: '$RELEASE == null && $CI_JOB_NAME =~ /quarantine|custom/'
@@ -132,7 +118,15 @@ release:
132
118
  - if: '$RELEASE == null || $RELEASE =~ /gitlab-ee/ || $CI_MERGE_REQUEST_ID || $CI_COMMIT_REF_NAME == "master"'
133
119
 
134
120
  .only-qa:
135
- extends: .default-rules
121
+ rules:
122
+ # Don't run E2E jobs on release pipelines
123
+ - if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_PATH == "gitlab-org/gitlab-qa" && $RELEASE == null'
124
+ changes: ["lib/**/version.rb"]
125
+ when: never
126
+ - if: '$CI_COMMIT_TAG || $RELEASE'
127
+ when: never
128
+ - if: '$RELEASE == null && $CI_JOB_NAME =~ /staging/'
129
+ when: manual
136
130
 
137
131
  .high-capacity:
138
132
  tags:
@@ -474,7 +468,6 @@ ee:mattermost-quarantine:
474
468
  ee:geo:
475
469
  extends:
476
470
  - .test
477
- - .high-capacity
478
471
  - .ee-qa
479
472
  - .rspec-report-opts
480
473
  variables:
@@ -483,7 +476,6 @@ ee:geo:
483
476
  ee:geo-quarantine:
484
477
  extends:
485
478
  - .test
486
- - .high-capacity
487
479
  - .ee-qa
488
480
  - .quarantine
489
481
  - .rspec-report-opts
@@ -1012,3 +1004,7 @@ notify_slack:
1012
1004
  - echo "CI_PIPELINE_URL is $CI_PIPELINE_URL"
1013
1005
  - echo "TOP_UPSTREAM_SOURCE_JOB is $TOP_UPSTREAM_SOURCE_JOB"
1014
1006
  - 'bin/slack $NOTIFY_CHANNEL "☠️ QA against $RELEASE failed! ☠️ See the test session report: $(cat REPORT_ISSUE_URL), and pipeline: $CI_PIPELINE_URL (triggered from $TOP_UPSTREAM_SOURCE_JOB)" ci_failing'
1007
+
1008
+ include:
1009
+ - project: 'gitlab-org/quality/pipeline-common'
1010
+ file: '/ci/gem-release.yml'
@@ -30,6 +30,6 @@ with the latest commit from https://gitlab.com/gitlab-org/gitlab-qa/commits/mast
30
30
  - [ ] Release notes are accurate.
31
31
 
32
32
  - Checklist after merging:
33
- - [ ] [Create a tag for the new release version](docs/release_process.md#how-to).
33
+ - [ ] [Update the release notes for the newly created tag](docs/release_process.md#how-to).
34
34
 
35
35
  /label ~Quality ~"feature::maintenance"
@@ -24,12 +24,13 @@ when we make a change - no matter the size of the change.
24
24
  - If not, update [`lib/gitlab/qa/version.rb`] to an appropriate [semantic version](https://semver.org) in a new merge request using the [release template](https://gitlab.com/gitlab-org/gitlab-qa/blob/master/.gitlab/merge_request_templates/Release.md)
25
25
  and title the MR like `"Bump version to <version>"`.
26
26
  - Merge the merge request.
27
- - Create a new tag via the UI (https://gitlab.com/gitlab-org/gitlab-qa/-/tags/new).
28
- * **Tag name**: The same version found in [`lib/gitlab/qa/version.rb`], prefixed with `v`, e.g. if the version is `4.7.1`, the tag would be `v4.7.1`.
29
- * **Message**: Set it to "Version x.y.z", e.g. if the version is `4.7.1`, the message would be "Version 4.7.1".
27
+ - The new version should automatically be tagged and pushed to Rubygems by the `gem-release` job in the merge commit pipeline.
28
+ - Update the release notes for the newly created tag (https://gitlab.com/gitlab-org/gitlab-qa/-/tags):
30
29
  * **Release notes**: Copy the release notes from the merge request.
31
- * Click *Create Tag*.
32
-
33
- GitLab will then start a pipeline for this new tag, and the `release` job will build and push the new version of `gitlab-qa` to RubyGems.
30
+
31
+ Note: The `gem-release` job uses:
32
+
33
+ - the `GITLAB_API_TOKEN` environment variable to authenticate against GitLab.com's API in order to create the tag
34
+ - the `GEM_HOST_API_KEY` environment variable to authenticate against Rubygems.org's API in order to release the gem
34
35
 
35
36
  [`lib/gitlab/qa/version.rb`]: https://gitlab.com/gitlab-org/gitlab-qa/blob/master/lib/gitlab/qa/version.rb#L3
@@ -17,9 +17,9 @@ module Gitlab
17
17
  end
18
18
 
19
19
  issue = gitlab.create_issue(
20
- title: "Test session report | #{Runtime::Env.deploy_environment}",
20
+ title: "Test session report | #{pipeline}",
21
21
  description: generate_description(tests),
22
- labels: ['Quality', 'QA', 'triage report', deploy_environment_label]
22
+ labels: ['Quality', 'QA', 'triage report', pipeline_name_label]
23
23
  )
24
24
 
25
25
  File.write('REPORT_ISSUE_URL', issue.web_url)
@@ -27,20 +27,19 @@ module Gitlab
27
27
  # rubocop:enable Metrics/AbcSize
28
28
 
29
29
  def generate_description(tests)
30
- <<~MARKDOWN
30
+ <<~MARKDOWN.rstrip
31
31
  ## Session summary
32
32
 
33
33
  * Deploy version: #{Runtime::Env.deploy_version}
34
- * Pipeline: [#{Runtime::Env.ci_pipeline_id}](#{Runtime::Env.ci_pipeline_url})
34
+ * Deploy environment: #{Runtime::Env.deploy_environment}
35
+ * Pipeline: #{Runtime::Env.pipeline_from_project_name} [#{Runtime::Env.ci_pipeline_id}](#{Runtime::Env.ci_pipeline_url})
35
36
  #{generate_summary(tests: tests)}
36
37
 
37
38
  #{generate_failed_jobs_listing}
38
39
 
39
40
  #{generate_stages_listing(tests)}
40
41
 
41
- ## Release QA issue
42
-
43
- * #{Runtime::Env.qa_issue_url}
42
+ #{generate_qa_issue_relation}
44
43
  MARKDOWN
45
44
  end
46
45
 
@@ -60,24 +59,30 @@ module Gitlab
60
59
  end
61
60
 
62
61
  def generate_failed_jobs_listing
62
+ failed_jobs = []
63
+
64
+ client = Gitlab.client(
65
+ endpoint: Runtime::Env.ci_api_v4_url,
66
+ private_token: Runtime::Env.gitlab_ci_api_token)
67
+
63
68
  gitlab.handle_gitlab_client_exceptions do
64
- failed_jobs = Gitlab.pipeline_jobs(
69
+ failed_jobs = client.pipeline_jobs(
65
70
  Runtime::Env.ci_project_id,
66
71
  Runtime::Env.ci_pipeline_id,
67
72
  scope: 'failed')
73
+ end
68
74
 
69
- listings = failed_jobs.map do |job|
70
- allowed_to_fail = ' (allowed to fail)' if job.allow_failure
75
+ listings = failed_jobs.map do |job|
76
+ allowed_to_fail = ' (allowed to fail)' if job.allow_failure
71
77
 
72
- "* [#{job.name}](#{job.web_url})#{allowed_to_fail}"
73
- end.join("\n")
78
+ "* [#{job.name}](#{job.web_url})#{allowed_to_fail}"
79
+ end.join("\n")
74
80
 
75
- <<~MARKDOWN.chomp if failed_jobs.any?
76
- ## Failed jobs
81
+ <<~MARKDOWN.chomp if failed_jobs.any?
82
+ ## Failed jobs
77
83
 
78
- #{listings}
79
- MARKDOWN
80
- end
84
+ #{listings}
85
+ MARKDOWN
81
86
  end
82
87
 
83
88
  def generate_stages_listing(tests)
@@ -222,6 +227,18 @@ module Gitlab
222
227
  '-'
223
228
  end
224
229
  end
230
+
231
+ def generate_qa_issue_relation
232
+ return unless Runtime::Env.qa_issue_url
233
+
234
+ <<~MARKDOWN.chomp
235
+ ## Release QA issue
236
+
237
+ * #{Runtime::Env.qa_issue_url}
238
+
239
+ /relate #{Runtime::Env.qa_issue_url}
240
+ MARKDOWN
241
+ end
225
242
  end
226
243
  end
227
244
  end
@@ -34,7 +34,10 @@ module Gitlab
34
34
  # /qa/specs/features/ee/api/<stage>
35
35
  # /qa/specs/features/ee/browser_ui/<stage>
36
36
  # For now we assume the Stage is whatever follows api/ or browser_ui/
37
- stage = strip_number_prefix(test['file'].match(%r{(api|browser_ui)/([a-z0-9_]+)}i)[2])
37
+ test_path_match = test['file'].match(%r{(api|browser_ui)/([a-z0-9_]+)}i)
38
+ next unless test_path_match
39
+
40
+ stage = strip_number_prefix(test_path_match[2])
38
41
  testcases[stage] = [] unless testcases.key?(stage)
39
42
  testcases[stage] << test
40
43
  end
@@ -142,7 +142,7 @@ module Gitlab
142
142
  end
143
143
 
144
144
  def up_to_date_labels(test:, issue: nil)
145
- super << deploy_environment_label
145
+ super << pipeline_name_label
146
146
  end
147
147
 
148
148
  def post_failed_job_note(issue, test)
@@ -104,20 +104,18 @@ module Gitlab
104
104
  labels
105
105
  end
106
106
 
107
- def deploy_environment_label
108
- environment = Runtime::Env.deploy_environment
109
-
110
- case environment
107
+ def pipeline_name_label
108
+ case pipeline
111
109
  when 'production'
112
110
  'found:gitlab.com'
113
111
  when 'canary', 'staging'
114
- "found:#{environment}.gitlab.com"
112
+ "found:#{pipeline}.gitlab.com"
115
113
  when 'preprod'
116
114
  'found:pre.gitlab.com'
117
115
  when 'staging-orchestrated', 'nightly', 'master'
118
- "found:#{environment}"
116
+ "found:#{pipeline}"
119
117
  else
120
- raise "No `found:*` label for the `#{environment}` environment!"
118
+ raise "No `found:*` label for the `#{pipeline}` pipeline!"
121
119
  end
122
120
  end
123
121
 
@@ -116,6 +116,14 @@ module Gitlab
116
116
  ENV['GITLAB_BOT_MULTI_PROJECT_PIPELINE_POLLING_TOKEN']
117
117
  end
118
118
 
119
+ def gitlab_ci_api_token
120
+ ENV['GITLAB_CI_API_TOKEN']
121
+ end
122
+
123
+ def ci_api_v4_url
124
+ ENV['CI_API_V4_URL']
125
+ end
126
+
119
127
  def ci_job_name
120
128
  ENV['CI_JOB_NAME']
121
129
  end
@@ -1,5 +1,5 @@
1
1
  module Gitlab
2
2
  module QA
3
- VERSION = '6.13.0'.freeze
3
+ VERSION = '6.15.3'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab-qa
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.13.0
4
+ version: 6.15.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Grzegorz Bizon
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-11-29 00:00:00.000000000 Z
11
+ date: 2020-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: climate_control