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

allow dict_merge to throw an error on rollbar.init + fix logging init #339

Conversation

terencehonles
Copy link
Contributor

  • dict_merge is used in rollbar.init which potentially allows broken config to silently misconfigure the rollbar settings because it is not strictly copying the config passed in. This PR changes dict_merge to allow a strict mode so rollbar.init will throw an error instead of misconfiguring rollbar, and when dict_merge is used to send data to rollbar it uses the unstrict mode to not break at "runtime".

  • When initializing rollbar via the RollbarHandler, the logging config that is passed in is wrapped by a Converting{Dict,List,Tuple} which breaks copy.deepcopy. This PR unwraps the converter container types to their base types so that the subsequent call to dict_merge does not break or hide this error.

@waltjones waltjones closed this Aug 14, 2020
@waltjones waltjones reopened this Aug 14, 2020
@waltjones
Copy link
Contributor

@terencehonles This looks good. Can you rebase to master? Maybe that's enough to get the build green.

- ``dict_merge`` is used in ``rollbar.init`` which potentially allows
  broken config to silently misconfigure the rollbar settings because it
  is not strictly copying the config passed in. This PR changes
  ``dict_merge`` to allow a strict mode so ``rollbar.init`` will throw
  an error instead of misconfiguring rollbar, and when ``dict_merge`` is
  used to send data to rollbar it uses the unstrict mode to not break at
  "runtime".

- When initializing rollbar via the ``RollbarHandler``, the logging
  config that is passed in is wrapped by a
  ``Converting{Dict,List,Tuple}`` which breaks ``copy.deepcopy``. This
  PR unwraps the converter container types to their base types so that
  the subsequent call to ``dict_merge`` does not break or hide this
  error.
@terencehonles terencehonles force-pushed the fix-dict_merge-for-rollbar.init-and-unwrap-logging-wrappers branch from 05403fb to 57d9ccc Compare August 14, 2020 18:52
@terencehonles
Copy link
Contributor Author

@terencehonles This looks good. Can you rebase to master? Maybe that's enough to get the build green.

It looks like it was already on top of master, but I amend the commit to change the SHA and force a rebuild.

@waltjones
Copy link
Contributor

#335 is failing CI in the same place. Later PRs are not. While Github is doing a smart diff with master for the PR, I'm not sure that's what Travis is picking up.

@terencehonles
Copy link
Contributor Author

#335 is failing CI in the same place. Later PRs are not. While Github is doing a smart diff with master for the PR, I'm not sure that's what Travis is picking up.

@waltjones #349 will fix the test case, but I opened it as its own PR so it could be adjusted if needed.

@waltjones waltjones self-requested a review August 17, 2020 22:53
@waltjones waltjones merged commit 04782cd into rollbar:master Aug 17, 2020
@terencehonles terencehonles deleted the fix-dict_merge-for-rollbar.init-and-unwrap-logging-wrappers branch August 18, 2020 15:37
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

2 participants