Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Generalize the gem backtrace exclusion. #87

Merged
merged 1 commit into from
Jun 26, 2014

Conversation

cupakromer
Copy link
Member

Previous regex matcher let gems slip through if a custom path was
provided to bundler (e.g. bundle install --path ../bundle). Remove any
explicit path dependencies on potential ruby version based directory
names.

@JonRowe
Copy link
Member

JonRowe commented Jun 25, 2014

This is just for our gems right? If so LGTM.

@@ -25,7 +25,7 @@ def ==(other)
# To work around JRuby error:
# TypeError: $stderr must have write method, RSpec::StdErrSplitter given
def write(line)
if line !~ /^\S+gems\/ruby\-\S+:\d+: warning:/
if line !~ %r{^\S+/gems/\S+:\d+: warning:}
Copy link
Member

Choose a reason for hiding this comment

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

So it looks like previously ruby was in the path but it's not any more? That makes it look like there will be paths that were matched before that won't be now. Can this be made to support both?

Also, for regexes like this, I'm a big fan of using rubular to create a permalink with an example that I embed in a comment. Example:

if line !~ %r{^\S+/gems/\S+:\d+: warning:} # http://rubular.com/r/cWWgOu3WTJ
  # ...
end

Makes it easy to see what cases you were thinking of when you wrote the regex for later when you come back to it.

Previous regex matcher let gems slip through if a custom path was
provided to bundler (e.g. `bundle install --path ../bundle`). Remove any
explicit path dependencies on potential ruby version based directory
names.
@cupakromer
Copy link
Member Author

This should just be for our gems. I've added a rubular permalink, which includes comments with links for the failing build, and the previous regex which didn't match.

@JonRowe
Copy link
Member

JonRowe commented Jun 25, 2014

This was intended to match ruby gems folders as formatted by default, your changes will potentially mean it includes any dir with gems in the name no?

@cupakromer
Copy link
Member Author

It matches paths which have a directory named gems; must be the exact name. Which seems to be what happens when you specify a path with bundler, which we do on several of the gems when they run via Travis.

@myronmarston
Copy link
Member

👍

@cupakromer
Copy link
Member Author

@JonRowe any further concerns? On my system the two general paths I use look like:

  • ~/.rvm/gems/ruby-2.1.2@rspec-dev/gems/...
  • PATH_TO_BUNDLE_DIR/bundle/ruby/2.1.0/gems/...

Both of those end in gems and have a leading /ruby somewhere in the path. I could adjust the regex to look for that instead.

@JonRowe
Copy link
Member

JonRowe commented Jun 26, 2014

:shipit:

cupakromer added a commit that referenced this pull request Jun 26, 2014
Generalize the gem backtrace exclusion.
@cupakromer cupakromer merged commit 1e52a1f into master Jun 26, 2014
@cupakromer cupakromer deleted the generalize-gem-backtrace branch June 26, 2014 01:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants