Commit e4512b6e authored by Ash McKenzie's avatar Ash McKenzie

Merge branch '270412-license-error-in-template' into 'master'

Show error when API Fuzzing feature not available

See merge request gitlab-org/gitlab!46064
parents dfbf56cc 85ad6897
---
title: Show error in pipeline when API Fuzzing not licensed
merge_request: 46064
author:
type: changed
......@@ -47,8 +47,8 @@ RSpec.describe 'API-Fuzzing.gitlab-ci.yml' do
create(:ci_variable, project: project, key: 'FUZZAPI_TARGET_URL', value: 'http://example.com')
end
it 'includes no jobs' do
expect { pipeline }.to raise_error(Ci::CreatePipelineService::CreateError)
it 'includes job to display error' do
expect(build_names).to match_array(%w[apifuzzer_fuzz_unlicensed])
end
end
......
......@@ -26,6 +26,17 @@ variables:
FUZZAPI_IMAGE: registry.gitlab.com/gitlab-org/security-products/analyzers/api-fuzzing:${FUZZAPI_VERSION}-engine
#
apifuzzer_fuzz_unlicensed:
stage: fuzz
allow_failure: true
rules:
- if: '$GITLAB_FEATURES !~ /\bapi_fuzzing\b/ && $API_FUZZING_DISABLED == null'
- when: never
script:
- |
echo "Error: Your GitLab project is not licensed for API Fuzzing."
- exit 1
apifuzzer_fuzz:
stage: fuzz
image:
......
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