raven-python icon indicating copy to clipboard operation
raven-python copied to clipboard

Sanic/Flask client consolidation

Open youcandanch opened this issue 7 years ago • 5 comments

As noted in #1205 and #1219, a Sanic client was added; it shares a lot of similarities with the existing Flask client, and I had considered refactoring the two to try to lift out some of the common functionality. I didn't want to do this without talking it down a bit first, as I had some concerns:

  • Is this even work worth doing? There's common functionality, and I think there's likely some base elements that could be lifted out easily, but do we want the two clients to share a common base? Are there downsides?
  • Where would this work live? Something like "SanicFlaskBase" is kind of cumbersome and wordy, but I can't think of anything else that's descriptive.
  • Do other clients also share functionality like this? I'm sure there are similarities, but I'm not yet well versed enough in Raven generally to pick up on 'em.

I'm happy to chunk this out into separate issues if that makes more sense.

(attn: @mitsuhiko)

youcandanch avatar Apr 02 '18 13:04 youcandanch

So the general trend we're thinking of is to split the basic client from integrations entirely. Our experiments with this are currently limited to the JavaScript clients but based on our experience there we might want to do similar things with raven python. This would most likely mean that the actual integrations become significantly smaller because all they do is hook exception handlers and other things and are completely separated from the clients.

mitsuhiko avatar Apr 03 '18 22:04 mitsuhiko

Interesting. Is there code somewhere that I can look to for a pattern? I'm happy to do the legwork and sketch this out if I've got references.

youcandanch avatar Apr 04 '18 16:04 youcandanch

I've been working on several "proof of concept", and have been hacking on a python 3 only, new rewrite. Currently in a very deep rabbit hole. More or less a complete API rewrite but I think it's pretty solid. But it's still far away from usable. Some code will be ported, but I don't want to put in code who nobody understands why it's there but on the other hand might be important.

ashwoods avatar Apr 04 '18 18:04 ashwoods

@ashwoods that's awesome. Lemme know if I can help out at all. Happy to do the needful.

youcandanch avatar Apr 11 '18 00:04 youcandanch

This is implemented in https://github.com/getsentry/sentry-python: Most common functionality is in the base client. There's not a lot of potential for code sharing left.

untitaker avatar Sep 27 '18 21:09 untitaker