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

Fix regex substitution for warden and empty? errors for Rack #88

Merged

Conversation

irvingreid
Copy link
Contributor

Three things I found in testing the Rails beeline with our application:

  • when finding available Warden scopes for user sessions, the regex substitution that was meant to extract the capture group containing the scope name was instead replacing it with a string containing the (invalid Unicode) character "\0001"
  • The Rack integration throws an error if the value passed does not implement empty?(); Ruby only implements that method on collection types.
  • Fields with boolean values would be omitted from the trace if the boolean was false, rather than being included with the false value. If this is intentional, fine, though I prefer to include it; there's a meaningful difference between "I don't have a value for that field" and "I have the value false for that field".

@paulosman paulosman requested a review from martin308 May 12, 2020 01:20
@@ -1,7 +1,7 @@
# frozen_string_literal: true

module Honeycomb
# Methods for extracing common warden/devise fields from a rack env hash
# Methods for extracting common warden/devise fields from a rack env hash
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice. Thank you :-)

Copy link
Member

@martin308 martin308 left a comment

Choose a reason for hiding this comment

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

Thanks these look like excellent finds! It would be great to have this as two PRs one for the rack fix and one for the warden fix

lib/honeycomb/integrations/rack.rb Show resolved Hide resolved
@@ -51,7 +51,7 @@ def last_name
end

def created_at
Time.now
Time.new 2002, 3, 4, 5, 6, 7
Copy link
Member

Choose a reason for hiding this comment

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

what was this fixing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No specific issue, just a general aversion to having variable dates in tests; I've fixed too many tests that flaked out due to time quirks. I can back it out if you want.

Copy link
Contributor

@paulosman paulosman left a comment

Choose a reason for hiding this comment

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

LGTM but would like @martin308 to review before deciding whether to merge.

@irvingreid irvingreid marked this pull request as draft May 12, 2020 13:32
Copy link
Member

@martin308 martin308 left a comment

Choose a reason for hiding this comment

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

@irvingreid looks good. I pulled the code down and had a play and everything makes sense now!

@irvingreid irvingreid marked this pull request as ready for review May 12, 2020 22:58
@irvingreid
Copy link
Contributor Author

Do you still want two separate PRs or is this one OK?

@martin308
Copy link
Member

@irvingreid I think we could pull one or two small things out but they are much smaller than I initially thought so let's just use this one. Sorry for the confusion and thanks for bearing with us

@martin308 martin308 merged commit c823c4c into honeycombio:master May 12, 2020
@irvingreid irvingreid deleted the fix-regex-substitution-for-warden branch June 17, 2020 19:04
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.

3 participants