FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat: Support OpenFeature tracking by kinyoklion · Pull Request #50 · launchdarkly/openfeature-python-server · GitHub

feat: Support OpenFeature tracking - #50

Merged
kinyoklion merged 2 commits into
mainfrom
devin/openfeature-python-tracking
Aug 25, 2026
Merged

feat: Support OpenFeature tracking#50
kinyoklion merged 2 commits into
mainfrom
devin/openfeature-python-tracking

Conversation

kinyoklion commented Aug 19, 2026
edited by cursor Bot
Loading

Copy link
Copy Markdown
Member

Implements the OpenFeature tracking API (spec §6) in the provider, matching the behavior of the Java, .NET, and Node providers.

  • client.track(...) previously no-opped silently: the OpenFeature Python SDK only forwards tracking to providers that implement track (spec 6.1.4), so custom/experimentation events were being dropped with no error.
  • TrackingEventDetails.attributes map to the LD event data, and TrackingEventDetails.value maps to metric_value.
  • A track call without an evaluation context logs at info level and sends nothing, since LaunchDarkly requires a context to attribute the event to.

Requirements

  • I have added test coverage for new or changed functionality
  • I have followed the repository's pull request submission guidelines
  • I have validated my changes against all supported platform versions

Related issues

None; found while auditing the LaunchDarkly OpenFeature providers for missing spec features.

Describe the solution you've provided

LaunchDarklyProvider.track converts the OpenFeature evaluation context to an ldclient.Context with the existing EvaluationContextConverter and then calls the narrowest LDClient.track overload that fits the details supplied: name only, name + data, or name + data + metric value.

Describe alternatives you've considered

Sending an event with an empty/invalid context when no context is supplied, which would produce events LaunchDarkly cannot attribute. The Java provider already logs and skips in this case, so this follows that precedent.

Additional context

Implementation details

TrackingEventDetails.attributes defaults to {} rather than None, so an empty attribute map is normalized to None to avoid sending an empty data object. Tests patch LDClient.track and assert the exact argument shape for each of the four combinations (no context, no details, attributes only, value + attributes, value only).

Link to Devin session: https://app.devin.ai/sessions/0c452d209ec54b068ba120b4c92b8f6c
Requested by: @kinyoklion


Note

Overview
Implements OpenFeature spec tracking on LaunchDarklyProvider so client.track(...) forwards custom events to LaunchDarkly instead of being dropped when the provider had no track implementation.

track converts the OpenFeature EvaluationContext via the existing converter and calls LDClient.track with the right arity: event name only, plus data from TrackingEventDetails.attributes, and/or metric_value from TrackingEventDetails.value (empty attribute maps are treated as no data). Calls without an evaluation context log at info on launchdarkly-openfeature-server and send nothing.

Dependency: openfeature-sdk minimum is raised from 0.8.0 to 0.9.0. Tests mock LDClient.track for the no-context, no-details, attributes-only, value-only, and value+attributes paths.

Reviewed by Cursor Bugbot for commit 9d846a4. Bugbot is set up for automated code reviews on this repo. Configure here.

kinyoklion self-assigned this Aug 19, 2026

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

Copy link
Copy Markdown
Contributor

@cursor review

kinyoklion marked this pull request as ready for review August 19, 2026 16:25
kinyoklion requested a review from a team as a code owner August 19, 2026 16:26

cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 79b09c0. Configure here.

devin-ai-integration Bot added the devin-pr Pull request created by Devin AI label Aug 19, 2026
devin-ai-integration Bot and others added 2 commits August 25, 2026 16:26
Co-Authored-By: rlamb@launchdarkly.com <4955475+kinyoklion@users.noreply.github.com>
devin-ai-integration Bot force-pushed the devin/openfeature-python-tracking branch from 4042b50 to 9d846a4 Compare August 25, 2026 16:26
kinyoklion merged commit 9395775 into main Aug 25, 2026
13 checks passed
kinyoklion deleted the devin/openfeature-python-tracking branch August 25, 2026 21:43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devin-pr Pull request created by Devin AI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL