Skip to content

Strip build metadata from CLI banner version display#15168

Merged
davidfowl merged 1 commit intorelease/13.2from
fix/cli-banner-strip-build-metadata
Mar 12, 2026
Merged

Strip build metadata from CLI banner version display#15168
davidfowl merged 1 commit intorelease/13.2from
fix/cli-banner-strip-build-metadata

Conversation

@JamesNK
Copy link
Member

@JamesNK JamesNK commented Mar 12, 2026

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: --version still prints the full value

Before:
image

After:
image

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
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?

Copilot AI review requested due to automatic review settings March 12, 2026 10:35
@github-actions
Copy link
Contributor

🚀 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/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15168

Or

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

Copy link
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

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.

Comment on lines +55 to +60
// Strip build metadata (everything after '+') for display purposes.
var plusIndex = cliVersion.IndexOf('+', StringComparison.Ordinal);
if (plusIndex >= 0)
{
cliVersion = cliVersion[..plusIndex];
}
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

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).

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Contributor

github-actions bot commented Mar 12, 2026

🎬 CLI E2E Test Recordings

The following terminal recordings are available for commit 06d6d6b:

Test Recording
AddPackageInteractiveWhileAppHostRunningDetached ▶️ View Recording
AddPackageWhileAppHostRunningDetached ▶️ View Recording
AgentCommands_AllHelpOutputs_AreCorrect ▶️ View Recording
AgentInitCommand_DefaultSelection_InstallsSkillOnly ▶️ View Recording
AgentInitCommand_MigratesDeprecatedConfig ▶️ View Recording
AspireAddPackageVersionToDirectoryPackagesProps ▶️ View Recording
AspireUpdateRemovesAppHostPackageVersionFromDirectoryPackagesProps ▶️ View Recording
Banner_DisplayedOnFirstRun ▶️ View Recording
Banner_DisplayedWithExplicitFlag ▶️ View Recording
CreateAndDeployToDockerCompose ▶️ View Recording
CreateAndDeployToDockerComposeInteractive ▶️ View Recording
CreateAndPublishToKubernetes ▶️ View Recording
CreateAndRunAspireStarterProject ▶️ View Recording
CreateAndRunAspireStarterProjectWithBundle ▶️ View Recording
CreateAndRunJsReactProject ▶️ View Recording
CreateAndRunPythonReactProject ▶️ View Recording
CreateAndRunTypeScriptStarterProject ▶️ View Recording
CreateEmptyAppHostProject ▶️ View Recording
CreateStartAndStopAspireProject ▶️ View Recording
CreateTypeScriptAppHostWithViteApp ▶️ View Recording
DescribeCommandResolvesReplicaNames ▶️ View Recording
DescribeCommandShowsRunningResources ▶️ View Recording
DetachFormatJsonProducesValidJson ▶️ View Recording
DoctorCommand_DetectsDeprecatedAgentConfig ▶️ View Recording
DoctorCommand_WithSslCertDir_ShowsTrusted ▶️ View Recording
DoctorCommand_WithoutSslCertDir_ShowsPartiallyTrusted ▶️ View Recording
LogsCommandShowsResourceLogs ▶️ View Recording
PsCommandListsRunningAppHost ▶️ View Recording
PsFormatJsonOutputsOnlyJsonToStdout ▶️ View Recording
RestoreGeneratesSdkFiles ▶️ View Recording
RunWithMissingAwaitShowsHelpfulError ▶️ View Recording
SecretCrudOnDotNetAppHost ▶️ View Recording
SecretCrudOnTypeScriptAppHost ▶️ View Recording
StagingChannel_ConfigureAndVerifySettings_ThenSwitchChannels ▶️ View Recording
StopAllAppHostsFromAppHostDirectory ▶️ View Recording
StopAllAppHostsFromUnrelatedDirectory ▶️ View Recording
StopNonInteractiveMultipleAppHostsShowsError ▶️ View Recording
StopNonInteractiveSingleAppHost ❌ Upload failed
StopWithNoRunningAppHostExitsSuccessfully ❌ Upload failed
TypeScriptAppHostWithProjectReferenceIntegration ▶️ View Recording

📹 Recordings uploaded automatically from CI run #22997767592

Copy link
Member

@IEvangelist IEvangelist left a comment

Choose a reason for hiding this comment

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

Yeah, I assumed it wasn't an issue for stable release - but I do like this change.

@davidfowl
Copy link
Contributor

Hmm it says 13.3 how?

@davidfowl davidfowl merged commit 3adcf20 into release/13.2 Mar 12, 2026
746 of 753 checks passed
@davidfowl davidfowl deleted the fix/cli-banner-strip-build-metadata branch March 12, 2026 14:46
@dotnet-policy-service dotnet-policy-service bot added this to the 13.2 milestone Mar 12, 2026
@davidfowl
Copy link
Contributor

@joperezr we didn’t put 13.3 things in the 13.2 branch again right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants