Skip to content

chore(setup): add setup flag verifier - #752

Open
ffantl-ld wants to merge 2 commits into
ffantl/setup-ld/3-initializerfrom
ffantl/setup-ld/4-verifier
Open

chore(setup): add setup flag verifier#752
ffantl-ld wants to merge 2 commits into
ffantl/setup-ld/3-initializerfrom
ffantl/setup-ld/4-verifier

Conversation

@ffantl-ld

@ffantl-ld ffantl-ld commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Describe the solution you've provided

Fourth layer of the guided setup command: the verifier. Polls the LaunchDarkly API to confirm the newly configured SDK has evaluated a flag, so setup can report success (Verifier, DefaultVerifier). Uses the existing resources.Client.

Related issues

Part of the setup-ld feature. Stacked PR — base is ffantl/setup-ld/3-initializer.

Requirements

  • I have added test coverage for new or changed functionality

Note

Low Risk
New setup-only code path using existing API client; no auth or production runtime changes beyond guided CLI verification.

Overview
Adds the setup verifier layer so setup can confirm the configured SDK is actually talking to LaunchDarkly after init injects runnable code.

A new Verifier polls GET .../sdk-active on a configurable interval until active is true or a timeout (defaults: 5s interval, 120s timeout). Results are returned as VerifyResult (active flag, attempt count, elapsed time, optional sdk_name used for filtering). ReportedSDKName maps setup SDK ids (e.g. node-server) to the sdk_name query param the API expects (e.g. node-server-sdk); unknown ids skip the filter so behavior matches the API’s environment-wide “any SDK in last 7 days” semantics.

Tests cover immediate success, timeout when inactive, sdk_name filtering and id→name mapping, unfiltered unknown SDKs, and a guard that every InjectsInPlace SDK in KnownSDKs has a reported name.

Reviewed by Cursor Bugbot for commit 0532976. Bugbot is set up for automated code reviews on this repo. Configure here.

@ffantl-ld
ffantl-ld marked this pull request as ready for review July 27, 2026 17:23
@ffantl-ld
ffantl-ld requested review from Vadman97 and erangeles July 27, 2026 17:23

@cursor cursor Bot left a comment

Copy link
Copy Markdown

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 using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 00ada35. Configure here.

Comment thread internal/setup/verifier.go Outdated
@ffantl-ld
ffantl-ld requested review from a team and removed request for Vadman97 July 28, 2026 16:38
@ffantl-ld
ffantl-ld force-pushed the ffantl/setup-ld/4-verifier branch from 00ada35 to eff8764 Compare July 31, 2026 17:48
@ffantl-ld
ffantl-ld force-pushed the ffantl/setup-ld/4-verifier branch from eff8764 to 8a8d586 Compare July 31, 2026 18:25
@ffantl-ld
ffantl-ld force-pushed the ffantl/setup-ld/4-verifier branch from 8a8d586 to 7fa9e73 Compare August 3, 2026 18:52
ffantl-ld and others added 2 commits August 3, 2026 15:46
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
sdk-active answers for any SDK that initialized in the environment in the past
seven days, so verification passed on unrelated traffic and a project already
using LaunchDarkly reported success without the new SDK ever connecting.

Filter on sdk_name, mapping the setup SDK id to the name the SDK reports
itself as. An unknown id sends no filter rather than one that can never match,
and VerifyResult records which name was used so an unnarrowed check cannot
present itself as narrowed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@ffantl-ld
ffantl-ld force-pushed the ffantl/setup-ld/4-verifier branch from 7fa9e73 to 0532976 Compare August 3, 2026 19:48
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.

1 participant