Skip to content

feat: Implement tracking#564

Open
danjuv wants to merge 19 commits intoopen-feature:mainfrom
danjuv:feat/add-tracking
Open

feat: Implement tracking#564
danjuv wants to merge 19 commits intoopen-feature:mainfrom
danjuv:feat/add-tracking

Conversation

@danjuv
Copy link

@danjuv danjuv commented Feb 2, 2026

This PR

Implements Tracking as per spec: open-feature/spec@cd99c35

Related Issues

Fixes #374

Notes

Follow-up Tasks

How to test

@gemini-code-assist
Copy link

Summary of Changes

Hello @danjuv, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request integrates the OpenFeature Tracking API into the Python SDK. The primary goal is to enable developers to associate user actions and application states with feature flag evaluations, which is crucial for robust experimentation and telemetry. The changes involve extending the client and provider interfaces with a new track method and introducing a dedicated data structure for tracking event details, ensuring the SDK adheres to the OpenFeature specification.

Highlights

  • Tracking API Implementation: The pull request introduces the 'Tracking' API, allowing the association of user actions with feature flag evaluations, aligning with the OpenFeature specification.
  • Client-side track method: A new track method has been added to the OpenFeatureClient, which merges evaluation contexts and delegates the tracking call to the configured provider.
  • Provider-side track method: Both InMemoryProvider and NoOpProvider now include a track method. The InMemoryProvider stores tracking events, while the NoOpProvider provides a no-operation implementation.
  • New TrackingEventDetails class: A new class, TrackingEventDetails, has been introduced to encapsulate the value and attributes associated with a tracking event.
  • Documentation Update: The README.md has been updated to include 'Tracking' as a supported capability and provides a detailed explanation and code example for its usage.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@danjuv danjuv force-pushed the feat/add-tracking branch from 5645f69 to 4c24e80 Compare February 2, 2026 15:35
@danjuv
Copy link
Author

danjuv commented Feb 2, 2026

/gemini review

@danjuv danjuv changed the title Implement Tracking feat: Implement tracking Feb 2, 2026
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new tracking feature, which is a great addition. The implementation is mostly solid, with new client methods, provider implementations, and tests. I've found a few issues that need addressing. There's an incorrect code example in the README, a potential bug in the TrackingEventDetails class that could lead to runtime errors, and a type issue in the InMemoryProvider's tracking implementation. My detailed comments and suggestions are below.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces the tracking feature as per the OpenFeature specification. The implementation looks solid, covering the client, provider interfaces, and adding an in-memory provider implementation for it. I've identified a critical syntax error in the new track module that needs to be addressed, along with a potential bug in the in-memory provider and an incorrect code example in the README. My detailed feedback is in the comments below.

danjuv added 16 commits February 3, 2026 03:27
Signed-off-by: Danju Visvanathan <danju.visvanathan@gmail.com>
Signed-off-by: Danju Visvanathan <danju.visvanathan@gmail.com>
Signed-off-by: Danju Visvanathan <danju.visvanathan@gmail.com>
Signed-off-by: Danju Visvanathan <danju.visvanathan@gmail.com>
Signed-off-by: Danju Visvanathan <danju.visvanathan@gmail.com>
Signed-off-by: Danju Visvanathan <danju.visvanathan@gmail.com>
Signed-off-by: Danju Visvanathan <danju.visvanathan@gmail.com>
Signed-off-by: Danju Visvanathan <danju.visvanathan@gmail.com>
Signed-off-by: Danju Visvanathan <danju.visvanathan@gmail.com>
Signed-off-by: Danju Visvanathan <danju.visvanathan@gmail.com>
Signed-off-by: Danju Visvanathan <danju.visvanathan@gmail.com>
Signed-off-by: Danju Visvanathan <danju.visvanathan@gmail.com>
Signed-off-by: Danju Visvanathan <danju.visvanathan@gmail.com>
Signed-off-by: Danju Visvanathan <danju.visvanathan@gmail.com>
Signed-off-by: Danju Visvanathan <danju.visvanathan@gmail.com>
Signed-off-by: Danju Visvanathan <danju.visvanathan@gmail.com>
@danjuv danjuv force-pushed the feat/add-tracking branch from c98856d to 1bb99e1 Compare February 2, 2026 16:27
@danjuv
Copy link
Author

danjuv commented Feb 2, 2026

/gemini review

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces the tracking feature, aligning with the OpenFeature specification. It adds the track method to the client and provider interfaces, with implementations for the in-memory and no-op providers. The changes are well-tested. My review includes a critical fix for the client to prevent runtime errors when a provider doesn't support tracking, a suggestion to improve code clarity in the in-memory provider, and corrections for the new documentation in the README.

Signed-off-by: Danju Visvanathan <danju.visvanathan@gmail.com>
Signed-off-by: Danju Visvanathan <danju.visvanathan@gmail.com>
@danjuv danjuv marked this pull request as ready for review February 2, 2026 16:33
@danjuv danjuv requested review from a team as code owners February 2, 2026 16:33
Signed-off-by: Danju Visvanathan <danju.visvanathan@gmail.com>
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.

[FEATURE] Implement Tracking in Python

1 participant