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

Use direct caller in flattened output even if its callsite is blacklisted #54

Merged
merged 1 commit into from
Apr 19, 2018

Conversation

dylanahsmith
Copy link
Contributor

Similar to #51, but for a different reason and rewritten due to not having an entity blacklist anymore.

Problem

In the flattened output we were trying to mimic the behaviour we had before where we got the flattened output from the non-flattened output. That behaviour worked by keeping a stack of previous calls that is pushed for each call and popped for each return, so we could get the caller entity and method from the parent call. Since the non-flattened output would exclude blacklisted calls, it would end up getting the parent non-blacklisted caller info rather than the direct caller info.

The problem with that approach for the flattened output is that we are actually filtering based on the call site path, so if the parent call was blacklisted then that means the caller's caller was blacklisted, which isn't relevant for the current call.

Solution

We already return without logging if the call came from a blacklisted file path, so we just use the caller's entity and method unconditionally in the flattened output.

  • bin/fmt was successfully run

…sted

If the caller frame is blacklisted, then that means its caller was from a
blacklisted file path, which isn't relevant for the current call. There
is no reason to iterate through the callers to find a non-blacklisted one
since we already have an early return if the call site for the current
call is in the blacklist.
@jahfer
Copy link
Contributor

jahfer commented Apr 19, 2018

if the parent call was blacklisted then that means the caller's caller was blacklisted

🤦‍♂️ This fix looks right to me 👍

@jahfer jahfer mentioned this pull request Apr 19, 2018
@dylanahsmith dylanahsmith merged commit 4e9dcd9 into master Apr 19, 2018
@dylanahsmith dylanahsmith deleted the ignore-blacklisted-callsite-on-caller branch April 19, 2018 19:27
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.

None yet

3 participants