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 Configuration#vendor_paths to replace Configuration#vendor_path #705

Merged
merged 3 commits into from
Oct 6, 2021

Conversation

imjoehaines
Copy link
Contributor

@imjoehaines imjoehaines commented Oct 5, 2021

Goal

This PR adds Configuration#vendor_paths to replace Configuration#vendor_path

vendor_paths is an array of strings which will mark a stack frame as out of project if the frame's file path starts with any of the strings, after removing the project root (if a file is outside of the project root, it wouldn't be marked as in project in the first place)

For example, with this stacktrace:

[
  "/foo/bar/app/models/user.rb:1:in `something'",
  "/foo/bar/abc/lib/ignore_me.rb:1:in `to_s'",
  "/foo/bar/xyz/lib/ignore_me.rb:1:in `to_s'",
]

and this configuration:

Bugsnag.configure do |config|
  config.project_root = "/foo/bar"
  config.vendor_paths = ["abc", "xyz"]
end

only /foo/bar/app/models/user.rb will be marked as in project, as the other paths are matched by vendor_paths

Note that matches are done on entire directories, for example abc does not match abc_xyz

Copy link
Contributor

@tomlongridge tomlongridge left a comment

Choose a reason for hiding this comment

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

LGTM - one suggested clarification on the comment-docs

@imjoehaines imjoehaines merged commit 008a332 into next Oct 6, 2021
@imjoehaines imjoehaines deleted the vendor-paths branch October 6, 2021 08:18
@imjoehaines imjoehaines mentioned this pull request Oct 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants