Skip to content

Pin Aspire container image tag to the package version, #83 - #88

Merged
paulirwin merged 2 commits into
mainfrom
issue/83
Sep 1, 2026
Merged

Pin Aspire container image tag to the package version, #83#88
paulirwin merged 2 commits into
mainfrom
issue/83

Conversation

@paulirwin

Copy link
Copy Markdown
Member

Fixes #83, and prepares the 1.0.0-beta.4 release.

The problem

The Aspire extension always requested the latest image tag. Docker treats latest as an ordinary tag rather than a moving reference resolved on each run, so a host that had already pulled it kept running the image from that first pull. Upgrading the NuGet package left the container on whatever emulator build the host happened to have — not necessarily the one the new package expects.

The fix

The image tag is now derived from the package's own informational version, so upgrading the package requests a tag the host does not have yet and the pull brings down the matching emulator.

Deriving it from the assembly rather than hardcoding a literal means a release bumps only the csproj <Version>, with no second place to remember to edit. ImageTag_MatchesPackageVersion reads the version straight out of the csproj and asserts the derived tag against it, so the two cannot drift apart. (It deliberately does not compare the derivation against the assembly attribute it is derived from — that would pass no matter what the release version was.)

The tag lines up with what the release actually publishes: the Docker workflow tags images via type=semver,pattern={{version}}, so v1.0.0-beta.4 publishes the image tag 1.0.0-beta.4.

Demo app host

AzureSearchEmulator.Aspire.DemoAppHost overrides the tag back to latest. It tracks the code in the working tree rather than a published release, so the pinned tag does not exist in the registry until the release is tagged.

Version bump

Both AzureSearchEmulator and AzureSearchEmulator.Aspire go to 1.0.0-beta.4.

Verification

  • dotnet build AzureSearchEmulator.sln — clean, 0 warnings (the Aspire project builds with TreatWarningsAsErrors).
  • dotnet test AzureSearchEmulator.sln — 1200 passed / 0 failed (7 Aspire, 973 unit, 220 integration).
  • Confirmed at runtime that the pinned tag resolves to exactly 1.0.0-beta.4, rather than relying on the self-referential assertion.

🤖 Generated with Claude Code

paulirwin and others added 2 commits September 1, 2026 10:27
The Aspire extension always requested the "latest" image tag. Docker treats
"latest" as an ordinary tag rather than a moving reference resolved on each
run, so a host that had already pulled it kept running the image from that
first pull. Upgrading the NuGet package therefore left the container on
whatever emulator build the host happened to have, which is not necessarily
the one the new package expects.

The tag is now derived from the package's own informational version, so
upgrading the package requests a tag the host does not have yet and the pull
brings down the matching emulator. Deriving it from the assembly rather than
hardcoding a literal means a release bumps only the csproj version;
ImageTag_MatchesPackageVersion asserts the derived tag against the version in
the csproj so the two cannot drift apart.

The demo app host overrides the tag back to "latest": it tracks the code in
the working tree rather than a published release, so the pinned tag does not
exist in the registry until the release is tagged.

Also prepares the 1.0.0-beta.4 release by bumping both package versions.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@paulirwin
paulirwin marked this pull request as ready for review September 1, 2026 16:29
@paulirwin
paulirwin enabled auto-merge (squash) September 1, 2026 16:29
@paulirwin
paulirwin merged commit 87c1d4d into main Sep 1, 2026
5 of 6 checks passed
@paulirwin
paulirwin deleted the issue/83 branch September 1, 2026 16:32
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.

Use specific version of container image for Aspire extension

1 participant