Skip to content

Use PR-specific version for dogfood VS Code extension#15892

Open
adamint wants to merge 4 commits intomicrosoft:mainfrom
adamint:fix/extension-pr-version
Open

Use PR-specific version for dogfood VS Code extension#15892
adamint wants to merge 4 commits intomicrosoft:mainfrom
adamint:fix/extension-pr-version

Conversation

@adamint
Copy link
Copy Markdown
Member

@adamint adamint commented Apr 4, 2026

Description

When installing the VS Code extension from a PR dogfood build, the version is always the same as the marketplace release (currently 1.0.7 from package.json), making it impossible to distinguish a dogfooded extension from a released one.

This PR sets the extension VSIX version to 0.0.<PR_NUMBER> for PR builds, so dogfooded extensions are clearly distinguishable from marketplace releases. The version 0.0.X was chosen because:

  • VS Code extensions don't support semver pre-release labels in version strings
  • 0.0.X is obviously non-release (major=minor=0)
  • The PR number identifies which PR the extension came from

Changes

  1. ci.yml: Compute EXTENSION_VERSION_OVERRIDE=0.0.<PR_NUMBER> alongside the existing VERSION_SUFFIX_OVERRIDE and pass it to tests.yml
  2. tests.yml: Accept extensionVersionOverride input and pass --version to vsce package when set
  3. Extension.proj: Support ExtensionVersionOverride MSBuild property for local builds (dotnet build Extension.proj /p:ExtensionVersionOverride=0.0.99)

Non-PR builds (push to main/release) continue using the version from package.json.

Fixes #15589

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
    • No
  • Does the change require an update in our Aspire docs?
    • Yes
    • No

For PR builds, set the extension VSIX version to 0.0.<PR_NUMBER> so
dogfooded extensions are clearly distinguishable from marketplace
releases. The version override flows from ci.yml through tests.yml to
the vsce package command.

Also support ExtensionVersionOverride MSBuild property in Extension.proj
for local builds (e.g. dotnet build /p:ExtensionVersionOverride=0.0.99).

Fixes microsoft#15589
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 4, 2026

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15892

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 15892"

vsce interprets --version as 'print tool version'. The package version
must be passed as a positional argument: vsce package <version>.
@adamint adamint marked this pull request as ready for review April 4, 2026 04:27
@adamint adamint requested review from Copilot and radical April 4, 2026 04:28
@adamint adamint self-assigned this Apr 4, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the VS Code extension build/packaging pipeline so PR dogfood builds can use a PR-specific extension version (intended as 0.0.<PR_NUMBER>) instead of the Marketplace package.json version, making dogfooded builds distinguishable.

Changes:

  • Add an EXTENSION_VERSION_OVERRIDE output in ci.yml for PR runs and pass it into the reusable tests.yml workflow.
  • Add a extensionVersionOverride input to tests.yml and thread it into the VSIX packaging command.
  • Add an ExtensionVersionOverride MSBuild property to extension/Extension.proj to influence VSIX artifact naming and intended packaging behavior.

Reviewed changes

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

File Description
.github/workflows/ci.yml Computes and forwards an extension version override for PR builds.
.github/workflows/tests.yml Accepts the override input and attempts to pass it to vsce package during VSIX creation.
extension/Extension.proj Adds an override property intended to affect the packaged VSIX version and output artifact naming.

vsce package does not have a --version flag for setting the package
version (--version prints the tool version). The [version] positional
arg triggers npm version bump semantics, not an explicit version set.

Instead, use 'npm version --no-git-tag-version' in CI and 'node -e'
in Extension.proj to update package.json before packaging.
Copy link
Copy Markdown
Member

@JamesNK JamesNK left a comment

Choose a reason for hiding this comment

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

Two low-severity hardening suggestions around input interpolation in shell/JS contexts. The core logic looks correct.

…use npm version

- Use 99.0.<PR> instead of 0.0.<PR> so dogfood builds rank above stable releases (sebastienros)
- Use env var for inputs interpolation in tests.yml run block (JamesNK)
- Replace node -e one-liner with npm version for consistency and to avoid injection (radical, JamesNK)
- Save/restore package.json so override builds don't leave a dirty tree (sebastienros)
- Skip node -p version extraction when ExtensionVersionOverride is set (radical)
- Keep Extension.proj override path for local builds and AzDO parity
@radical
Copy link
Copy Markdown
Member

radical commented Apr 8, 2026

/create-issue

@github-actions

This comment was marked as off-topic.

@adamint
Copy link
Copy Markdown
Member Author

adamint commented Apr 8, 2026

/create-issue

what is this?

@radical
Copy link
Copy Markdown
Member

radical commented Apr 8, 2026

/create-issue

what is this?

It is a new workflow that is not ready yet. It will be used to create issues from test failures on PRs.

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.

Dogfood VS Code extension version should indicate PR hive

6 participants