Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Oct 7, 2025

Fix deprecated :: separator in dotnet new update suggestions

This PR fixes the issue where dotnet new <sometemplate> suggests using the deprecated package::version syntax instead of the correct package@version syntax when advising about available upgrades.

Changes Completed:

  • Update TemplatePackageDisplay.cs DisplayUpdateCheckResult method (line 50, 58)
  • Update TemplatePackageCoordinator.cs DisplayUpdateCheckResult method (line 148, 156)
  • Update TemplatePackageDisplay.cs DisplayUpdateCheckResults method (line 306, 311)
  • Update TemplatePackageCoordinator.cs DisplayUpdateCheckResults method (line 847, 852)
  • Update other display strings that show package::version format (lines 71, 169, 318, 474, 636)
  • Update tests in DotnetNewUpdateTests.cs to validate the @ separator is used in suggestions
  • Build and verify changes compile successfully
  • All 20 integration tests for dotnet new update functionality pass
  • Fix approval tests for built-in package install scenarios
  • Fix InstallRequest.DisplayName usage to replace :: with @
  • Fix TemplatePackage.DisplayName usage in success messages

Files Changed:

  1. src/Cli/Microsoft.TemplateEngine.Cli/TemplatePackageDisplay.cs (12 changes)
  2. src/Cli/Microsoft.TemplateEngine.Cli/TemplatePackageCoordinator.cs (18 changes)
  3. test/dotnet-new.IntegrationTests/DotnetNewUpdateTests.cs (24 changes)
  4. test/dotnet-new.IntegrationTests/DotnetNewInstallTests.Approval.cs (3 changes)
  5. test/dotnet-new.IntegrationTests/DotnetNewInstantiateTests.Approval.cs (2 changes)
  6. test/dotnet-new.IntegrationTests/Approvals/*.verified.txt (4 approval files updated)

Summary:

The fix replaces all occurrences of :: with @ in package version display strings and command suggestions throughout the template engine CLI. This includes:

  • Update check notifications (single and bulk)
  • Built-in package availability warnings
  • Install request display names
  • Force command suggestions
  • Success messages after installation

Example output (before):

An update for template package 'Aspire.ProjectTemplates::9.4.0' is available.
To update the package use:
   dotnet new install Aspire.ProjectTemplates::9.5.0

Example output (after):

An update for template package '[email protected]' is available.
To update the package use:
   dotnet new install [email protected]

Testing:

✅ All 20 DotnetNewUpdateTests integration tests pass
✅ All 4 built-in package approval tests pass:

  • CanShowWarningIfPackageIsAvailableFromBuiltInSources
  • CanInstallPackageAvailableFromBuiltInsWithForce
  • CannotInstallPackageAvailableFromBuiltIns
  • CannotInstallMultiplePackageAvailableFromBuiltIns
    ✅ Manual testing confirms correct output
    ✅ Build succeeds with no warnings or errors

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@Copilot Copilot AI changed the title [WIP] Fix deprecated syntax in dotnet new install command Fix dotnet new to suggest @ instead of deprecated :: separator in update notifications Oct 7, 2025
Copilot finished work on behalf of marcpopMSFT October 7, 2025 19:39
@Copilot Copilot AI requested a review from marcpopMSFT October 7, 2025 19:39
@marcpopMSFT
Copy link
Member

@copilot fix the templates tests that are failing because of the switch over from :: to @
CanShowWarningIfPackageIsAvailableFromBuiltInSources
CanInstallPackageAvailableFromBuiltInsWithForce
CannotInstallPackageAvailableFromBuiltIns
CannotInstallMultiplePackageAvailableFromBuiltIns

Copy link
Contributor Author

Copilot AI commented Oct 7, 2025

@copilot fix the templates tests that are failing because of the switch over from :: to @
CanShowWarningIfPackageIsAvailableFromBuiltInSources
CanInstallPackageAvailableFromBuiltInsWithForce
...

Fixed in commit 5a2929d. All 4 approval tests now pass:

  • CanShowWarningIfPackageIsAvailableFromBuiltInSources ✅
  • CanInstallPackageAvailableFromBuiltInsWithForce ✅
  • CannotInstallPackageAvailableFromBuiltIns ✅
  • CannotInstallMultiplePackageAvailableFromBuiltIns ✅

The changes ensure that all DisplayName usages now show @ instead of :: for package versions, including:

  • InstallRequest display names in package lists
  • Force command suggestions
  • Success messages after installation
  • Updated test scrubbers and approval files

Copilot finished work on behalf of marcpopMSFT October 7, 2025 23:48
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.

2 participants