Skip to content

fix: gate VS extension job and harden marketplace version check#571

Merged
rajbos merged 1 commit intomainfrom
fix/release-workflow-vs-job-guard
Apr 10, 2026
Merged

fix: gate VS extension job and harden marketplace version check#571
rajbos merged 1 commit intomainfrom
fix/release-workflow-vs-job-guard

Conversation

@rajbos
Copy link
Copy Markdown
Owner

@rajbos rajbos commented Apr 10, 2026

Problem

When running
elease.yml\ with default settings (VS Code only intent), the \�uild-visualstudio\ job always ran because it had no job-level \if:\ guard — only
eeds: release. This caused two issues:

  1. The expensive VS extension build (~10 min) ran on every VS Code release unnecessarily
  2. Because \publish_marketplace: true\ is the default, it attempted to re-publish the already-published VS extension version, which the marketplace rejected with a duplicate-version error

A secondary bug in the marketplace version check meant the null-array error was silently swallowed (\Cannot index into a null array), letting execution fall through to the publish step instead of stopping cleanly.

Changes

Fix Detail
Job-level \if:\ on \�uild-visualstudio\ Only runs on tag pushes (\�scode/v*) or when \�s_only == true; skipped for manual VS Code-only releases
Null-safe extension lookup Dereferences \�xtensions[0]\ safely before accessing .versions, treating a missing extension as a first-publish
Catch block now hard-fails A failed Marketplace query exits with code 1 instead of warning and proceeding, preventing silent duplicate publishes

…lease workflow

- Add job-level \if\ to \�uild-visualstudio\ so it only runs on tag pushes
  or when \�s_only == true\; manual VS Code-only releases no longer trigger
  the expensive VS extension build
- Fix null-array panic in the VS Marketplace version check: safely dereference
  \�xtensions[0]\ before accessing \.versions\, treating a missing extension
  as a first-publish instead of falling through to the catch block
- Change the catch block from warn-and-proceed to hard-fail so a failed
  Marketplace query can no longer silently allow a duplicate-version publish

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@rajbos rajbos enabled auto-merge (squash) April 10, 2026 08:17
@rajbos rajbos merged commit 80f8996 into main Apr 10, 2026
18 checks passed
@rajbos rajbos deleted the fix/release-workflow-vs-job-guard branch April 10, 2026 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant