Commit c13e8bec authored by Igor Drozdov's avatar Igor Drozdov

Merge branch 'fix-regexp-dotenv' into 'master'

Fix RegExp for dotenv report artifact

See merge request gitlab-org/gitlab!38562
parents 27a9cc6d 805cc5d6
...@@ -54,7 +54,7 @@ module Ci ...@@ -54,7 +54,7 @@ module Ci
end end
def scan_line!(line) def scan_line!(line)
result = line.scan(/^(.*)=(.*)$/).last result = line.scan(/^(.*?)=(.*)$/).last
raise ParserError, 'Invalid Format' if result.nil? raise ParserError, 'Invalid Format' if result.nil?
......
---
title: Fix RegExp for dotenv report artifact
merge_request: 38562
author:
type: fixed
...@@ -66,12 +66,13 @@ RSpec.describe Ci::ParseDotenvArtifactService do ...@@ -66,12 +66,13 @@ RSpec.describe Ci::ParseDotenvArtifactService do
end end
context 'when multiple key/value pairs exist in one line' do context 'when multiple key/value pairs exist in one line' do
let(:blob) { 'KEY1=VAR1KEY2=VAR1' } let(:blob) { 'KEY=VARCONTAINING=EQLS' }
it 'returns error' do it 'parses the dotenv data' do
expect(subject[:status]).to eq(:error) subject
expect(subject[:message]).to eq("Validation failed: Key can contain only letters, digits and '_'.")
expect(subject[:http_status]).to eq(:bad_request) expect(build.job_variables.as_json).to contain_exactly(
hash_including('key' => 'KEY', 'value' => 'VARCONTAINING=EQLS'))
end end
end 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