Strip build metadata from CLI banner version display#15168
Strip build metadata from CLI banner version display#15168davidfowl merged 1 commit intorelease/13.2from
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15168Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 15168" |
There was a problem hiding this comment.
Pull request overview
This PR updates the Aspire CLI banner to display a cleaner version string by removing SemVer build metadata (anything after +) from the version shown in the animated banner.
Changes:
- Strip build metadata from
VersionHelper.GetDefaultTemplateVersion()for banner display. - Keep the banner’s formatting logic unchanged aside from the displayed version value.
| // Strip build metadata (everything after '+') for display purposes. | ||
| var plusIndex = cliVersion.IndexOf('+', StringComparison.Ordinal); | ||
| if (plusIndex >= 0) | ||
| { | ||
| cliVersion = cliVersion[..plusIndex]; | ||
| } |
There was a problem hiding this comment.
The new behavior (stripping build metadata after '+') is user-visible but isn’t covered by an automated regression test. Consider adding coverage that asserts the banner’s version text does not include '+' build metadata (e.g., an E2E banner test that searches for absence of '+' on the version line, or a small unit test around an extracted helper used by BannerService).
🎬 CLI E2E Test RecordingsThe following terminal recordings are available for commit
📹 Recordings uploaded automatically from CI run #22997767592 |
IEvangelist
left a comment
There was a problem hiding this comment.
Yeah, I assumed it wasn't an issue for stable release - but I do like this change.
|
Hmm it says 13.3 how? |
|
@joperezr we didn’t put 13.3 things in the 13.2 branch again right? |
Description
Strip build metadata (everything after
+) from the CLI version string displayed in the banner. Previously, the full version including build metadata (e.g.9.3.0-preview.1.12345+abcdef) was shown, which is noisy and not useful for users. Now only the SemVer portion is displayed (e.g.9.3.0-preview.1.12345).I don't know if this will be a problem in release version, but it triggered me when viewing banner in daily/PR builds. Note:
--versionstill prints the full valueBefore:

After:

Checklist
<remarks />and<code />elements on your triple slash comments?aspire.devissue: