Skip to content

Document VS Code extension and expand test coverage#409

Open
clavery wants to merge 2 commits intomainfrom
feature/vscode-docs
Open

Document VS Code extension and expand test coverage#409
clavery wants to merge 2 commits intomainfrom
feature/vscode-docs

Conversation

@clavery
Copy link
Copy Markdown
Collaborator

@clavery clavery commented May 8, 2026

Summary

  • New `/vscode-extension/` docs section (overview with Developer Preview banner, installation with dynamic VSIX download link, configuration reference, feature tour) parallel to the MCP Server section. Sidebar/nav wired up; `ide-integration.md` cross-links so it stays focused on Prophet/IntelliJ.
  • Replace the placeholder activation test with a real Extension Host integration suite (`src/test/integration/activation.test.ts`) that asserts activation, command-registration parity with `package.json`, declared debug type, and view focus-command registration.
  • Fix the long-standing `tsconfig.test.json` `rootDir: src/test` trap. Tests now import production modules directly (deleted the `sandbox-clone-helpers.ts` mirror).
  • New unit tests for `WebDavMappingsProvider` and `SandboxConfigProvider` (no `vscode` import where avoidable). 22 → 66 passing.
  • Extend `ci-vs-extension.yml` path filter to also fire on SDK changes (extension bundles the SDK via esbuild, so SDK regressions can break activation) and lockfile/workspace catalog changes; cache `.vscode-test` binary.
  • Bumped `@vscode/vsce` floor to `^3.9.1`; added `c8` for coverage (no thresholds yet — Extension Host runs out-of-process so reported coverage is a low-bound).
  • Doc-only changeset (`@salesforce/b2c-dx-docs: patch`).

Notes for reviewers

  • Screenshots are placeholders. Each `.png` under `docs/vscode-extension/images/` is a 1×1 PNG so the build resolves; every image site has a `` HTML comment immediately above it. Grep for that marker to find every slot awaiting a real image.
  • VSIX download link is dynamic. `docs/vscode-extension/release.data.ts` is a VitePress build-time data loader that lists GitHub releases, picks the newest `b2c-vs-extension@X.Y.Z`, and exports `{ version, vsixDownloadUrl, ... }`. On any failure (rate-limit, no releases yet, parse error) it returns `unavailable: true` and the page falls back to a "Browse releases" link. This means the docs build never breaks because of a missing release.
  • Release/docs cadence: the floating `b2c-vs-extension@latest` git tag is moved on every VSCE publish but the docs workflow won't auto-rebuild on that — so a freshly published VSCE may briefly trail by one version until the next docs build. Adding a docs-rebuild trigger on `b2c-vs-extension@*` tag pushes is a reasonable separate follow-up.
  • CI coverage: `ci-vs-extension.yml` now also fires on SDK changes and caches the VS Code binary (~150 MB). Marginal cost on SDK PRs is ~90s once the cache warms.

Test plan

  • CI: `ci-vs-extension.yml` runs (66 tests pass under `xvfb-run` on Linux); `ci.yml` runs typecheck + lint for the extension; main CI green for SDK and other packages.
  • Local: `pnpm --filter b2c-vs-extension run test` → 66 passing.
  • Local: `pnpm run docs:build` → clean. Open `docs/.vitepress/dist/vscode-extension/installation.html` and confirm the dynamic VSIX download link renders (or fallback if API was unavailable).
  • Local: `pnpm run lint:agent && pnpm run typecheck:agent` → clean.
  • Visual review of the four new doc pages — install/configuration/features structure, sidebar wiring, top-nav "VS Code" entry.
  • Future: replace placeholder PNGs with real screenshots.

Add a /vscode-extension/ docs section (overview, installation with dynamic
VSIX download link, configuration, features) parallel to the MCP Server
section. Replace the placeholder activation test with a real Extension
Host integration suite, fix the rootDir trap so unit tests can import
production code directly, and add unit tests for WebDavMappingsProvider
and SandboxConfigProvider. Extend ci-vs-extension.yml to also run on SDK
changes and cache the .vscode-test binary.
@github-actions github-actions Bot added the needs-3pl-review PR introduces net-new third-party dependencies and needs discussion label May 8, 2026
@clavery clavery added 3pl-approved Maintainer approved net-new third-party dependency additions and removed needs-3pl-review PR introduces net-new third-party dependencies and needs discussion labels May 8, 2026
- Drop unimplemented "Compare with Instance" diff from features.md and
  remove its placeholder image; the diffCartridge command is stub
  functionality.
- Fix project-root pinning docs: "Use as B2C Commerce Root" only shows on
  a workspace-root folder when the workspace has more than one folder
  open; "Reset" is palette-only.
- Replace internal-source pointer with an inline rule in the cloned
  sandbox indicators paragraph.
- Add 24h TTL to the VSIX release data loader cache so a maintainer who
  cuts a release won't see a stale version on the next local docs build.
- Include pnpm-lock.yaml in the .vscode-test cache key so a test-cli /
  test-electron version bump invalidates the cache.
- Comment the activation test's command-registration check to explain why
  it doubles as a swallowed-failure detector.
- Tidy webdav-mappings.test.ts stub.
@clavery clavery marked this pull request as ready for review May 8, 2026 00:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3pl-approved Maintainer approved net-new third-party dependency additions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant