Commit 6f6aaaa5 authored by Vitaly Slobodin's avatar Vitaly Slobodin

Merge branch '324777-dast-scan-blank-project' into 'master'

Can't run DAST scan without repository

See merge request gitlab-org/gitlab!57584
parents 0f43cd47 675ad51f
...@@ -437,8 +437,17 @@ export default { ...@@ -437,8 +437,17 @@ export default {
:translations="{ :translations="{
dropdownHeader: __('Select a branch'), dropdownHeader: __('Select a branch'),
searchPlaceholder: __('Search'), searchPlaceholder: __('Search'),
noRefSelected: __('No available branches'),
noResults: __('No available branches'),
}" }"
/> />
<div v-if="!defaultBranch" class="gl-text-red-500 gl-mt-3">
{{
s__(
'OnDemandScans|You must create a repository within your project to run an on-demand scan.',
)
}}
</div>
</gl-form-group> </gl-form-group>
<scanner-profile-selector <scanner-profile-selector
......
---
title: Call out the inability to run on-demand scans without a repository being created
merge_request: 57584
author:
type: changed
...@@ -630,6 +630,26 @@ describe('OnDemandScansForm', () => { ...@@ -630,6 +630,26 @@ describe('OnDemandScansForm', () => {
}); });
}); });
describe('when no repository exists', () => {
beforeEach(() => {
mountShallowSubject({
propsData: {
/**
* The assumption here is that, if a default branch is not defined, then the project
* does not have a repository.
*/
defaultBranch: '',
},
});
});
it('shows an error message', () => {
expect(subject.text()).toContain(
'You must create a repository within your project to run an on-demand scan.',
);
});
});
describe('dastBranchSelection feature flag disabled', () => { describe('dastBranchSelection feature flag disabled', () => {
describe.each` describe.each`
action | actionFunction | runAfter action | actionFunction | runAfter
......
...@@ -20746,6 +20746,9 @@ msgstr "" ...@@ -20746,6 +20746,9 @@ msgstr ""
msgid "No authentication methods configured." msgid "No authentication methods configured."
msgstr "" msgstr ""
msgid "No available branches"
msgstr ""
msgid "No available groups to fork the project." msgid "No available groups to fork the project."
msgstr "" msgstr ""
...@@ -21537,6 +21540,9 @@ msgstr "" ...@@ -21537,6 +21540,9 @@ msgstr ""
msgid "OnDemandScans|You cannot run an active scan against an unvalidated site." msgid "OnDemandScans|You cannot run an active scan against an unvalidated site."
msgstr "" msgstr ""
msgid "OnDemandScans|You must create a repository within your project to run an on-demand scan."
msgstr ""
msgid "Once a project is permanently deleted, it %{strongStart}cannot be recovered%{strongEnd}. Permanently deleting this project will %{strongStart}immediately delete%{strongEnd} its repositories and %{strongStart}all related resources%{strongEnd}, including issues, merge requests etc." msgid "Once a project is permanently deleted, it %{strongStart}cannot be recovered%{strongEnd}. Permanently deleting this project will %{strongStart}immediately delete%{strongEnd} its repositories and %{strongStart}all related resources%{strongEnd}, including issues, merge requests etc."
msgstr "" msgstr ""
......
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