chore: Declare the hook-environment-id contract test capability - #1849
chore: Declare the hook-environment-id contract test capability#1849kinyoklion wants to merge 3 commits into
Conversation
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
@launchdarkly/js-client-sdk size report |
|
@launchdarkly/js-sdk-common size report |
|
@launchdarkly/browser size report |
|
@launchdarkly/js-client-sdk-common size report |
|
@cursor review |
Co-Authored-By: rlamb@launchdarkly.com <4955475+kinyoklion@users.noreply.github.com>
Co-Authored-By: rlamb@launchdarkly.com <4955475+kinyoklion@users.noreply.github.com>
Requirements
Related issues
Depends on launchdarkly/sdk-test-harness#410, which adds the
hook-environment-idcapability and a test assertingevaluationSeriesContext.environmentId.Describe the solution you've provided
The node server contract-test service only needed to declare the capability:
TestHookforwards the wholeEvaluationSeriesContextto the callback, soenvironmentIdis already in the payload, andHookRunnergets it fromgetInitMetaData().Verified with a local build of the harness branch:
hooks/evaluation/provides the environment IDpasses.Describe alternatives you've considered
None; no code change is required beyond the capability.
Additional context
The capability only takes effect once the harness change is released; until then it is ignored by the harness.
Link to Devin session: https://app.devin.ai/sessions/bfe54128e2804a96bb100e6120e9a3ef
Requested by: @kinyoklion
Note
Overview
Registers the
hook-environment-idcontract-test capability on the Node server contract-test service so the harness can run the evaluation-hook test that checksevaluationSeriesContext.environmentId.No SDK logic changes in this PR—the service already forwards the full evaluation series context (including environment ID from init metadata) to hook callbacks; this only advertises support to the test harness once the harness change is available.
Reviewed by Cursor Bugbot for commit fd61913. Bugbot is set up for automated code reviews on this repo. Configure here.