Repository navigation
Isolated SDK candidate testing infra, Windows F5 host fixes, and native C# Swagger path inference fix - #22
Draft
lambrianmsft wants to merge 4 commits into
Draft
lambrianmsft wants to merge 4 commits into
lambrianmsft wants to merge 4 commits into
Conversation
- Add local-candidate infrastructure (apps/vs-code-designer/src/app/utils/localCandidate*.ts) to install/validate/select a sealed, isolated SDK/runtime candidate for private extension testing: workspace preparation, task migration/idempotent recognition of already-migrated host tasks, and host/process readiness checks. - Harden Windows F5/debug prerequisites: process-architecture env propagation, PowerShell child/listener process discovery (get-child-processes.ps1, findChildProcess.ts, pickFuncProcess.ts), and func host task port/listener conflict handling (funcHostTask.ts, funcHostTaskEnv.ts). - Fix shared native-C#-path Swagger operation inference: decode string.Format(...)/encodeURIComponent(...) encoded path arguments so operation id/method resolution and dependent path-parameter initialization work for native-C# (codeful) actions instead of only literal/WDL routes (libs/logic-apps-shared/src/parsers/lib/swagger/nativeCSharpPath.ts, consumed from libs/designer and libs/designer-v2 swagger operation/inputsbuilder utils). - Misc supporting changes: createWorkspace/cloudToLocal/binaries/bundleFeed updates for candidate installs, connection panel recovery test coverage, and webview communication fixes for create-workspace retry flows. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
| ); | ||
| } | ||
| } else { | ||
| const html = source.replace(/<!--[\s\S]*?-->/g, ''); |
🤖 AI PR Validation ReportPR Review ResultsThank you for your submission! Here's detailed feedback on your PR title and body compliance:❌ PR Title
|
| Section | Status | Recommendation |
|---|---|---|
| Title | ❌ Fail | Add required prefix (e.g., feat: or fix:) or split PRs |
| Commit Type | Select one primary type or split PRs | |
| Risk Level | ❌ Fail | Add risk:medium label to the PR (body already selects Medium) |
| What & Why | ✅ Pass | Keep as-is; optional one-line summary |
| Impact of Change | ✅ Pass | Add rollback/support note if relevant |
| Test Plan | ✅ Pass | Unit tests present; E2E/manual justification acceptable |
| Contributors | Add credits if appropriate | |
| Screenshots/Videos | ✅ Pass | Not required for these changes |
Action items (blocking):
- Update PR title to start with an allowed prefix (e.g.,
feat:orfix:) or split the work into separate PRs. - Add the
risk:mediumlabel to this PR (label name must exactly matchrisk:medium).
After those two changes this review will be able to re-evaluate; the other suggestions are non-blocking.
Final note: Advised risk = medium (shared parser + extension runtime impact). Ensure the PR label is risk:medium to match.
Powered by: Copilot CLI (claude-opus-4.8) | Last updated: Tue, 06 Oct 2026 00:34:42 GMT
…documented Corrects and completes the manual candidate-switch tooling: - copy-candidate-workspace.js: fixed mislabeled destination-overwrite check (was described as "stale-source protection"), excluded lib/codeful (regenerated build output) and .nuget (restore cache), added SHA-256 fingerprinting (schemaVersion 2), and split drift detection into the correctly scoped assertOriginalSourceUnchangedSincePrepare (compares the ORIGINAL --source against copy-time fingerprints -- the real staleness gate) vs assertDestinationCopyIntegrity (dest-vs-dest corruption check, optional). - retarget-candidate-workspace.js (new): rewrites a copied codeful project's .csproj PackageReference version and nuget.config packageSources/current value to a new candidate, reusing CreateLogicAppWorkspace.ts's exact literal-replace/escaping technique. Confirmed by direct source inspection that this retargeting is NOT automatic for an already-copied project (createCodefulWorkflowFile only renders these values at fresh-project creation, permanently skipped once Program.cs exists), unlike tasks.json (migrateLocalCandidateTasks, automatic at F5 time) and LSP SDK selection (extension-host runtime state, no project-side retargeting needed at all). - detect-active-candidate-profile.js (new): read-only enumeration (Get-CimInstance Win32_Process / ps) to refuse relaunching against a --user-data-dir an existing process already owns, which would otherwise silently reuse the existing window and ignore the new candidate's launch arguments. Never kills or signals a process; only reports the owning pid(s)/command line(s). - launch-candidate-workspace.js (new): composes the above three pieces into prepareCandidateWorkspace (pure file-system) + launchCandidateWorkspace (refuses on active-profile conflict, otherwise spawns VS Code detached with the candidate environment variables set on top of the real environment). Spawn/process-enumeration are injectable so tests never launch a real editor or enumerate real processes. - run-candidate-e2e.js: exported runProcess/stopOwnedTree (additive) so the launcher can reuse the existing own-process-tree-only kill logic instead of duplicating it. - Rewrote copyCandidateWorkspace.test.js for the corrected fingerprint semantics and added 9/7/7 new tests for the three new modules (44 total candidate-tooling tests, all passing alongside the existing 32-test runner.test.js). - run-candidate-e2e.md and docs/ai-setup/packages/vs-code-designer.md (regenerating CLAUDE.md and the derived instructions file) documented to match, including which bindings retarget automatically vs which do not, with exact code citations. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…scoping regression tests - scripts/launch-candidate-workspace.js: stop overlaying the developer's real ambient process.env for the manual candidate relaunch. Reuse run-candidate-e2e.js's isolatedEnv/settings exactly as the automated harness does, so HOME/APPDATA/TEMP/NUGET_PACKAGES/PATH are always fully sandboxed into an already-installed sealed --root. Add assertSealedRoot, which verifies --root has the exact directory layout createRoot produces (and, if a receipt.json exists, that it matches --manifest) and refuses with a pointer to the one-time install step rather than creating/repairing a partial root. New CLI surface: --source --dest --manifest --root --node --dotnet --func --nuget-source --code (replacing --candidate-manifest --candidate-root --user-data-dir --extensions-dir). Strip the Mocha-only LA_CANDIDATE_TEST_ROOT/LA_CANDIDATE_TEST_TIMEOUT markers from the launch environment and set LOGICAPPS_LOCAL_CANDIDATE_MANUAL=true (the real product flag that re-enables Azure connector auth under an active local candidate). Write a manualSettings()-derived settings.json that omits azureLogicAppsStandard.silentAuth so a manual session's real sign-in prompt is not silently suppressed. - src/test/candidate/launchCandidateWorkspace.test.js: rewritten for the new surface. Adds coverage for assertSealedRoot (missing root, partial directory layout, manifest mismatch via receipt.json), manualSettings (silentAuth omitted, tool paths preserved), and the full launch path: isolated HOME/TEMP/NUGET_PACKAGES (proven via a poisoned ambient-env probe that must not leak into the spawned child), stripped test-only markers, LOGICAPPS_LOCAL_CANDIDATE_MANUAL=true, PATH built only from the given tool directories, active-profile refusal, and end-to-end stale-source detection wired through main(). - src/test/candidate/copyCandidateWorkspace.test.js: add two regression tests proving the existing lib/codeful build-output exclusion already matches only the exact top-level generated subtree (not any directory merely named lib or codeful anywhere in the tree) for both the copy step and the source-staleness fingerprint check, so authored files like lib/helpers.cs or workflows/codeful/stateful.cs are never silently excluded or left untracked. - scripts/run-candidate-e2e.md: document the reworked launcher's sealed-root requirement, new CLI flags, and the one-time install step it now depends on. All 86 tests in src/test/candidate/*.test.js pass. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…t; correct dest-placement docs - Add assertCandidateInstalled(root, manifestPath) to launch-candidate-workspace.js, wired as the first step of prepareCandidateWorkspace. It mirrors the real extension's own checkInstalled() owner-marker check (app/utils/localCandidate.ts): reads root/candidate/.logicapps-local-candidate.json and verifies schemaVersion/manifestHash/manifestPath against --manifest before any copy/retarget happens. Neither assertSealedRoot (sandbox layout only) nor readCandidateFacts (defers all integrity checks to the installer) previously verified that root/candidate was ever actually installed. - Correct run-candidate-e2e.md: --dest must be nested under root/candidate (e.g. root\candidate\manual-workspace\MyLogicApp), matching the real assertLocalCandidateProject containment check (localCandidateRuntime.ts), not a sibling of root\candidate. The doc's own existing example already used the correct nested form; this adds the explanation and cross-references the new install-order guard. - Add 3 regression tests to launchCandidateWorkspace.test.js: refuses when candidate was never installed, refuses on manifest-hash mismatch against the installed marker, and a positive test proving a nested --dest (root/candidate/manual-workspace/LogicApp) succeeds once properly installed. Candidate test suite: 89 passing (23+7+18+9+32 across the 5 candidate test files; launchCandidateWorkspace.test.js alone: 15 -> 18). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Commit Type
Risk Level
What & Why
Four independent pieces:
Isolated local SDK candidate testing infrastructure (commit
26af4f7ef:apps/vs-code-designer/src/app/utils/localCandidate*.ts-localCandidate.ts,localCandidateHost.ts,localCandidateRuntime.ts,localCandidateTasks.ts,localCandidateWorkspace.ts- plusscripts/run-candidate-e2e.js/.md). This adds the ability to point the extension at a sealed, isolated candidate package (SDK/runtime/LSP bits) for private end-to-end testing: selecting, installing, and staging a candidate bundle and F5 host without overlaying private compiled DLLs into the shipped extension, and making the generatedfunc: host starttask migration idempotent so it recognizes already-migrated or VS Code-resolved task shapes instead of rejecting them as "customized/provider-backed."Reusable manual candidate-switch tooling (commits
b98c85760+97eac385d, underapps/vs-code-designer/scripts/): generic, source-preserving helpers for the manual workflow of copying an edited candidate project into a fresh candidate root, pointing it at a different candidate package/feed, and safely relaunching it:copy-candidate-workspace.js- copies a candidate project tree (excluding regenerated build output under the literal top-levellib/codefuldirectory only - notlibgenerally - and the NuGet restore cache under.nuget), SHA-256 fingerprints it at copy time, and exposesassertOriginalSourceUnchangedSincePrepare(the real staleness gate: compares the original--sourceagainst those copy-time fingerprints) separately from the optionalassertDestinationCopyIntegrity(dest-vs-dest corruption check).retarget-candidate-workspace.js- rewrites a copied codeful project's.csprojPackageReferenceversion andnuget.configpackageSources/currentvalue to point at a new candidate, reusingCreateLogicAppWorkspace.ts's exact literal-replace/escaping technique. Confirmed by direct source inspection that this retargeting is not automatic for an already-copied project (createCodefulWorkflowFileonly renders these values at fresh-project creation and is permanently skipped onceProgram.csexists) - unliketasks.json(migrateLocalCandidateTasks, automatic at F5 time) and LSP SDK selection (pure extension-host runtime state, no project-side retargeting needed).detect-active-candidate-profile.js- read-only process enumeration (Get-CimInstance Win32_Process/ps) that refuses to relaunch against a--user-data-diran existing process already owns (which would otherwise silently reuse that window and ignore the new candidate's launch arguments). Never kills or signals a process; only reports the owning pid(s)/command line(s).launch-candidate-workspace.js- composes the three pieces above intoprepareCandidateWorkspace(pure file-system: copy-if-missing, validate, retarget; re-runs the original-source staleness check every invocation while leaving existing destination edits untouched) andlaunchCandidateWorkspace(refuses on an active-profile conflict or an unsealed/mismatched--root/--manifestpairing viaassertSealedRoot, otherwise spawns VS Code detached). The launcher now reusesrun-candidate-e2e.js's own sealedisolatedEnv/settingsbuilder instead of overlaying the real ambient environment - it strips the two Mocha-only test markers (LA_CANDIDATE_TEST_ROOT/LA_CANDIDATE_TEST_TIMEOUT) from that sandboxed env, setsLOGICAPPS_LOCAL_CANDIDATE_MANUAL=true, and writes a manual settings.json that omitsazureLogicAppsStandard.silentAuth(the harness's auth-suppression flag) so a manual session goes through normal connector sign-in instead of the automated test harness's offline-auth mock.PROCESSOR_ARCHITECTUREand other required Windows metadata are preserved from the real environment before sealing.launch-candidate-workspace.js'sprepareCandidateWorkspaceadditionally refuses, before copying anything, unless the target--root'sroot/candidatewas actually installed by this repo's realinstall()(app/utils/localCandidate.ts): it re-reads that function's own owner-marker file (root/candidate/.logicapps-local-candidate.json) and checks itsmanifestHash/manifestPathagainst--manifest- the same check the real extension'scheckInstalled()performs on every activation (assertCandidateInstalled, new this update). This closes a gap neitherassertSealedRoot(sandbox layout only, never looks atroot/candidate) norreadCandidateFacts(retarget-candidate-workspace.js, which defers all archive/SHA-256 validation to "the installer, already run before this point" per its own header comment) covered.--destis expected to live underroot/candidate(e.g.root\candidate\manual-workspace\MyLogicApp), matching the real extension'sassertLocalCandidateProject(app/utils/localCandidateRuntime.ts), which requires every local-candidate project to be a descendant of the active candidate's root and throws otherwise;run-candidate-e2e.mdis corrected/clarified accordingly (an earlier draft of this PR's guidance incorrectly described--destas a sibling ofroot/candidate- it is not).All four tools' spawn/process-enumeration points are injectable, so their tests never launch a real editor, build a real project, or enumerate real OS processes.
Windows F5/debug prerequisite fixes (commit
26af4f7ef): process-architecture env propagation, PowerShell child/listener-process discovery (get-child-processes.ps1,findChildProcess.ts,pickFuncProcess.ts), and func host task port/listener-conflict handling (funcHostTask.ts,funcHostTaskEnv.ts) - needed for a reliable local F5 debug loop on Windows (dotnet/PowerShell discovery timing, stale listener/port conflicts).Native C# (codeful) Swagger operation inference fix (commit
26af4f7ef:libs/logic-apps-shared/src/parsers/lib/swagger/nativeCSharpPath.ts, consumed by bothlibs/designerandlibs/designer-v2swaggeroperation.ts/inputsbuilder.ts). The SDK's codeful path generation wraps encoded path arguments instring.Format(...)/encodeURIComponent(...)even for literal values (e.g.#{string.Format(global::System.Globalization.CultureInfo.InvariantCulture, "/current/{0}", encodeURIComponent("98058"))}). The designer's run-view "Operation details" previously failed with "Operation Id cannot be determined from definition and swagger" for these actions because the generic resolver didn't understand that shape. This adds static, non-evaluating decoding of that specific shape to recover operation id/method and initialize dependent path parameters. Ordinary literal/WDL routes are unchanged.Supported argument forms (kept as opaque source, never evaluated): balanced nested method calls/indexers/collection literals (e.g.
Choose(values["a/b"], Tuple.Create(1, 2), new[] { "x,y", "z" })), and ordinary or verbatim (@"...") quoted strings, including embedded escapes.Explicitly rejected / fails closed (throws rather than guessing): string interpolation (
$"...") anywhere in an argument - including nested inside an outer call, as confirmed by a dedicated regression using a real ServiceBus#{...sessions/{1}/close...}path whose second argument isencodeURIComponent($"prefix {...}"); triple-quoted/raw strings;//or/*comments; top-level generic type arguments (e.g.Choose<string, int>(...)); non-literal/non-string format templates; and malformed format specifiers (alignment/format strings like{0:D2}, unmatched braces, unused or out-of-range placeholder indices, embedded null markers).Impact of Change
string.Formatpaths. Also fixes Windows-specific F5 debug reliability (stalefunchost port conflicts, PowerShell child-process discovery timeouts, already-migrated task rejection).Test Plan
Passing automated suites:
libs/logic-apps-shared/src/parsers/lib/swagger/__test__/nativeCSharpPath.spec.ts- 32 focused tests: the captured weather fixture, multiple/embedded/repeated placeholders, balanced nested call/indexer/collection-literal arguments, ordinary and verbatim quoted strings, the ServiceBus nested-interpolation case as an explicit negative regression, and malformed/ambiguous shapes that must fail closedlibs/designer+libs/designer-v2swaggeroperation/inputsbuilder__test__- 5 + 5 tests (42 Swagger-fix tests total across all 3 packages)apps/vs-code-designer/src/test/candidate/*- 89 tests across 5 files (copyCandidateWorkspace.test.js23,detectActiveCandidateProfile.test.js7,launchCandidateWorkspace.test.js18,retargetCandidateWorkspace.test.js9,runner.test.js32) - all fixture/stub-based, no real process spawn, editor launch, or process enumeration. ThelaunchCandidateWorkspacesuite covers the sealed-env reuse (isolatedEnv/manualSettings),assertSealedRootlayout/manifest-mismatch rejection, the literallib/codeful-only exclusion scope, and the install-order/containment guard described below (refuses whenroot/candidatewas never installed or was installed against a different--manifest; accepts a--destnested underroot/candidateonce properly installed).apps/vs-code-designerbroader process/webview suites - 401 + 156 testsapps/vs-code-reactcreateWorkspace suites - 20 testspnpm turbo run buildforvscode-designer,vscode-react,@microsoft/logic-apps-designer,@microsoft/logic-apps-designer-v2,@microsoft/logic-apps-shared- all succeedWhat "manual testing" here actually means (bounded, not a full E2E claim):
dotnet --info, port-listener identification) in isolated and baseline shells to localize the Windows prerequisite issues this PR fixes.launch-candidate-workspace.jsagainst a real VS Code install. No new F5 session, editor launch, or workflow run was performed to produce this PR; checkboxes above are left unchecked accordingly.Known gaps / not claimed as verified by this PR:
tsc --noEmit --prettyof the wholevs-code-designerproject (triggered bytsup'sonSuccesshook) surfaces 32 pre-existing type diagnostics across 9 files (mostly ExTestersrc/test/ui/*harness typings and a few unrelated files). Confirmed pre-existing on the branch tip viagit stash/popcomparison, not introduced by this diff, and not fixed here.copy-candidate-workspace.js/retarget-candidate-workspace.js/detect-active-candidate-profile.js/launch-candidate-workspace.jsscripts are source-preserving developer tooling for iterating against a sealed candidate; they are not wired into any CI pipeline or shipped extension command.Contributors
Screenshots/Videos
N/A (backend/parser + infra fix; motivating run-view error was captured in the linked SDK session, not attached here).
Related
SDK-side change: Azure/logicapps-sdk#52 (
fd99e1f)