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
805cc5d6
Commit
805cc5d6
authored
Aug 04, 2020
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix RegExp for dotenv report artifact
This commit fixes the regexp bug.
parent
b4a3ed33
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
6 deletions
+12
-6
app/services/ci/parse_dotenv_artifact_service.rb
app/services/ci/parse_dotenv_artifact_service.rb
+1
-1
changelogs/unreleased/fix-regexp-dotenv.yml
changelogs/unreleased/fix-regexp-dotenv.yml
+5
-0
spec/services/ci/parse_dotenv_artifact_service_spec.rb
spec/services/ci/parse_dotenv_artifact_service_spec.rb
+6
-5
No files found.
app/services/ci/parse_dotenv_artifact_service.rb
View file @
805cc5d6
...
...
@@ -54,7 +54,7 @@ module Ci
end
def
scan_line!
(
line
)
result
=
line
.
scan
(
/^(.*)=(.*)$/
).
last
result
=
line
.
scan
(
/^(.*
?
)=(.*)$/
).
last
raise
ParserError
,
'Invalid Format'
if
result
.
nil?
...
...
changelogs/unreleased/fix-regexp-dotenv.yml
0 → 100644
View file @
805cc5d6
---
title
:
Fix RegExp for dotenv report artifact
merge_request
:
38562
author
:
type
:
fixed
spec/services/ci/parse_dotenv_artifact_service_spec.rb
View file @
805cc5d6
...
...
@@ -66,12 +66,13 @@ RSpec.describe Ci::ParseDotenvArtifactService do
end
context
'when multiple key/value pairs exist in one line'
do
let
(
:blob
)
{
'KEY
1=VAR1KEY2=VAR1
'
}
let
(
:blob
)
{
'KEY
=VARCONTAINING=EQLS
'
}
it
'returns error'
do
expect
(
subject
[
:status
]).
to
eq
(
:error
)
expect
(
subject
[
:message
]).
to
eq
(
"Validation failed: Key can contain only letters, digits and '_'."
)
expect
(
subject
[
:http_status
]).
to
eq
(
:bad_request
)
it
'parses the dotenv data'
do
subject
expect
(
build
.
job_variables
.
as_json
).
to
contain_exactly
(
hash_including
(
'key'
=>
'KEY'
,
'value'
=>
'VARCONTAINING=EQLS'
))
end
end
...
...
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