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

feat(flags): Add LaunchDarkly Integration #3679

Merged
merged 31 commits into from
Oct 30, 2024

Conversation

aliu39
Copy link
Member

@aliu39 aliu39 commented Oct 22, 2024

@aliu39 aliu39 requested a review from cmanallen October 22, 2024 03:51
Copy link

codecov bot commented Oct 22, 2024

Codecov Report

Attention: Patch coverage is 85.36585% with 6 lines in your changes missing coverage. Please review.

Project coverage is 83.38%. Comparing base (d78664d) to head (5218c7a).
Report is 16 commits behind head on cmanallen/flags-open-feature-integration.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
sentry_sdk/flag_utils.py 40.00% 3 Missing ⚠️
sentry_sdk/integrations/launchdarkly.py 91.17% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@                             Coverage Diff                              @@
##           cmanallen/flags-open-feature-integration    #3679      +/-   ##
============================================================================
- Coverage                                     84.33%   83.38%   -0.95%     
============================================================================
  Files                                           135      136       +1     
  Lines                                         14326    14537     +211     
  Branches                                       2413     2469      +56     
============================================================================
+ Hits                                          12082    12122      +40     
- Misses                                         1494     1666     +172     
+ Partials                                        750      749       -1     
Files with missing lines Coverage Δ
sentry_sdk/integrations/openfeature.py 84.00% <100.00%> (+9.00%) ⬆️
sentry_sdk/flag_utils.py 82.60% <40.00%> (-11.84%) ⬇️
sentry_sdk/integrations/launchdarkly.py 91.17% <91.17%> (ø)

... and 4 files with indirect coverage changes

Copy link
Member

@cmanallen cmanallen left a comment

Choose a reason for hiding this comment

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

Looks good! I'll let you work through the test coverage before approving.

@aliu39 aliu39 marked this pull request as ready for review October 23, 2024 08:34
@aliu39 aliu39 requested review from michellewzhang and a team October 23, 2024 17:14
Copy link
Member

@cmanallen cmanallen left a comment

Choose a reason for hiding this comment

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

Looks good!

sentry_sdk/integrations/launchdarkly.py Outdated Show resolved Hide resolved
sentry_sdk/integrations/launchdarkly.py Outdated Show resolved Hide resolved
Comment on lines 32 to 42
if client is None:
try:
client = ldclient.get() # global singleton.
except Exception as exc:
raise DidNotEnable("Error getting LaunchDarkly client. " + repr(exc))

if not client.is_initialized():
raise DidNotEnable("LaunchDarkly client is not initialized.")

# Register the flag collection hook with the given client.
client.add_hook(LaunchDarklyHook())
Copy link
Member

Choose a reason for hiding this comment

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

This needs to be moved to setup_once. You can call sentry_sdk.get_client().get_integration(LaunchDarklyIntegration) to get the explicitly passed client from the init.

Copy link
Member Author

@aliu39 aliu39 Oct 25, 2024

Choose a reason for hiding this comment

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

Got it, just updated. When is setup_once called? Do you know when setup_once is called? Why is it a staticmethod?

tests/integrations/launchdarkly/test_launchdarkly.py Outdated Show resolved Hide resolved
tests/integrations/launchdarkly/test_launchdarkly.py Outdated Show resolved Hide resolved
tests/integrations/launchdarkly/test_launchdarkly.py Outdated Show resolved Hide resolved
@aliu39
Copy link
Member Author

aliu39 commented Oct 25, 2024

Do we need to worry about the failing checks, ex "Test Miscellaneous / Miscellaneous (latest) (3.12, ubuntu-20.04) (pull_request)"

@aliu39 aliu39 requested a review from cmanallen October 25, 2024 20:19
@cmanallen cmanallen merged commit 018cb0f into cmanallen/flags-open-feature-integration Oct 30, 2024
135 checks passed
@cmanallen cmanallen deleted the aliu/launch-darkly branch October 30, 2024 20:36
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.

2 participants