Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Gemfile.lock parsing for dependency parser #1689

Merged
merged 3 commits into from
Oct 21, 2022

Conversation

khasinski
Copy link
Collaborator

Dependency parsing for #1686

Uses Bundler gem for parsing, parses only name for now, we should probably extract URL for repos.

Description

Related Issue

Motivation and Context

An initial stub to get the dependency parsing running

How Has This Been Tested?

  • invalid file + a tiny Gemfile.lock, might need more testing

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Uses Bundler gem for parsing, parses only name for now,
we should probably extract URL for repos.
@khasinski khasinski force-pushed the dependency-parsing-ruby branch from 2c0e323 to 8cb3145 Compare October 5, 2022 18:25
Copy link
Member

@schneems schneems left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work. I asked a few questions and asked for some fairly minor changes. Slack me if you wanna chat about any of it.

test/dependency_parsers/ruby_parser_test.rb Outdated Show resolved Hide resolved
test/dependency_parsers/ruby_parser_test.rb Show resolved Hide resolved
test/dependency_parsers/ruby_parser_test.rb Outdated Show resolved Hide resolved
lib/dependency_parser/ruby/parse.rb Outdated Show resolved Hide resolved
def fetch_spec(name:, version: nil)
full_spec = fetcher.fetch_spec([name, version])
{ name: full_spec.name, url: extract_url(full_spec), description: full_spec.description }
rescue
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was there a class of error that triggered this specific rescue? I'm just curious. The other rescue looks like a "passed in the wrong file" kind of thing. I feel like we should capture this error too, but I'm not entirely sure what the failure modes that would trigger the rescue here are.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't found any. I can remove it, but it seems like it's better to log the failed spec instead of failing the entire file, we can at least get some log from it.

@schneems
Copy link
Member

Any updates? This was pretty close to over the line.

@khasinski
Copy link
Collaborator Author

Hey, I'll finish it up today

@khasinski khasinski force-pushed the dependency-parsing-ruby branch from 457706d to 6497be9 Compare October 20, 2022 15:23
@khasinski khasinski force-pushed the dependency-parsing-ruby branch from 6497be9 to f728e55 Compare October 20, 2022 15:25
@khasinski khasinski requested a review from schneems October 21, 2022 18:15
Copy link
Member

@schneems schneems left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@schneems schneems merged commit 386cef8 into codetriage:main Oct 21, 2022
@khasinski khasinski deleted the dependency-parsing-ruby branch October 21, 2022 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants