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
end
def scan_line!(line)
result = line.scan(/^(.*)=(.*)$/).last
result = line.scan(/^(.*?)=(.*)$/).last
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
end
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
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
......
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