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(flagd): Context value hydration #195

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

aepfli
Copy link
Member

@aepfli aepfli commented Feb 18, 2025

This pr adds context value hydration to the in-process evaluator.

This means, that flagd will provide contextual attributes on connection startup which will be used for inprocess evaluation, like defined in the spec.

https://flagd.dev/reference/specifications/providers/#sync-metadata-properties-in-the-evaluation-context

Follow-up:

  • make contextEnricher a config attribute

@aepfli aepfli requested a review from a team as a code owner February 18, 2025 17:30
@@ -114,7 +125,7 @@ def setup_resolver(self) -> AbstractResolver:
):
return InProcessResolver(
self.config,
self.emit_provider_ready,
self.on_provider_ready,
Copy link
Member

Choose a reason for hiding this comment

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

Should this be emit_provider_ready? It looks like that's what the event is called elsewhere.

Copy link
Member Author

Choose a reason for hiding this comment

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

we are wrapping around the initial on_provider_ready event and add another parameter to it, with the contextual attribute. i can not overload the method, else i would have chosen the same name.

Copy link

codecov bot commented Feb 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.28%. Comparing base (b0dac08) to head (994697d).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #195      +/-   ##
==========================================
+ Coverage   94.13%   94.28%   +0.15%     
==========================================
  Files          17       18       +1     
  Lines         903      928      +25     
==========================================
+ Hits          850      875      +25     
  Misses         53       53              

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

@aepfli aepfli force-pushed the feat/context-value-hydration branch from 596c22e to a5af90e Compare February 20, 2025 14:28
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