fix(vscode): auto-enable multi-language worker for JDBC connector (#8597) - #9442
Conversation
…ure#8597) The JDBC built-in connector runs on the Functions multi-language (Java) worker, gated by AzureWebJobsFeatureFlags=EnableMultiLanguageWorker. A plain codeless Logic App never received that flag, so a driver JAR placed in lib/builtinOperationSdks/JAR was never loaded locally and connections failed with "JDBC client library is missing". - Self-heal on design-time startup: when driver JAR(s) exist, merge EnableMultiLanguageWorker into local.settings.json (preserving any existing flags) in regenerateLocalSettings. - Warn (non-blocking, with docs link) when JDBC JARs are present but no local Java runtime (JDK) is found. - Add jdbcConnector util (JAR detection, flag merge, Java runtime check). - Unit + integration tests for all branches and edge cases. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 72cac36b-47ce-4d10-a368-b71fddfca967
🤖 AI PR Validation ReportPR Review ResultsThank you for your submission! Here's detailed feedback on your PR title and body compliance:✅ PR Title
✅ Commit Type
✅ Risk Level
✅ What & Why
✅ Impact of Change
✅ Test Plan
|
| Section | Status | Recommendation |
|---|---|---|
| Title | ✅ | No change needed |
| Commit Type | ✅ | No change needed |
| Risk Level | ✅ | Medium is correct |
| What & Why | ✅ | No change needed |
| Impact of Change | ✅ | No change needed |
| Test Plan | ✅ | No change needed |
| Contributors | Optionally credit reviewers/PMs | |
| Screenshots/Videos | ✅ | N/A — no visual change |
All required checks pass. This PR is compliant with the team template and cleared to merge. Nice work on the thorough tests and clear root-cause writeup.
Powered by: Copilot CLI (claude-opus-4.8) | Last updated: Mon, 03 Aug 2026 15:11:07 GMT
There was a problem hiding this comment.
Pull request overview
Updates the VS Code Logic Apps (Standard) extension to automatically satisfy JDBC built-in connector prerequisites for local projects by enabling the Functions multi-language (Java) worker when JDBC driver JARs are detected, and by warning users when Java isn’t installed.
Changes:
- Added a focused JDBC/Java utility (
jdbcConnector.ts) for JAR detection, feature-flag merging, Java runtime probing, and a non-blocking warning flow. - Updated codeless project artifact regeneration to self-heal
AzureWebJobsFeatureFlagsby merging inEnableMultiLanguageWorkerwhen JDBC driver JARs exist. - Added unit + e2e integration coverage for the self-heal and warning behavior; centralized folder-name constants and added a missing localized tooltip string.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Localize/lang/strings.json | Adds a localized tooltip string for when workflow runtime is unavailable. |
| apps/vs-code-designer/src/constants.ts | Adds constants for JDBC SDK folder names and the JDBC prerequisites docs URL. |
| apps/vs-code-designer/src/app/utils/java/jdbcConnector.ts | New helper utilities for JDBC driver detection, flag merge, Java runtime check, and warning UX. |
| apps/vs-code-designer/src/app/utils/codeless/validateProjectArtifacts.ts | Implements the JDBC feature-flag self-heal during local.settings regeneration. |
| apps/vs-code-designer/src/app/utils/codeless/startDesignTimeApi.ts | Triggers a non-blocking warning when JDBC JARs are present but Java is missing. |
| apps/vs-code-designer/src/app/utils/java/test/jdbcConnector.test.ts | Unit tests for JAR detection, flag merge, Java runtime check, and warn flow. |
| apps/vs-code-designer/src/app/utils/codeless/test/validateProjectArtifacts.test.ts | Adds tests validating the new self-heal branch behavior. |
| apps/vs-code-designer/src/test/e2e/integration/jdbcConnectorPrerequisites.test.ts | New filesystem-contract integration test for the self-heal behavior. |
| apps/vs-code-designer/src/app/commands/createNewCodeProject/CodeProjectBase/CreateLogicAppWorkspace.ts | Uses the new constants when creating the JDBC driver JAR folder in lib/. |
|
thanks for fixing this one Carlos Castro Trejo (@ccastrotrejo) - I can take care of the conflicts to reconcile with recent changes to project consistency checks |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
apps/vs-code-designer/src/app/utils/java/jdbcConnector.ts:45
hasJdbcDriverJarscurrently treats any directory entry whose name ends with.jaras a driver, even if it’s a folder (e.g., a user-createddrivers.jar/directory). That can incorrectly self-healAzureWebJobsFeatureFlagsand trigger the missing-JDK warning when no actual driver JAR file exists.
Consider verifying the matched entry is a regular file (e.g., await fse.stat(path.join(jarFolder, entry)) and isFile()), ignoring stat errors, and returning true on the first matching file.
export async function hasJdbcDriverJars(projectPath: string): Promise<boolean> {
const jarFolder = getJdbcDriverJarFolder(projectPath);
try {
const entries: string[] = await fse.readdir(jarFolder);
return entries.some((entry) => entry.toLowerCase().endsWith('.jar'));
} catch {
…t-investigate-issue-8597 # Conflicts: # apps/vs-code-designer/src/app/commands/createNewCodeProject/CodeProjectBase/CreateLogicAppWorkspace.ts # apps/vs-code-designer/src/app/projectConsistency/__test__/projectFilesConsistency.test.ts # apps/vs-code-designer/src/app/projectConsistency/projectFilesConsistency.ts # apps/vs-code-designer/src/app/utils/codeless/startDesignTimeApi.ts
The merge commit's pre-commit lint-staged hook applied eslint/biome auto-fixes (consistent-type-imports, trailing-whitespace strips, line reflows) to files pulled in from origin/main, adding churn unrelated to the JDBC fix. Restore those files to their exact origin/main content and re-apply only the JDBC self-heal to projectFilesConsistency so this PR's diff is limited to the JDBC connector change. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 72cac36b-47ce-4d10-a368-b71fddfca967
…ngs generator Addresses PR review feedback: generateLocalSettingsJson is the single source of truth for local.settings.json content, so it now owns whether EnableMultiLanguageWorker belongs in the baseline via an optional hasJdbcDriverJars signal. The async disk probe stays in ensureLocalSettingsFile so the generator remains synchronous (avoiding a breaking change for all other callers), and the repair path keeps merging with existing user-defined flags so custom values are never clobbered. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 72cac36b-47ce-4d10-a368-b71fddfca967
| // merges it with any user-defined flags so existing values are never clobbered. | ||
| if (hasJdbcDrivers) { | ||
| const currentFlags = currentValues[azureWebJobsFeatureFlagsKey] ?? settingsToAdd[azureWebJobsFeatureFlagsKey]; | ||
| const mergedFlags = mergeMultiLanguageWorkerFlag(currentFlags); |
There was a problem hiding this comment.
mergeMultiLanguageWorkerFlag seems like it should be applied in more than just the JDBC scenario, would this always be relevant if azureWebJobsFeatureFlagsKey is in currentValues and settingsToAdd? Other than this lgtm
Commit Type
Risk Level
What & Why
Fixes #8597. Using the JDBC built-in connector in a local Standard Logic App failed with "JDBC client library is missing" even when the driver JAR (for example,
ojdbc8.jar) was correctly placed inlib/builtinOperationSdks/JAR.The JDBC connector is a Java built-in operation that only runs when the Functions multi-language Java worker is enabled via the app setting
AzureWebJobsFeatureFlags=EnableMultiLanguageWorker. The extension only wrote that flag forcustomCode,rulesEngine, andcodefulproject types, so a plain codeless Logic App never got it and the Java worker never started locally. This is why it works in the Portal/Kudu, where the runtime is already provisioned, but not in VS Code.This change makes the tooling self-heal the prerequisite instead of requiring users to discover it by trial and error:
lib/builtinOperationSdks/JAR,EnableMultiLanguageWorkeris merged intolocal.settings.json. The merge preserves existing flags and is idempotent, so it does not clobber user values.The JAR-detection, flag-merge, and Java-runtime checks live in
app/utils/java/jdbcConnector.tsso they are easy to test and reuse.createLibFolderwas also updated to reuse the new folder-name constants with no behavior change.Impact of Change
lib/builtinOperationSdks/JARand reopening the designer, with clear guidance when a JDK is missing. No manuallocal.settings.jsonedit is required.app/utils/java/jdbcConnector.tshelpers (hasJdbcDriverJars,mergeMultiLanguageWorkerFlag,isJavaRuntimeInstalled,warnIfJdbcJavaRuntimeMissing) and newbuiltinOperationSdksFolderName,jarFolderName, andjdbcConnectorDocsUrlconstants.Test Plan
pnpm run test:extension-unit(jdbcConnector 19 tests, validateProjectArtifacts 56 tests including 4 new tests, CreateLogicAppWorkspace 83 tests) all passing; E2E integration suite type-checks viatsc -p tsconfig.e2e.json; Biome clean; changed files type-check clean.New coverage:
app/utils/java/__test__/jdbcConnector.test.ts- JAR detection (casing, empty folder, non-JAR files, missing folder), flag merge (empty, idempotent, preserve, dedupe, whitespace), Java runtime check, and warning flow.validateProjectArtifacts.test.ts- self-heal branches (add, merge without clobbering, idempotent, no-op when no JARs).test/e2e/integration/jdbcConnectorPrerequisites.test.ts- real on-disk contract for the self-heal.Contributors
Root cause and prerequisites corroborated by community findings on the issue thread (Matt Milner (@mnmilner)).
Screenshots/Videos
N/A - no visual UI changes.
Closes #8597