Skip to content

Show preview version warning at shell startup - #193

Merged
Mike Krüger (mkrueger) merged 3 commits into
mainfrom
dev/mkrueger/welcome-preview-banner
Aug 24, 2026
Merged

Mike Krüger (mkrueger) merged 3 commits into
mainfrom
dev/mkrueger/welcome-preview-banner

Conversation

@mkrueger

@mkrueger Mike Krüger (mkrueger) commented Aug 20, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • display a prominent PREVIEW VERSION warning with the assembly display version on the welcome screen
  • repeat the warning below the compact version/status line when the welcome screen is not shown at launch
  • use the same display-version format as the version command, without build metadata
  • clarify that commands, output, and behavior may change before general availability
  • add regression coverage for placeholder replacement and compact startup output

Validation

  • dotnet test CosmosDBShell.Tests/CosmosDBShell.Tests.csproj --filter "FullyQualifiedName~CosmosShell.Tests.CommandTests.WelcomeCommandTests" --no-restore (5 passed)
  • dotnet test CosmosDBShell.Tests/CosmosDBShell.Tests.csproj --filter "FullyQualifiedName~LocalizationKeyAuditTests" --no-restore (9 passed)
  • dotnet build CosmosDBShell/CosmosDBShell.csproj --no-restore
  • dotnet build CosmosDBShell.Tests/CosmosDBShell.Tests.csproj --no-restore
  • git diff --check

Startup without welcome:
image

Welcome screen would show up as:
image

This makes it clearer that it's a preview version. After preview the welcome screen should include the version number as well.

@mkrueger
Mike Krüger (mkrueger) requested review from a team and a lite review from Copilot August 20, 2026 15:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a prominent “PREVIEW VERSION” banner to the embedded welcome screen and fills in the runtime display version (consistent with the shell’s display-version contract that strips build metadata), with regression tests to ensure the placeholder is replaced.

Changes:

  • Updated the ANSI welcome screen resource to include a preview banner with a {{VERSION}} placeholder.
  • Replaced the version placeholder at load-time using ShellInterpreter.GetDisplayVersion(...) when reading the embedded resource.
  • Added regression assertions to verify the displayed version is present and the placeholder is not.

Reviewed changes

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

File Description
CosmosDBShell/cosmos_welcome.ans Adds the PREVIEW banner line and {{VERSION}} placeholder to the welcome screen.
CosmosDBShell/Azure.Data.Cosmos.Shell.Core/WelcomeScreen.cs Replaces {{VERSION}} at runtime when loading the embedded ANSI resource.
CosmosDBShell.Tests/CommandTests/WelcomeCommandTests.cs Adds tests to validate version substitution and ensure the placeholder is removed.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-code-quality

github-code-quality Bot commented Aug 20, 2026 •

Copy link
Copy Markdown

Code Coverage Overview

Languages: C#

C# / code-coverage/dotnet

The overall line coverage in commit 5dee1b0 in the dev/mkrueger/welcome... branch remains at 61%, unchanged from commit 48b107c in the main branch.

Show a line coverage summary of the most impacted files.
File main 48b107c dev/mkrueger/welcome... 5dee1b0 +/-
D:\a\CosmosDBSh...elcomeScreen.cs 100% 94% -6%
D:\a\CosmosDBSh...lInterpreter.cs 57% 57% 0%

Updated August 21, 2026 10:13 UTC

Copilot AI review requested due to automatic review settings August 21, 2026 10:03
@mkrueger Mike Krüger (mkrueger) changed the title Show preview version on welcome screen Aug 21, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

Suppressed comments (1)

CosmosDBShell/Azure.Data.Cosmos.Shell.Core/WelcomeScreen.cs:39

  • WelcomeScreen.Load calls ShellInterpreter.GetDisplayVersion, which forces ShellInterpreter type initialization. Because ShellInterpreter has a static field Instance = new() (ShellInterpreter.cs:28), this will eagerly create the singleton and run its constructor (creates config directories, etc.) just to render the welcome ANSI screen. Consider avoiding the ShellInterpreter dependency here and computing the display version locally to prevent those side effects.
        return reader.ReadToEnd()
            .TrimStart('\uFEFF')
            .Replace(VersionPlaceholder, ShellInterpreter.GetDisplayVersion(assembly), StringComparison.Ordinal);
Copilot AI review requested due to automatic review settings August 21, 2026 10:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

Suppressed comments (2)

CosmosDBShell/Azure.Data.Cosmos.Shell.Core/WelcomeScreen.cs:37

  • Welcome screen replaces {{VERSION}} using the Core assembly version (typeof(WelcomeScreen).Assembly), but the status line and version command use typeof(VersionCommand).Assembly. If these assemblies ever diverge, users could see inconsistent version numbers between the welcome screen and startup status/version output.
        return reader.ReadToEnd()
            .TrimStart('\uFEFF')
            .Replace(VersionPlaceholder, ShellInterpreter.GetDisplayVersion(assembly), StringComparison.Ordinal);

CosmosDBShell.Tests/CommandTests/WelcomeCommandTests.cs:19

  • This test derives the expected display version from WelcomeScreen's assembly, but ShellInterpreter.PrintStartupStatus/PrintVersion use VersionCommand's assembly. If the implementation is updated for consistency, align the test to the same assembly so it validates the user-visible version.
        var expectedVersion = ShellInterpreter.GetDisplayVersion(typeof(WelcomeScreen).Assembly);

        Assert.Contains($"PREVIEW VERSION {expectedVersion}", WelcomeScreen.Text, StringComparison.Ordinal);
        Assert.DoesNotContain("{{VERSION}}", WelcomeScreen.Text, StringComparison.Ordinal);
@mkrueger
Mike Krüger (mkrueger) merged commit 22ec83a into main Aug 24, 2026
11 checks passed
@mkrueger
Mike Krüger (mkrueger) deleted the dev/mkrueger/welcome-preview-banner branch August 24, 2026 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants