Skip to content

chore(setup): add SDK installer library - #750

Open
ffantl-ld wants to merge 1 commit into
ffantl/setup-ld/1-detectorfrom
ffantl/setup-ld/2-installer
Open

chore(setup): add SDK installer library#750
ffantl-ld wants to merge 1 commit into
ffantl/setup-ld/1-detectorfrom
ffantl/setup-ld/2-installer

Conversation

@ffantl-ld

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

Copy link
Copy Markdown
Contributor

Describe the solution you've provided

Second layer of the guided setup command: the SDK installer. Given a detection result, installs the SDK via the project's package manager (Installer interface, PackageInstaller, InstallArgs, IsInstalled), and flags SDKs that require manual install.

Builds on the detection library (DetectResult).

Related issues

Part of the setup-ld feature. Stacked PR — base is ffantl/setup-ld/1-detector.

Requirements

  • I have added test coverage for new or changed functionality

Note

Medium Risk
Runs real package-manager commands via exec in the user’s project directory when wired in production; incorrect SDK mapping or manifest checks could skip or mis-trigger installs, though scope is isolated to the new setup library with test doubles.

Overview
Adds the guided setup install layer: given a DetectResult, it can install LaunchDarkly SDKs via the project’s package manager or surface manual-install guidance.

Introduces an Installer interface with PackageInstaller (injectable run for tests, otherwise exec in the project directory), InstallResult, and InstallArgs mapping SDK IDs to npm/yarn/pnpm/bun, pip, go get, gem, and dotnet add commands. IsInstalled skips installs when the package already appears in manifests (package.json, go.mod, Python/Ruby files, *.csproj). Java, Android, and Swift/iOS are manual-only: RequiresManualInstall, nil install args, and Success=false without error so the wizard can show the coordinate; unknown SDK IDs return an error.

Includes StubInstaller for wiring before real logic and broad unit tests for args, success/failure, skip-if-installed, and manual/unknown SDK behavior.

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

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@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 3 potential issues.

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 536ddf1. Configure here.

return nodeInstallCmd(resolveNodePM(packageManager), pkg), pkg
case "react-native":
pkg = "launchdarkly-react-native-client-sdk"
return nodeInstallCmd(resolveNodePM(packageManager), pkg), pkg

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Wrong React Native package name

High Severity

InstallArgs installs launchdarkly-react-native-client-sdk, the archived v9 package. Current LaunchDarkly docs, npm, and this repo’s own react-native quickstart instructions use @launchdarkly/react-native-client-sdk (v10). Setup would add the wrong SDK with incompatible APIs.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 536ddf1. Configure here.

return []string{"go", "get", pkg}, pkg
case "ruby-server-sdk":
pkg = "launchdarkly-server-sdk"
return []string{"gem", "install", pkg}, pkg

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Ruby install skips Gemfile

High Severity

Ruby install runs gem install, which does not add the SDK to the project Gemfile. Detection and IsInstalled both key off Gemfile/Gemfile.lock, and Bundler apps will not see a gem installed only via gem install, so setup reports success while the project dependency is never recorded.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 536ddf1. Configure here.

pm = "pip"
}
pkg = "launchdarkly-server-sdk"
return []string{pm, "install", pkg}, pkg

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Python install skips manifests

Medium Severity

Python install runs pip install without updating requirements.txt, pyproject.toml, or setup.py. IsInstalled only inspects those manifests, so a successful install never registers as already installed, and CI or fresh environments that install from the manifest will miss the SDK.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 536ddf1. Configure here.

@ffantl-ld
ffantl-ld requested review from a team and removed request for Vadman97 July 28, 2026 16:37
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