-
Notifications
You must be signed in to change notification settings - Fork 54
chore: Support running FDv2 contract tests #359
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
Conversation
| LD_ENVID_HEADER = "x-launchdarkly-env-id" | ||
| LD_FD_FALLBACK_HEADER = "x-launchdarkly-fd-fallback" | ||
| LD_ENVID_HEADER = "X-LD-EnvID" | ||
| LD_FD_FALLBACK_HEADER = "X-LD-FD-Fallback" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Header lookup fails due to case mismatch
High Severity
The LD_ENVID_HEADER and LD_FD_FALLBACK_HEADER constants were changed from lowercase ("x-launchdarkly-env-id", "x-launchdarkly-fd-fallback") to mixed-case ("X-LD-EnvID", "X-LD-FD-Fallback"). However, HTTP response headers are explicitly downcased via transform_keys(&:downcase) when constructing response_headers. Since Ruby hash lookups are case-sensitive, lookups using these mixed-case constants against the all-lowercase headers hash will always return nil, breaking fallback detection and environment ID retrieval.
| stale_after: stale_after_ms | ||
| ) | ||
| big_config[:context_cache_size] = big_segments[:userCacheSize] if big_segments[:userCacheSize] | ||
| set_optional_time_prop(big_segments, :userCacheTimeMs, big_config, :context_cache_time) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updating to use the new set_optional_time_prop method
| context1 == context2 | ||
| end | ||
|
|
||
| def secure_mode_hash(params) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved non private methods above the private methods.
keelerm84
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine to me (minus my one comment and whatever the bot is grumpy about).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
Note
Medium Risk
Touches client initialization/evaluation readiness logic and FDv2 polling request headers, which can change runtime behavior in production paths if incorrect, though most other changes are confined to contract-test harness code/CI.
Overview
Enables running both FDv2 and early FDv3 contract test suites in CI by updating the composite
checkaction to run contract tests twice (keeping the service running between runs).Updates the Ruby contract test service/client to understand the new
dataSystemconfiguration shape (initializers/synchronizers, FDv1 fallback, payload filter, and nested persistent store settings), refactors time conversions, and adds persistent-store mode mapping for FDv2. Adjusts local dev server binding/host authorization for the test service, updates FDv2 polling header names toX-LD-*, and changesLDClient#initialized?/evaluation gating to treat cached store data as initialized while still distinguishingREFRESHEDvsCACHEDduring evaluation.Written by Cursor Bugbot for commit 7ed5f6d. This will update automatically on new commits. Configure here.