From f9d5906a7d19306ee45d09f1dfb400007e5f1be2 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Fri, 17 Mar 2023 18:56:41 +0000 Subject: Add latest changes from gitlab-org/gitlab@15-9-stable-ee --- .gitlab/merge_request_templates/Stable Branch.md | 15 ++++++++++++++- spec/tooling/danger/stable_branch_spec.rb | 21 +++++++++++++++++++-- tooling/danger/stable_branch.rb | 2 +- 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/.gitlab/merge_request_templates/Stable Branch.md b/.gitlab/merge_request_templates/Stable Branch.md index 9f1408e06bc..2196af1a214 100644 --- a/.gitlab/merge_request_templates/Stable Branch.md +++ b/.gitlab/merge_request_templates/Stable Branch.md @@ -4,7 +4,7 @@ GitLab patch releases https://docs.gitlab.com/ee/policy/maintenance.html#patch-r If you're backporting a security fix, please refer to the security merge request template https://gitlab.com/gitlab-org/security/gitlab/blob/master/.gitlab/merge_request_templates/Security%20Release.md. -Security backport merge requests should not be opened on this project. +Security backport merge requests should not be opened on the GitLab canonical project. --> ## What does this MR do and why? @@ -17,6 +17,19 @@ This checklist encourages us to confirm any changes have been analyzed to reduce * [ ] This MR is backporting a bug fix, documentation update, or spec fix, previously merged in the default branch. * [ ] The original MR has been deployed to GitLab.com (not applicable for documentation or spec changes). +* [ ] This MR has a [severity label] assigned (if applicable). * [ ] Ensure the `e2e:package-and-test` job has either succeeded or been approved by a Software Engineer in Test. +#### Note to the merge request author and maintainer + +The process of backporting bug fixes into stable branches is tracked as part of an +[internal pilot]. If you have questions about this process, please: + +* Refer to the [internal pilot] issue for feedback or questions. +* Refer to the [patch release runbook for engineers and maintainers] for guidance. + +[severity label]: https://about.gitlab.com/handbook/engineering/quality/issue-triage/#severity +[internal pilot]: https://gitlab.com/gitlab-com/gl-infra/delivery/-/issues/2886 +[patch release runbook for engineers and maintainers]: https://gitlab.com/gitlab-org/release/docs/-/blob/master/general/patch/process_new.md + /assign me diff --git a/spec/tooling/danger/stable_branch_spec.rb b/spec/tooling/danger/stable_branch_spec.rb index 6b5c0b8cf27..4d86e066c20 100644 --- a/spec/tooling/danger/stable_branch_spec.rb +++ b/spec/tooling/danger/stable_branch_spec.rb @@ -177,20 +177,37 @@ RSpec.describe Tooling::Danger::StableBranch, feature_category: :delivery do it_behaves_like 'bypassing when flaky test or docs only' end - context 'when no package-and-test job is found' do + context 'when no package-and-test bridge is found' do let(:pipeline_bridges_response) { nil } it_behaves_like 'with a failure', described_class::NEEDS_PACKAGE_AND_TEST_MESSAGE it_behaves_like 'bypassing when flaky test or docs only' end - context 'when package-and-test job is being created' do + context 'when package-and-test bridge is created' do let(:pipeline_bridge_state) { 'created' } it_behaves_like 'with a warning', described_class::WARN_PACKAGE_AND_TEST_MESSAGE it_behaves_like 'bypassing when flaky test or docs only' end + context 'when package-and-test bridge has been canceled and no downstream pipeline is generated' do + let(:pipeline_bridge_state) { 'canceled' } + + let(:pipeline_bridges_response) do + [ + { + 'name' => 'e2e:package-and-test', + 'status' => pipeline_bridge_state, + 'downstream_pipeline' => nil + } + ] + end + + it_behaves_like 'with a failure', described_class::NEEDS_PACKAGE_AND_TEST_MESSAGE + it_behaves_like 'bypassing when flaky test or docs only' + end + context 'when package-and-test job is in a non-successful state' do let(:package_and_qa_state) { 'running' } diff --git a/tooling/danger/stable_branch.rb b/tooling/danger/stable_branch.rb index 65086c8485c..9b467146096 100644 --- a/tooling/danger/stable_branch.rb +++ b/tooling/danger/stable_branch.rb @@ -102,7 +102,7 @@ module Tooling if bridge['status'] == 'created' bridge['status'] else - bridge.fetch('downstream_pipeline').fetch('status') + bridge.fetch('downstream_pipeline')&.fetch('status') end end -- cgit v1.2.1