Skip to content
Snippets Groups Projects
Unverified Commit 65e68227 authored by Terri Chu's avatar Terri Chu Committed by GitLab
Browse files

Merge branch 'handle-config-file-bundler-lock-file-error' into 'master'

Handle Bundler::LockfileError in X-Ray when parsing Gemfile.lock

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169334



Merged-by: default avatarTerri Chu <tchu@gitlab.com>
Approved-by: default avatarTarun Vellishetty <tvellishetty@gitlab.com>
Approved-by: default avatarTerri Chu <tchu@gitlab.com>
Reviewed-by: default avatarDuo Code Reviewer <duo-code-review-bot@gitlab.com>
Co-authored-by: default avatarlma-git <lma@gitlab.com>
parents 125cbcaa 8a6f3e0c
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -29,6 +29,8 @@ def extract_libs
parser.specs.map do |spec|
Lib.new(name: spec.name, version: spec.version.to_s)
end
rescue Bundler::LockfileError => e
raise ParsingError, e.message.split("\n").first
end
end
end
Loading
Loading
Loading
Loading
@@ -33,6 +33,29 @@
 
it_behaves_like 'parsing an invalid dependency config file'
 
context 'when the content contains a merge conflict' do
it_behaves_like 'parsing an invalid dependency config file' do
let(:invalid_config_file_content) do
<<~CONTENT
GEM
remote: https://rubygems.org/
specs:
bcrypt (3.1.20)
logger (1.5.3)
<<<<<<< HEAD
=======
solargraph (1.2.3)
>>>>>>> 83d186c9a3ca327b4c1aea18936043ded82ceb2e
BUNDLED WITH
2.5.16
CONTENT
end
let(:expected_parsing_error_message) { 'Your Gemfile.lock contains merge conflicts.' }
end
end
describe '.matches?' do
using RSpec::Parameterized::TableSyntax
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment