diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-23 00:05:37 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-23 00:05:37 +0000 |
commit | d4ba3c22bf2b63e606f87cf87082b7a9aa5e8581 (patch) | |
tree | aa0ff4e7bbdab7928ec2c5dbb0d1f4942f79d07f | |
parent | 35e8cb2c277cc0b691189a1e23900b1921b9acb3 (diff) | |
download | gitlab-ce-d4ba3c22bf2b63e606f87cf87082b7a9aa5e8581.tar.gz |
Add latest changes from gitlab-org/gitlab@15-7-stable-ee
-rw-r--r-- | spec/tooling/danger/stable_branch_spec.rb | 16 | ||||
-rw-r--r-- | tooling/danger/stable_branch.rb | 8 |
2 files changed, 14 insertions, 10 deletions
diff --git a/spec/tooling/danger/stable_branch_spec.rb b/spec/tooling/danger/stable_branch_spec.rb index 08fd25b30e0..677e190b584 100644 --- a/spec/tooling/danger/stable_branch_spec.rb +++ b/spec/tooling/danger/stable_branch_spec.rb @@ -34,6 +34,14 @@ RSpec.describe Tooling::Danger::StableBranch, feature_category: :delivery do end end + shared_examples 'with a warning' do |failure_message| + it 'fails' do + expect(stable_branch).to receive(:warn).with(failure_message) + + subject + end + end + context 'when not applicable' do where(:stable_branch?, :security_mr?) do true | true @@ -103,17 +111,13 @@ RSpec.describe Tooling::Danger::StableBranch, feature_category: :delivery do context 'when not an applicable version' do let(:target_branch) { '14-9-stable-ee' } - it_behaves_like 'with a failure', described_class::VERSION_ERROR_MESSAGE + it_behaves_like 'with a warning', described_class::VERSION_WARNING_MESSAGE end context 'when the version API request fails' do let(:response_success) { false } - it 'adds a warning' do - expect(stable_branch).to receive(:warn).with(described_class::FAILED_VERSION_REQUEST_MESSAGE) - - subject - end + it_behaves_like 'with a warning', described_class::FAILED_VERSION_REQUEST_MESSAGE end context 'when more than one page of versions is needed' do diff --git a/tooling/danger/stable_branch.rb b/tooling/danger/stable_branch.rb index 6c0b94b4f06..83e8b0a7a9d 100644 --- a/tooling/danger/stable_branch.rb +++ b/tooling/danger/stable_branch.rb @@ -32,8 +32,8 @@ module Tooling This branch is meant for backporting bug fixes. If this MR qualifies please add the `type::bug` label. #{MAINTENANCE_POLICY_MESSAGE} MSG - VERSION_ERROR_MESSAGE = <<~MSG - Patches are only being accepted on the most recent 3 minor versions of GitLab. #{MAINTENANCE_POLICY_MESSAGE} + VERSION_WARNING_MESSAGE = <<~MSG + Backporting to older releases requires an [exception request process](https://docs.gitlab.com/ee/policy/maintenance.html#backporting-to-older-releases) MSG FAILED_VERSION_REQUEST_MESSAGE = <<~MSG @@ -46,7 +46,8 @@ module Tooling fail FEATURE_ERROR_MESSAGE if has_feature_label? fail BUG_ERROR_MESSAGE unless has_bug_label? - fail VERSION_ERROR_MESSAGE unless targeting_patchable_version? + + warn VERSION_WARNING_MESSAGE unless targeting_patchable_version? end # rubocop:enable Style/SignalException @@ -69,7 +70,6 @@ module Tooling last_three_minor_versions.include?(targeted_version) rescue VersionApiError - # don't fail the job since we do not know the recent versions warn FAILED_VERSION_REQUEST_MESSAGE true end |