Skip to content

feat(vscode): Add workflow/webview validation and E2E launcher migration#9289

Merged
lambrianmsft merged 31 commits into
Azure:mainfrom
lambrianmsft:fix/vscode-extension-regressions
Jul 1, 2026
Merged

feat(vscode): Add workflow/webview validation and E2E launcher migration#9289
lambrianmsft merged 31 commits into
Azure:mainfrom
lambrianmsft:fix/vscode-extension-regressions

Conversation

@lambrianmsft

@lambrianmsft lambrianmsft commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Commit Type

  • feature - New functionality
  • fix - Bug fix
  • refactor - Code restructuring without behavior change
  • perf - Performance improvement
  • docs - Documentation update
  • test - Test-related changes
  • chore - Maintenance/tooling

Risk Level

  • Low - Minor changes, limited scope
  • Medium - Moderate changes, some user impact
  • High - Major changes, significant user/system impact

What & Why

Part 2 of 2 (depends on #9330). Adds webview validation features and E2E test infrastructure for the VS Code extension.

Key features:

  • Workflow name collision detection: Block workflow names that already exist in the selected logic app project
  • Reserved folder name validation: Prevent workflow names like Artifacts, lib, .vscode, workflow-designtime etc. (case-insensitive)
  • Create Project folder gate: Block project creation when folder name collides with existing workspace folders
  • resetState race condition fix: Remove resetState() from CreateLogicApp component that was wiping existingFolders data
  • E2E behavior tests: 5 new reserved workflow name tests in createWorkspace.behavior.test.ts
  • E2E infrastructure: Runtime dependency hardening in run-e2e.js, func+gozip permission repair

Impact of Change

  • Users: Better validation prevents accidental overwrite of reserved/existing workflow folders during creation
  • Developers: New E2E behavior test pattern for webview validation
  • System: No new dependencies; validation logic is client-side only

Test Plan

  • Unit tests added/updated
  • E2E tests added/updated
  • Manual testing completed
  • Tested in: VS Code on Windows, all 18 vscode-e2e CI jobs passed including p41b-createworkspace-behavior (14m25s)

Contributors

@lambrianmsft
@copilot

Screenshots/Videos

N/A

lambrianmsft and others added 2 commits June 12, 2026 17:00
…g ordering, LSP, project types, workflow creation

Issue 1: Windows binary .exe resolution
- binariesExist() now tries .exe variant on Windows before declaring binary missing
- setNodeJsCommand() uses resolveNodeJsCommand() to find node.exe (mirrors func pattern)
- Prevents 429MB+ re-download on every VS Code startup for Windows users

Issue 2: F5 debug file locking on rapid stop/start
- Moved waitForPrevFuncTaskToStop() BEFORE build/publish steps in pickFuncProcessInternal
- Made stopDesignTimeApi() async, awaiting taskkill completion on Windows
- Prevents GenerateFunctionMetadata IOException on obj/Debug/net8/WorkerExtensions

Issue 3: LSP extraction EPERM + defensive path guards
- formatLockedFileError() now recognizes EPERM alongside EBUSY
- installLSPSDK() retries up to 3 times with 2s delay on locked file errors
- getAzureConnectorDetailsForLocalProject() validates projectPath before use

Issue 4: Codeful / custom code project type separation
- pickFuncProcessInternal guards build paths by project type (isCodefulProject)
- Removed invalidateCodefulSdkCacheIfNeeded from custom code build path
- Codeful projects only run publishCodefulProject, custom code only runs tryBuild

Issue 5: Create workflow crash without .code-workspace
- createWorkflow falls back to vscode.workspace.workspaceFolders when getWorkspaceRoot returns undefined
- Shows user-friendly error instead of path.basename(undefined) crash

Regression commits identified:
- 0d9fafd (Node 24 compat Azure#9246) introduced binariesExist binary path check without .exe
- 298310a (Codeful Public Preview Azure#9142) introduced Issues 2-5
- 4430048 (Azure#9155) contributed to Issue 1 via setNodeJsCommand without .exe

Fixes Azure#9271, Azure#9248, Azure#9244, Azure#9237

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Repair managed FuncCoreTools executable permissions for cached installs and make VS Code E2E runtime readiness assert executable nested binaries.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 15, 2026 21:18
@lambrianmsft lambrianmsft added the risk:medium Medium risk change with potential impact label Jun 15, 2026
@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

🤖 AI PR Validation Report

PR Review Results

Thank you for your submission! Here's detailed feedback on your PR title and body compliance:

PR Title

  • Current: feat(vscode): Add workflow/webview validation and E2E launcher migration
  • Issue: No blocking issue. The title is specific and accurately summarizes the scope.
  • Recommendation: None.

Commit Type

  • Properly selected (feature).
  • Only one commit type is selected, which is correct.

⚠️ Risk Level

  • The selected label is risk:medium, which matches the body selection (Medium).
  • Advised risk from diff: medium
  • This is consistent with the submitter’s estimate, so no risk-level correction is needed.

What & Why

  • Current: Part 2 of 2 (depends on #9330). Adds webview validation features and E2E test infrastructure for the VS Code extension.
  • Issue: Good brief summary; it explains both the change and the purpose.
  • Recommendation: None.

Impact of Change

  • The section is sufficiently filled out and clearly identifies user, developer, and system impact.
  • Recommendation:
    • Users: Good.
    • Developers: Good.
    • System: Good.

Test Plan

  • Automated test coverage is present in the diff (unit tests added/updated and E2E tests added/updated).
  • This satisfies the test-plan requirements.

Contributors

  • Contributors are listed.
  • No action required, though including any PM/Designer contributions here would still be helpful if applicable.

Screenshots/Videos

  • Marked N/A, which is acceptable for this PR.

Summary Table

Section Status Recommendation
Title
Commit Type
Risk Level
What & Why
Impact of Change
Test Plan
Contributors
Screenshots/Videos

This PR passes review. The submitted risk level matches the diff assessment, and the body content is complete and compliant with the template.


Last updated: Wed, 01 Jul 2026 21:07:32 GMT

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR targets VS Code extension debugging/startup regressions by improving process shutdown sequencing and hardening auto-downloaded runtime dependency detection/permissions, so repeated debug sessions work reliably and dependencies aren’t unnecessarily re-downloaded.

Changes:

  • Make design-time API shutdown awaitable (including Windows taskkill) to avoid file-lock/cleanup races that break subsequent debug runs.
  • Improve runtime dependency validation/resolution (FuncCoreTools/node/dotnet) including execute-permission repair and Windows .exe path fallback.
  • Expand E2E/unit coverage around the updated dependency readiness and workflow/project discovery behaviors.

Reviewed changes

Copilot reviewed 38 out of 38 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
apps/vs-code-designer/src/test/ui/runHelpers.ts Add FuncCoreTools permission diagnostics for runtime readiness troubleshooting.
apps/vs-code-designer/src/test/ui/run-e2e.js Harden E2E dependency readiness by checking/repairing executable permissions (incl. gozip).
apps/vs-code-designer/src/test/ui/designerHelpers.ts Validate both func + gozip executability and prefer func candidates when selecting a path.
apps/vs-code-designer/src/main.ts Await async shutdown of all design-time APIs during extension deactivation.
apps/vs-code-designer/src/app/utils/nodeJs/nodeJsVersion.ts Improve Windows Node binary resolution by trying .exe variants.
apps/vs-code-designer/src/app/utils/nodeJs/test/nodeJsVersion.test.ts Add unit tests for Windows node vs node.exe resolution behavior.
apps/vs-code-designer/src/app/utils/languageServerProtocol.ts Retry removal on locked-file errors (EBUSY/EPERM) and export locked-file formatting.
apps/vs-code-designer/src/app/utils/funcCoreTools/funcVersion.ts Add FuncCoreTools permission repair/validation and ensure managed binaries are executable.
apps/vs-code-designer/src/app/utils/funcCoreTools/test/funcVersion.test.ts Add tests for permission repair and managed FuncCoreTools executability validation.
apps/vs-code-designer/src/app/utils/devContainerUtils.ts Add sync devcontainer detection for use in sync dependency checks.
apps/vs-code-designer/src/app/utils/codeless/startDesignTimeApi.ts Make stop APIs async and await Windows taskkill completion to reduce lock races.
apps/vs-code-designer/src/app/utils/codeless/common.ts Guard against missing projectPath in Azure connector details logic with telemetry.
apps/vs-code-designer/src/app/utils/codeless/test/startDesignTimeApi.test.ts Add coverage for awaiting Windows taskkill callbacks before resolving stop.
apps/vs-code-designer/src/app/utils/codeless/test/common.test.ts Add test for undefined projectPath handling.
apps/vs-code-designer/src/app/utils/binaries.ts Improve install/validate behavior: permission repair, devcontainer sync checks, .exe fallback, and cleaner GitHub fallback paths.
apps/vs-code-designer/src/app/utils/test/languageServerProtocol.test.ts Add tests for EPERM detection and retry behavior during LSP install.
apps/vs-code-designer/src/app/utils/test/binaries.test.ts Add tests for Windows .exe fallback, sync existence checks, and GitHub lookup fallback telemetry.
apps/vs-code-designer/src/app/commands/pickFuncProcess.ts Stop prior func task before build/publish and split codeful vs custom-code build paths.
apps/vs-code-designer/src/app/commands/nodeJs/validateNodeJsIsLatest.ts Fix async dependency existence check by awaiting binariesExist.
apps/vs-code-designer/src/app/commands/nodeJs/test/validateNodeJsIsLatest.test.ts Add tests ensuring GitHub latest checks only happen when appropriate.
apps/vs-code-designer/src/app/commands/initProjectForVSCode/initScriptProjectStep.ts Use sync binaries existence to avoid async misuse during task creation.
apps/vs-code-designer/src/app/commands/initProjectForVSCode/initProjectStep.ts Use sync binaries existence to avoid async misuse during task creation.
apps/vs-code-designer/src/app/commands/initProjectForVSCode/initDotnetProjectStep.ts Use sync binaries existence to avoid async misuse during task creation.
apps/vs-code-designer/src/app/commands/funcCoreTools/validateFuncCoreToolsIsLatest.ts Await design-time API shutdown before updating func tools.
apps/vs-code-designer/src/app/commands/funcCoreTools/validateFuncCoreToolsInstalled.ts Validate managed FuncCoreTools nested executability before/after invoking func.
apps/vs-code-designer/src/app/commands/funcCoreTools/test/validateFuncCoreToolsInstalled.test.ts Add coverage for managed nested executability gating behavior.
apps/vs-code-designer/src/app/commands/dotnet/validateDotNetIsLatest.ts Fix async dependency existence check by awaiting binariesExist.
apps/vs-code-designer/src/app/commands/dotnet/test/validateDotNetIsLatest.test.ts Add tests ensuring latest checks are gated by binaries existence.
apps/vs-code-designer/src/app/commands/createWorkflow/createWorkflow.ts Improve project root discovery across multi-folder workspaces; throw user-friendly error when absent.
apps/vs-code-designer/src/app/commands/createWorkflow/createLogicAppWorkflow.ts Allow workflow creation in folder-opened projects (no workspace file required).
apps/vs-code-designer/src/app/commands/createWorkflow/test/createWorkflow.test.ts Add tests for multi-folder fallback and no-project error behavior.
apps/vs-code-designer/src/app/commands/createWorkflow/test/createLogicAppWorkflow.test.ts Update tests to reflect folder-opened workflow creation support.
apps/vs-code-designer/src/app/commands/createProject/createCustomCodeProjectSteps/initCustomCodeScriptProjectStep.ts Use sync binaries existence for task env selection.
apps/vs-code-designer/src/app/commands/createProject/createCustomCodeProjectSteps/initCustomCodeProjectStep.ts Use sync binaries existence for task env selection.
apps/vs-code-designer/src/app/commands/createNewCodeProject/CodeProjectBase/CreateLogicAppVSCodeContents.ts Use sync binaries existence when generating tasks for new codeful projects.
apps/vs-code-designer/src/app/commands/createNewCodeProject/CodeProjectBase/test/CreateLogicAppVSCodeContents.test.ts Update mocks for new sync binaries existence helper.
apps/vs-code-designer/src/app/commands/buildCustomCodeFunctionsProject.ts Remove codeful SDK cache invalidation from build path.
apps/vs-code-designer/src/app/commands/test/pickFuncProcess.test.ts Add tests for codeful/custom-code branching and waiting for prior func task to stop.

Comment thread apps/vs-code-designer/src/app/utils/codeless/startDesignTimeApi.ts Outdated
Comment thread apps/vs-code-designer/src/app/utils/nodeJs/nodeJsVersion.ts Outdated
lambrianmsft and others added 7 commits June 15, 2026 14:30
Normalize Windows-style project paths before deriving the Logic App name so Linux CI and non-workspace create workflow paths agree.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Cover isDevContainerWorkspaceSync so changed-file coverage stays above the PR gate.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Allow hyphenated workflow names in the create workspace webview validation path, expand validator/message coverage, and harden LSP SDK extraction against transient Windows EPERM locks. Add a manual Windows ExTester repro mode for real LSP extraction ACL failures.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep the consolidated hyphenated workflow-name coverage as a validation assertion without requiring the shared pre-creation form to have every required field populated.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Make the outdated NodeJS prompt nonblocking, refresh the managed Node command after user-selected updates, and add output-channel diagnostics for local/feed/latest versions and warning decisions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
lambrianmsft and others added 2 commits June 26, 2026 13:37
…root workspaces

Previously, createWorkflow always scanned workspace folders in order and
picked the first Logic App project found, ignoring the explorer context
menu URI. In multi-root workspaces this caused workflows to be placed in
the wrong project.

Now the command accepts the URI from the explorer context menu, resolves
the containing workspace folder via vscode.workspace.getWorkspaceFolder,
and targets that specific project. The panel name also includes the
project name for per-project isolation of cached webview panels.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
When creating a workflow in a multi-root workspace, the webview now shows
a Project dropdown allowing the user to select which Logic App project
to create the workflow in. The dropdown is pre-selected when right-click
context provides the project, and shows a 'Select Project' placeholder
when invoked from the command palette.

- Collect all available Logic App projects and send to webview
- Add Project dropdown with Fluent UI in createWorkflowSetup
- Require project selection before allowing workflow creation
- Resolve project from webview selection in createHandler
- Update unit tests for new architecture

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
lambrianmsft and others added 7 commits June 28, 2026 08:37
Prevents workflow names from colliding with default Logic App project
folders (Artifacts, lib, workflow-designtime, Tests, diagnostics, etc.).
The check is case-insensitive and applies across all workflow creation
flows since validateWorkflowName is the central validation point.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The Create Project webview now checks all physical directories in the
workspace root (not just .code-workspace folder entries) to prevent
creating a logic app project with a name that collides with any existing
folder — including C# custom code project folders that may not appear in
the workspace file.

Changes:
- createProject.ts: enumerate disk directories via readDirectory and pass
  as existingFolders to the webview
- createWorkspaceSlice: add existingFolders to state and initializeProject
- logicAppTypeStep/dotNetFrameworkStep: validate against existingFolders
  (case-insensitive)
- createWorkspace.tsx: isNameAlreadyInWorkspace checks existingFolders
- Updated all test state helpers to include new fields

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add 5 E2E behavior tests for reserved workflow names (Artifacts, lib,
  workflow-designtime, case-insensitive, clear-on-valid)
- Add 3 unit tests for resetState race condition: verify CreateLogicApp
  and CreateWorkflow preserve state (existingFolders, availableProjects)
  after mount instead of wiping them with resetState
- Fix CreateLogicApp resetState race condition: only dispatch setFlowType
  instead of resetState which wiped existingFolders populated by
  initializeProject
- Remove verbose diagnostic logging from workspaceWebviewCommandHandler
- Add concise init logging for webview initialize_frame

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Resolve 6 file conflicts preserving both PR and main functionality:
- binaries.ts: combine integrity-download wrapper with dev-container sync
- binaries.test.ts: merge test coverage from both sides (72 tests)
- validateNodeJsIsLatest.ts: preserve warning logic + setNodeJsCommand repair
- validateNodeJsIsLatest.test.ts: merge both test suites
- nodeJsVersion.ts: keep Windows .exe normalization
- run-e2e.js: keep runtime dep override + experimental bundle settings

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Widen execTaskkill to accept number | string | undefined (childFuncPid is string)
- Add undefined guard to avoid crash when PID is missing
- Add test proving node.exe input doesn't produce node.exe.exe

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace indirect setNodeJsCommand test with direct resolveNodeJsCommand tests:
- node → node.exe (appends extension)
- node.exe → node.exe (no doubling)
- node.EXE → node.EXE (case preserved)
- node.Exe → node.Exe (mixed case)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@lambrianmsft lambrianmsft changed the title fix(vscode): Debugging regressions feat(vscode): Add webview validation and E2E test infrastructure Jun 30, 2026
…regressions

# Conflicts:
#	apps/vs-code-designer/src/app/commands/createWorkflow/__test__/createWorkflow.test.ts
Comment thread apps/vs-code-designer/src/test/ui/designerHelpers.ts Outdated
Comment thread apps/vs-code-designer/src/test/ui/designerHelpers.ts Outdated
Comment thread apps/vs-code-designer/src/test/ui/designerHelpers.ts Outdated
Comment thread apps/vs-code-designer/src/test/ui/designerHelpers.ts
Comment thread apps/vs-code-designer/src/test/ui/run-e2e.js Outdated
Comment thread apps/vs-code-designer/src/test/ui/run-e2e.js Outdated
Comment thread apps/vs-code-designer/src/test/ui/runHelpers.ts
lambrianmsft and others added 2 commits June 30, 2026 16:32
- Extract shared isExecutableFile to sharedDepUtils.js (de-dupe C5)
- Remove redundant .startsWith('func') filter (C1, C2)
- Add F_OK vs X_OK Windows explanation in shared utility (C3)
- Add comment: multiple func candidates expected and all validated (C4)
- Centralize LSP stale artifact names with source-of-truth doc (C6)
- Add comment: default deps path is intentional for E2E (C7)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ript

- Enables direct import of LSP constants (no more hardcoded strings)
- Adds type annotations across the 2600-line E2E launcher
- Extracts languageServerProtocolConstants.ts for vscode-free imports
- Updates all invocation paths: src/test/ui/run-e2e.js -> out/test/run-e2e.js
- Updates CI workflow, package.json, and documentation references

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@lambrianmsft lambrianmsft changed the title feat(vscode): Add webview validation and E2E test infrastructure feat(vscode): Add workflow/webview validation and E2E launcher migration Jul 1, 2026
Fix check-freshness CI: edit docs/ai-setup/ sources (not generated files)
and regenerate with pnpm run ai:generate.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
lambrianmsft and others added 3 commits July 1, 2026 12:34
… openFolderInSession

Replace probabilistic sleep()-based timing with deterministic Selenium
explicit waits (driver.wait + until.elementIsEnabled) to fix flaky
'element not interactable' errors on CI runners.

Changes:
- Wait for command palette input to be interactive (not just DOM-present)
- Add click-to-focus on workbench before Ctrl+Shift+P (ensures focus)
- Wait for command list to populate before pressing Enter
- Wait for file dialog input to be interactive before typing path
- Replace fixed 5s post-Enter sleep with polling wait for folder open
- Increase waitForWorkbenchReady timeout from 15s to 20s
- Add waitForElement helper for DOM-presence polling

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@lambrianmsft lambrianmsft merged commit 967b27d into Azure:main Jul 1, 2026
41 of 44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-validated risk:medium Medium risk change with potential impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants