Skip to content

feat(flags): switch local evaluation endpoint to /flags/definitions - #173

Merged
patricio-posthog merged 3 commits into
mainfrom
feat/flags-definitions-endpoint
Apr 21, 2026
Merged

feat(flags): switch local evaluation endpoint to /flags/definitions#173
patricio-posthog merged 3 commits into
mainfrom
feat/flags-definitions-endpoint

Conversation

@patricio-posthog

Copy link
Copy Markdown
Contributor

Motivation and Context

The Rust feature flags definitions fleet now serves 100% of /api/feature_flag/local_evaluation traffic in all environments. This switches the SDK's default polling URL from the legacy Django path to the Rust endpoint's native path (/flags/definitions).

The old /api/feature_flag/local_evaluation path remains registered as a route alias on the Rust service, so older SDK versions continue to work.

How did you test it?

  • Updated all fake HTTP handler URLs across 4 test files
  • The /flags/definitions endpoint has been serving production traffic since 2026-04-09

@github-actions

github-actions Bot commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

posthog-dotnet Compliance Report

Date: 2026-04-21 14:26:46 UTC
Duration: 260ms

⚠️ Some Tests Failed

0/1 tests passed, 1 failed


Feature_Flags Tests

⚠️ 0/1 tests passed, 1 failed

View Details
Test Status Duration
Request Payload.Request With Person Properties Device Id 43ms

Failures

request_payload.request_with_person_properties_device_id

404, message='Not Found', url='http://sdk-adapter:8080/get_feature_flag'

@greptile-apps

greptile-apps Bot commented Apr 15, 2026

Copy link
Copy Markdown
Contributor
Prompt To Fix All With AI
This is a comment left during a code review.
Path: tests/TestLibrary/Fakes/FakeHttpMessageHandlerExtensions.cs
Line: 71

Comment:
**URL constant duplicated across test files**

`LocalEvaluationUrl` has no access modifier (private by default), so every test file that needs the raw URI for a custom response — `LocalFeatureFlagsLoaderTests.cs` (defines its own `static readonly Uri LocalEvaluationUrl`) and the inline `new Uri(...)` literals in `FeatureFlagsTests.cs` and `PostHogClientTests.cs` — must repeat the string. This PR updated 7 spots for a single URL change, which is the OnceAndOnlyOnce violation the simplicity rules flag.

Making this field `internal` (and verifying the UnitTests project already has `InternalsVisibleTo` access, or promoting it to `public`) would let every test reference a single source of truth and reduce future churn to one edit.

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "feat(flags): switch local evaluation end..." | Re-trigger Greptile

Comment thread tests/TestLibrary/Fakes/FakeHttpMessageHandlerExtensions.cs Outdated
@patricio-posthog
patricio-posthog merged commit 86e0e2a into main Apr 21, 2026
15 checks passed
@patricio-posthog
patricio-posthog deleted the feat/flags-definitions-endpoint branch April 21, 2026 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants