Repository navigation
Show preview version warning at shell startup - #193
Conversation
There was a problem hiding this comment.
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.
Code Coverage OverviewLanguages: C# C# / code-coverage/dotnetThe overall line coverage in commit 5dee1b0 in the Show a line coverage summary of the most impacted files.
Updated |
There was a problem hiding this comment.
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);
There was a problem hiding this comment.
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);
Summary
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-restoredotnet build CosmosDBShell.Tests/CosmosDBShell.Tests.csproj --no-restoregit diff --checkStartup without welcome:

Welcome screen would show up as:

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