Skip to content

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
mainfrom
lambrian-microsoft-bundle-setup-for-sdk-ci
Draft

lambrianmsft wants to merge 4 commits into
mainfrom
lambrian-microsoft-bundle-setup-for-sdk-ci

Conversation

@lambrianmsft

@lambrianmsft lambrianmsft commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

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

Four independent pieces:

  1. 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 - plus scripts/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 generated func: host start task migration idempotent so it recognizes already-migrated or VS Code-resolved task shapes instead of rejecting them as "customized/provider-backed."

  2. Reusable manual candidate-switch tooling (commits b98c85760 + 97eac385d, under apps/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-level lib/codeful directory only - not lib generally - and the NuGet restore cache under .nuget), SHA-256 fingerprints it at copy time, and exposes assertOriginalSourceUnchangedSincePrepare (the real staleness gate: compares the original --source against those copy-time fingerprints) separately from the optional assertDestinationCopyIntegrity (dest-vs-dest corruption check).
    • retarget-candidate-workspace.js - rewrites a copied codeful project's .csproj PackageReference version and nuget.config packageSources/current value to point at 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 and is permanently skipped once Program.cs exists) - unlike tasks.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-dir an 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 into prepareCandidateWorkspace (pure file-system: copy-if-missing, validate, retarget; re-runs the original-source staleness check every invocation while leaving existing destination edits untouched) and launchCandidateWorkspace (refuses on an active-profile conflict or an unsealed/mismatched --root/--manifest pairing via assertSealedRoot, otherwise spawns VS Code detached). The launcher now reuses run-candidate-e2e.js's own sealed isolatedEnv/settings builder 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, sets LOGICAPPS_LOCAL_CANDIDATE_MANUAL=true, and writes a manual settings.json that omits azureLogicAppsStandard.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_ARCHITECTURE and other required Windows metadata are preserved from the real environment before sealing.

    launch-candidate-workspace.js's prepareCandidateWorkspace additionally refuses, before copying anything, unless the target --root's root/candidate was actually installed by this repo's real install() (app/utils/localCandidate.ts): it re-reads that function's own owner-marker file (root/candidate/.logicapps-local-candidate.json) and checks its manifestHash/manifestPath against --manifest - the same check the real extension's checkInstalled() performs on every activation (assertCandidateInstalled, new this update). This closes a gap neither assertSealedRoot (sandbox layout only, never looks at root/candidate) nor readCandidateFacts (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. --dest is expected to live under root/candidate (e.g. root\candidate\manual-workspace\MyLogicApp), matching the real extension's assertLocalCandidateProject (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.md is corrected/clarified accordingly (an earlier draft of this PR's guidance incorrectly described --dest as a sibling of root/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.

  3. 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).

  4. Native C# (codeful) Swagger operation inference fix (commit 26af4f7ef: libs/logic-apps-shared/src/parsers/lib/swagger/nativeCSharpPath.ts, consumed by both libs/designer and libs/designer-v2 swagger operation.ts/inputsbuilder.ts). The SDK's codeful path generation wraps encoded path arguments in string.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 is encodeURIComponent($"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

  • Users: Fixes designer run-view "Operation details" errors for native C# (codeful) Swagger-based connector actions with encoded string.Format paths. Also fixes Windows-specific F5 debug reliability (stale func host port conflicts, PowerShell child-process discovery timeouts, already-migrated task rejection).
  • Developers: Adds candidate-testing utilities (selection/staging plus the copy/retarget/active-profile/launch helpers) used only for internal SDK-integration validation; no public designer/extension API changes.
  • System: No architecture changes; the Swagger fix is additive decoding logic in the shared parser, consumed identically by designer v1 and v2.

Test Plan

  • Unit tests added/updated
  • E2E tests added/updated
  • Manual testing completed
  • Tested in:

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 closed
  • libs/designer + libs/designer-v2 swagger operation/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.js 23, detectActiveCandidateProfile.test.js 7, launchCandidateWorkspace.test.js 18, retargetCandidateWorkspace.test.js 9, runner.test.js 32) - all fixture/stub-based, no real process spawn, editor launch, or process enumeration. The launchCandidateWorkspace suite covers the sealed-env reuse (isolatedEnv/manualSettings), assertSealedRoot layout/manifest-mismatch rejection, the literal lib/codeful-only exclusion scope, and the install-order/containment guard described below (refuses when root/candidate was never installed or was installed against a different --manifest; accepts a --dest nested under root/candidate once properly installed).
  • apps/vs-code-designer broader process/webview suites - 401 + 156 tests
  • apps/vs-code-react createWorkspace suites - 20 tests
  • pnpm turbo run build for vscode-designer, vscode-react, @microsoft/logic-apps-designer, @microsoft/logic-apps-designer-v2, @microsoft/logic-apps-shared - all succeed

What "manual testing" here actually means (bounded, not a full E2E claim):

  • Read-only inspection of an already-running local F5 debug host's logs/process/listener state, built package/definition output, and existing run-view evidence from a prior session.
  • Targeted environment/PowerShell probes (child-process discovery, dotnet --info, port-listener identification) in isolated and baseline shells to localize the Windows prerequisite issues this PR fixes.
  • This PR does not claim a freshly re-run, fully verified end-to-end designer UI/debugger-attach workflow against a live candidate SDK build in this session, nor a real invocation of the new launch-candidate-workspace.js against 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:

  • A full tsc --noEmit --pretty of the whole vs-code-designer project (triggered by tsup's onSuccess hook) surfaces 32 pre-existing type diagnostics across 9 files (mostly ExTester src/test/ui/* harness typings and a few unrelated files). Confirmed pre-existing on the branch tip via git stash/pop comparison, not introduced by this diff, and not fixed here.
  • The manual copy-candidate-workspace.js / retarget-candidate-workspace.js / detect-active-candidate-profile.js / launch-candidate-workspace.js scripts 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)

- 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, '');
@lambrianmsft lambrianmsft changed the title Isolated local SDK candidate testing infrastructure + native C# Swagger path fix Isolated SDK candidate testing infra, Windows F5 host fixes, and native C# Swagger path inference fix Oct 5, 2026
@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

🤖 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: Isolated SDK candidate testing infra, Windows F5 host fixes, and native C# Swagger path inference fix
  • Issue: Title does not start with a required prefix (feat:, fix:, chore:, refactor:, perf:, docs:, test:).
  • Recommendation: Prefix the title. If this PR is primarily a new capability, use feat:; if primarily bug fixes, use fix:. Example: feat(vs-code-designer): isolated SDK candidate testing infra and native C# Swagger path fix — or split into two PRs (one feat: and one fix:) if you prefer.

⚠️ Commit Type

  • Multiple boxes checked (feature + fix).
  • PR may be overloaded. Either select a single primary commit type in the template or split into separate PRs for the independent feature vs bug-fix work. Note: multiple selections are a warning (not a block), but keeping one primary type is preferred.

❌ Risk Level

  • Assessment: Body selects Medium which matches the code impact (shared parser changes + extension fixes).
  • Issue: PR is missing the required repo risk label. Add risk:medium to the PR labels. The declared risk (body) must match the label and our advised level (medium).

✅ What & Why

  • Current: Detailed multi-part explanation present.
  • Issue: None — content is thorough and suitable.
  • Recommendation: Keep as-is; consider adding a one-line summary at the top for quick scanning.

✅ Impact of Change

  • Good coverage of Users/Developers/System. No blocking issues.
  • Recommendation: Consider a short bullet for "Support/rollback guidance" if deployers need remediation steps.
    • Users: Fixes run-view errors for native C# Swagger paths; improves Windows F5 reliability.
    • Developers: Adds internal candidate-testing tooling; no public API changes.
    • System: Additive parser logic consumed by designer v1/v2.

✅ Test Plan

  • Assessment: Unit tests added and listed in the body (passes CHECK TESTS). E2E/manual testing explanation provided and justified. Good.

⚠️ Contributors

  • No contributors listed. Nudge: add PM/design/author credits if applicable.

✅ Screenshots/Videos

  • Not required (backend/parser + infra changes). OK.

Summary Table

Section Status Recommendation
Title ❌ Fail Add required prefix (e.g., feat: or fix:) or split PRs
Commit Type ⚠️ Warning 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 ⚠️ Warning Add credits if appropriate
Screenshots/Videos ✅ Pass Not required for these changes

Action items (blocking):

  1. Update PR title to start with an allowed prefix (e.g., feat: or fix:) or split the work into separate PRs.
  2. Add the risk:medium label to this PR (label name must exactly match risk: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

Copilot AI added 3 commits October 5, 2026 16:49
…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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants