Wire TypeScript interpreter module into state.ts, remove Go endpoint#3704
Wire TypeScript interpreter module into state.ts, remove Go endpoint#3704zackverham wants to merge 3 commits intomainfrom
Conversation
9103644 to
60901e6
Compare
d859387 to
9728cb9
Compare
Replace the HTTP call to the Go /api/interpreters endpoint with an in-process call to the TypeScript getInterpreterDefaults() function added in the previous PR. Changes: - configurations.ts: add requiresPython/requiresR fields to PythonConfig/RConfig types and fill-in logic in UpdateConfigWithDefaults - state.ts: use getInterpreterDefaults() instead of api.interpreters.get() - client.ts: remove Interpreters resource import and property - Delete Interpreters.ts API resource class - Delete get_interpreters.go and its tests - Remove /api/interpreters route from api_service.go Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
9728cb9 to
79ac36e
Compare
…ithDefaults Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
| if (!config.configuration.r.packageManager) { | ||
| config.configuration.r.packageManager = defaults.r.packageManager; | ||
| } | ||
| if (!config.configuration.r.requiresR) { |
There was a problem hiding this comment.
this (and the python equivalent below) seem obviously right, but I'm surprised this wasn't already here? This function predates the migration project. Was there an existing bug here?
There was a problem hiding this comment.
I think so, yeah - I believe this was a bug. I should add that to the PR description, sorry.
There was a problem hiding this comment.
we're not just moving, we're improving!
Smoke Test PlanWhat changedThis PR replaces the HTTP call to the Go Two code paths in
Prerequisites
Test cases1. Extension startup — Python project
Pass: Sidebar renders, Python packages section shows the correct package file and packages. No errors in the Output panel. 2. Extension startup — R project
Pass: R packages section shows packages. No errors. 3. Configuration file change triggers refresh
Pass: Changes reflected in sidebar. No errors in Output panel. 4. Selecting a deployment loads its configuration
Pass: Configuration loads for each deployment. Python/R package sections update appropriately. 5. Python not on PATH
Pass: Extension loads without crashing. The Python section should still appear but with empty/default version. No unhandled exceptions. 6. R not on PATH
Pass: Extension loads without crashing. R section gracefully handles missing interpreter. 7. Mixed project (Python + R)
Pass: Both Python and R packages display. Both versions are detected. 8. Deploy still works
Pass: Deployment completes successfully. The deployed configuration has correct interpreter versions. 9. Go endpoint is gone (negative test)
Pass: Returns 404 or "not found" — confirming the route was removed and nothing else depends on it. 10. requiresPython / requiresR populated
Pass: The Automated coverage
|
Summary
api.interpreters.get()HTTP calls with in-processgetInterpreterDefaults()from the TypeScript interpreter module (Add TypeScript interpreter detection module #3703)requiresPython/requiresRfields toPythonConfig/RConfigtypes and fill-in logic inUpdateConfigWithDefaults/api/interpretersendpoint (get_interpreters.go) and its route registrationInterpretersAPI resource class from the TypeScript clientBug fix:
requiresPython/requiresRwere never applied to configurationsThe Go
FillDefaultsmethods (config/types.go) already populatedrequiresPythonandrequiresRon the interpreter response DTO. However, the TypeScriptUpdateConfigWithDefaultsonly copiedversion,packageFile, andpackageManagerfrom the defaults — it silently dropped therequiresPython/requiresRfields. This PR adds the missing fill-in logic so these fields are actually applied to configurations for the first time.This is PR 2 of 3 splitting up #3672. This is the behavioral switchover — can be reviewed independently of PR 3.
PRs:
PR 1(#3703, merged) | PR 2 (this) | PR 3 (#3705)Test plan
npx tsc --noEmitpassesnpx vitest run src/api/types/configurations.test.ts— 12 tests including 6 new tests forrequiresPython/requiresRfill-in logicnpx vitest run src/state.test.ts— 16 tests passgo test -short ./internal/services/api/...passesnpx prettier --checkpasses🤖 Generated with Claude Code