Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
66416af8
Commit
66416af8
authored
Aug 04, 2020
by
rossfuhrman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid writing empty stage variable
Avoid writing the stage variable if an empty string is passed in
parent
0a429cee
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
ee/lib/security/ci_configuration/sast_build_actions.rb
ee/lib/security/ci_configuration/sast_build_actions.rb
+1
-1
ee/spec/lib/security/ci_configuration/sast_build_actions_spec.rb
.../lib/security/ci_configuration/sast_build_actions_spec.rb
+6
-2
No files found.
ee/lib/security/ci_configuration/sast_build_actions.rb
View file @
66416af8
...
@@ -36,7 +36,7 @@ module Security
...
@@ -36,7 +36,7 @@ module Security
end
end
def
sast_stage
def
sast_stage
@params
[
'stage'
]
||
'test'
@params
[
'stage'
]
.
presence
?
@params
[
'stage'
]
:
'test'
end
end
# We only want to write variables that are set
# We only want to write variables that are set
...
...
ee/spec/lib/security/ci_configuration/sast_build_actions_spec.rb
View file @
66416af8
...
@@ -6,8 +6,12 @@ RSpec.describe Security::CiConfiguration::SastBuildActions do
...
@@ -6,8 +6,12 @@ RSpec.describe Security::CiConfiguration::SastBuildActions do
context
'autodevops disabled'
do
context
'autodevops disabled'
do
let
(
:auto_devops_enabled
)
{
false
}
let
(
:auto_devops_enabled
)
{
false
}
context
'with one empty parameter'
do
context
'with empty parameters'
do
let
(
:params
)
{
{
'SECURE_ANALYZERS_PREFIX'
=>
''
}
}
let
(
:params
)
do
{
'stage'
=>
''
,
'SECURE_ANALYZERS_PREFIX'
=>
''
,
'SEARCH_MAX_DEPTH'
=>
''
}
end
subject
(
:result
)
{
described_class
.
new
(
auto_devops_enabled
,
params
).
generate
}
subject
(
:result
)
{
described_class
.
new
(
auto_devops_enabled
,
params
).
generate
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment