Skip to content

feat: fetch manifest on init and evaluate value - #20

Merged
yangguoif merged 3 commits into
mainfrom
yangguo/BMBB-1515-fetch-manifest
Nov 23, 2026
Merged

yangguoif merged 3 commits into
mainfrom
yangguo/BMBB-1515-fetch-manifest

Conversation

@yangguoif

@yangguoif yangguoif commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Backgournd

As we have implement the base types and evaluate method. It's time to setup the client that actually talks to the feature flag server and evaluate the flag value.

Result

This PR

  • adds feature_flag_api_client to communicate with feature flag server.
  • adds bare minimum of feature_flag_evaluator_cache so that the server response can be consumed by evaluator.
  • tweak feature_flag_provider to wire up the evaluator cache.
  • adds a fake api server for testing purpose.

Notes

  • This PR does not include shutdown and polling, this will be covered in following PR.
  • The doc for the timeout prop in the public API is tweaked because timeout is set for each phase of the http request in httpx. We decided to keep it simple by defaults to what the package support, instead of implement the overall response timeout ourselves. This decision also matches other providers.

Testing

Added unit test, and also manually tested as following by creating a fastAPI app that consumes the provider:

  1. When the flag is enabled
Screen.Recording.2026-11-23.at.2.30.13.PM.mov
  1. When the flag is disabled
Screenshot 2026-11-23 at 2 31 44 PM

@yangguoif
yangguoif requested a review from a team as a code owner November 23, 2026 01:26
@yangguoif yangguoif changed the title Fetch manifest on init and evaluate value chore: fetch manifest on init and evaluate value Nov 23, 2026
@yangguoif yangguoif changed the title chore: fetch manifest on init and evaluate value feat: fetch manifest on init and evaluate value Nov 23, 2026
@@ -0,0 +1,152 @@
"""A fake Octopus feature flags service for tests that drive the provider.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Just noticed that there is this ticket to run the specification fixture. Wondering if this fake server is really necessary.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I assume that this can be used or modified for those tests. 👍

@liamhughes liamhughes left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

👍

One log change suggestion.

@@ -0,0 +1,152 @@
"""A fake Octopus feature flags service for tests that drive the provider.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I assume that this can be used or modified for those tests. 👍

Co-authored-by: Liam Hughes <liam.hughes@octopus.com>
@yangguoif
yangguoif merged commit 10e6004 into main Nov 23, 2026
17 checks passed
@yangguoif
yangguoif deleted the yangguo/BMBB-1515-fetch-manifest branch November 23, 2026 07:39
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