Commit db4ee8c5 authored by Stan Hu's avatar Stan Hu

Merge branch '325982-feature-flag-enable-ci_external_validation_service' into 'master'

Remove the feature flag for the external validation service [RUN ALL RSPEC] [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!61351
parents 9579f57a de79da2a
---
title: Remove the feature flag for the external validation service
merge_request: 61351
author:
type: other
---
name: ci_external_validation_service
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/56856
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/323935
milestone: '13.11'
type: development
group: group::continuous integration
default_enabled: false
......@@ -185,17 +185,3 @@ Watch a walkthrough of this feature in details in the video below.
<figure class="video-container">
<iframe src="https://www.youtube.com/embed/NmdWRGT8kZg" frameborder="0" allowfullscreen="true"> </iframe>
</figure>
## External pipeline validation service
The [external CI/CD pipeline validation service](../../administration/external_pipeline_validation.md)
is available for use on self-managed GitLab instances, but is not in use on GitLab.com.
It is configured with [environment variables](../../administration/environment_variables.md)
on the instance.
To enable the feature on GitLab.com, enable the `ci_external_validation_service`
[feature flag](../feature_flags/index.md). The valid "Not accepted" response code
for GitLab.com is `406` only.
For more details, see the linked issues and MRs in the
[feature flag rollout issue](https://gitlab.com/gitlab-org/gitlab/-/issues/325982).
......@@ -16,8 +16,6 @@ module Gitlab
GENERAL_REJECTED_STATUS = (400..499).freeze
def perform!
return unless enabled?
pipeline_authorized = validate_external
log_message = pipeline_authorized ? 'authorized' : 'not authorized'
......@@ -32,12 +30,6 @@ module Gitlab
private
def enabled?
return true unless Gitlab.com?
::Feature.enabled?(:ci_external_validation_service, project, default_enabled: :yaml)
end
def validate_external
return true unless validation_service_url
......
......@@ -199,37 +199,10 @@ RSpec.describe Gitlab::Ci::Pipeline::Chain::Validate::External do
end
end
context 'when the feature flag is disabled' do
before do
stub_feature_flags(ci_external_validation_service: false)
stub_request(:post, validation_service_url)
end
it 'does not drop the pipeline' do
perform!
expect(pipeline.status).not_to eq('failed')
expect(pipeline.errors).to be_empty
end
it 'does not break the chain' do
perform!
expect(step.break?).to be false
end
it 'does not make requests' do
perform!
expect(WebMock).not_to have_requested(:post, validation_service_url)
end
end
context 'when not on .com' do
let(:dot_com) { false }
before do
stub_feature_flags(ci_external_validation_service: false)
stub_request(:post, validation_service_url).to_return(status: 404, body: "{}")
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment