Skip to content

Fix Falcon Integration#2346

Closed
szokeasaurusrex wants to merge 7 commits into
masterfrom
szokeasaurusrex/falcon-fix
Closed

Fix Falcon Integration#2346
szokeasaurusrex wants to merge 7 commits into
masterfrom
szokeasaurusrex/falcon-fix

Conversation

@szokeasaurusrex

@szokeasaurusrex szokeasaurusrex commented Sep 4, 2023

Copy link
Copy Markdown
Member

Fixes #1946

@szokeasaurusrex szokeasaurusrex changed the title Fix #1946 Fix Asyncio Integration Sep 4, 2023
@szokeasaurusrex szokeasaurusrex changed the title Fix Asyncio Integration Fix Falcon Integration Sep 4, 2023
@szokeasaurusrex
szokeasaurusrex force-pushed the szokeasaurusrex/falcon-fix branch from c78d918 to 41016c8 Compare September 4, 2023 14:26

class SentryFalconMiddlewareBase(ABC):
@abstractmethod
def process_request(self, req: Any, resp: Any, *args: Any, **kwargs: Any) -> None:

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Is it okay that I used Python 3-style type hints here? This file should never get loaded in Python 2

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this should be fine 👀

@szokeasaurusrex

Copy link
Copy Markdown
Member Author

Should we be adding unit tests for this change? Or is it simple enough for unit tests to be unnecessary?

@szokeasaurusrex
szokeasaurusrex marked this pull request as ready for review September 5, 2023 14:45

@sentrivana sentrivana left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great job figuring out how to deal with the py2/3 compat issue! 🎖️

Approving as the fix itself looks good, but please don't merge yet -- I think we do need testcases.

Even though the change looks small we're actually adding a major feature, which is support for ASGI Falcon, so I think that warrants some testcases. We could create a dummy ASGI Falcon app and basically check that the tests that work for WSGI also work for the async app. I see that there's a falcon.testing module -- maybe there's a test asgi app that we could use?

@szokeasaurusrex
szokeasaurusrex marked this pull request as draft September 6, 2023 08:21
@szokeasaurusrex

szokeasaurusrex commented Sep 6, 2023

Copy link
Copy Markdown
Member Author

Converting back to a draft to block merging until test cases are completed

@szokeasaurusrex

Copy link
Copy Markdown
Member Author

This PR has been superseded by #2359

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.

sentry-sdk stopped working with falcon 3+ asgi app

2 participants