Allow using the bugsnag-php options for setting the project root and strip path as regexes, rather than just strings
This adds two new options, project_root_regex and strip_path_regex, which can be used instead of the existing project_root and strip_path options to allow setting them as regexes, as introduced in https://github.com/bugsnag/bugsnag-php/pull/514
Some of the existing path resolution code was leading to incorrect project root and strip path values being set, for example:
when a strip path value is configured, we only set the project root path if one wasn't provided. If both strip path and project root are given, no project root is set
when only strip path is configured, we set the strip path and then immediately overwrite it with a new path with "/app" appended by calling setProjectRoot.
These issues have been fixed in this branch
Goal
Allow using the bugsnag-php options for setting the project root and strip path as regexes, rather than just strings
This adds two new options,
project_root_regex
andstrip_path_regex
, which can be used instead of the existingproject_root
andstrip_path
options to allow setting them as regexes, as introduced in https://github.com/bugsnag/bugsnag-php/pull/514This is a continuation of https://github.com/bugsnag/bugsnag-laravel/pull/348
Changeset
Added
These take presendence over the existing
project_root
andstrip_path
options if they are also providedChanged
setProjectRoot
. These issues have been fixed in this branchTests
More unit tests have been added, building off of https://github.com/bugsnag/bugsnag-laravel/pull/395
Discussion
Alternative Approaches
Outstanding Questions
Linked issues
Related to bugsnag/bugsnag-php#514 Related to #348
Review
For the submitter, initial self-review:
For the pull request reviewer(s), this changeset has been reviewed for: