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(webhooks): prevent raise on give up #3295

Merged
merged 5 commits into from
Jan 16, 2024

Conversation

matthewelwell
Copy link
Contributor

@matthewelwell matthewelwell commented Jan 14, 2024

Changes

Prevent the code from raising the exception on give up off the backoff logic. Should resolve this sentry issue. I've also changed the log level on backoff give up to warning which should resolve this sentry issue.

This change required an update to backoff which subsequently involved upgrading both segment and rudderstack packages since the existing versions had both pinned older versions of backoff.

How did you test this code?

I've added a unit test to test the change to the backoff functionality and manually tested (by running the API locally) the integrations with segment and rudderstack.

Copy link

vercel bot commented Jan 14, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 15, 2024 4:01pm
flagsmith-frontend-preview ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 15, 2024 4:01pm
flagsmith-frontend-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 15, 2024 4:01pm

Copy link
Contributor

github-actions bot commented Jan 14, 2024

Uffizzi Preview deployment-44317 was deleted.

Copy link
Member

@khvn26 khvn26 left a comment

Choose a reason for hiding this comment

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

TypeError: expo() got an unexpected keyword argument 'raise_on_giveup'

@matthewelwell
Copy link
Contributor Author

TypeError: expo() got an unexpected keyword argument 'raise_on_giveup'

Whoops, looks like it's only available since 2.0 which something in our deps graph is preventing. I'll fix this up. Sorry!

Copy link
Contributor

@zachaysan zachaysan left a comment

Choose a reason for hiding this comment

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

It took me a double take to understand how the test works, but it looks good.

@matthewelwell
Copy link
Contributor Author

It took me a double take to understand how the test works, but it looks good.

This seems fair on my own review so I've tried to add a bit more verbiage in the test to help clarify.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (37831a8) 95.99% compared to head (a1945f8) 95.95%.
Report is 9 commits behind head on main.

❗ Current head a1945f8 differs from pull request most recent head 722f838. Consider uploading reports for the commit 722f838 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3295      +/-   ##
==========================================
- Coverage   95.99%   95.95%   -0.04%     
==========================================
  Files        1068     1068              
  Lines       32721    32721              
==========================================
- Hits        31411    31399      -12     
- Misses       1310     1322      +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -16,7 +16,7 @@
class RudderstackWrapper(AbstractBaseIdentityIntegrationWrapper):
def __init__(self, config: RudderstackConfiguration):
rudder_analytics.write_key = config.api_key
rudder_analytics.data_plane_url = config.base_url
rudder_analytics.dataPlaneUrl = config.base_url
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was a change in v2 of the rudderstack library. It blows my mind that they've moved from snake case to camel in a python library 🤯 but it is what it is. I've tested it locally to verify this is correct.

@matthewelwell matthewelwell added this pull request to the merge queue Jan 16, 2024
Merged via the queue into main with commit 581a8c9 Jan 16, 2024
21 checks passed
@matthewelwell matthewelwell deleted the fix/prevent-raise-on-giveup branch January 16, 2024 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issue related to the REST API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants