Skip to content

Support daily channels for specific previews#54579

Open
dsplaisted wants to merge 2 commits into
dotnet:release/dnupfrom
dsplaisted:fix/dotnetup-daily-bandsuffix
Open

Support daily channels for specific previews#54579
dsplaisted wants to merge 2 commits into
dotnet:release/dnupfrom
dsplaisted:fix/dotnetup-daily-bandsuffix

Conversation

@dsplaisted
Copy link
Copy Markdown
Member

Support channels such as 11.0.1xx-preview.5-daily.

Example:

> dotnetup sdk install 11.0.1xx-preview.5-daily 11.0.1xx-preview.4-daily 10.0.4xx-daily
Installing .NET SDK 11.0.100-preview.5.26302.115, .NET SDK 11.0.100-preview.4.26257.104, .NET SDK
10.0.400-preview.0.26281.104 to C:\Users\Daniel\AppData\Local\dotnet...

  Downloading .NET SDK                 11.0.100-preview.5.26302.115 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100%
  Downloading .NET SDK                 11.0.100-preview.4.26257.104 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100%
  Downloading .NET SDK                 10.0.400-preview.0.26281.104 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100%
  Installing  .NET SDK                 11.0.100-preview.5.26302.115 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100%
  Installing  .NET SDK                 11.0.100-preview.4.26257.104 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100%
  Installing  .NET SDK                 10.0.400-preview.0.26281.104 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100%

Installed at C:\Users\Daniel\AppData\Local\dotnet:
  .NET SDK 11.0.100-preview.5.26302.115
  .NET SDK 11.0.100-preview.4.26257.104
  .NET SDK 10.0.400-preview.0.26281.104

Copilot AI review requested due to automatic review settings June 3, 2026 17:32
@dsplaisted dsplaisted requested review from baronfel and nagilson June 3, 2026 17:32
Copy link
Copy Markdown
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

Adds support in dotnetup for “phase-qualified” daily SDK channels (for example 11.0.1xx-preview.5-daily / 11.0.1xx-preview5-daily), ensuring both matching behavior and aka.ms daily resolution work with the dotless path format used by the service.

Changes:

  • Extended UpdateChannel daily matching to optionally require a specific prerelease label (e.g., preview.5, rc.1) in addition to matching the base scope.
  • Updated DailyChannelResolver to translate dotted prerelease labels into the dotless aka.ms path segment (e.g., preview.5preview5).
  • Added/updated test coverage for phase-qualified daily channels across match/validation/resolution.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/dotnetup.Tests/UpdateChannelTests.cs Adds match and IsDaily cases for phase-qualified daily channels (preview.5, rc.1, dotless variants).
test/dotnetup.Tests/DailyChannelResolverTests.cs Verifies phase-qualified daily channels resolve using the dotless aka.ms path segment.
test/dotnetup.Tests/ChannelVersionResolverTests.cs Extends validation coverage; adds phase-qualified daily channels to the live aka.ms daily resolution theory.
src/Installer/Microsoft.Dotnet.Installation/Internal/UpdateChannel.cs Implements parsing/normalization of prerelease labels and applies it to daily-channel matching.
src/Installer/Microsoft.Dotnet.Installation/Internal/DailyChannelResolver.cs Converts prerelease-qualified daily channels into the aka.ms dotless path form.
src/Installer/Microsoft.Dotnet.Installation/Internal/ChannelVersionResolver.cs Updates daily-channel format validation to allow prerelease-qualified daily scopes.

Comment thread test/dotnetup.Tests/ChannelVersionResolverTests.cs
if (UpdateChannel.TrySplitPartialVersionAndPrereleaseLabel(basePart, out var bandPart, out _))
{
return !string.IsNullOrEmpty(versionPart) && IsValidPartialVersion(versionPart);
return IsValidPartialVersion(bandPart);
Copy link
Copy Markdown
Member

@nagilson nagilson Jun 3, 2026

Choose a reason for hiding this comment

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

Is this doing validation on baseaPart or should we also be checking that? I think that IsValidPartialVersion no longer executes on anything besides the band part, so it will pass as long as there is a - and valid version afterward.

Suggested change
return IsValidPartialVersion(bandPart);
return IsValidPartialVersion(bandPart) && isValidPartialVersion(getMajorMinor(basePart));

Suggestion 2:
add a unit test for input such as invalid.invalid.1xx-daily

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I also recognize this function appears to be a 'best-effort' implementation

var dashIndex = channel.IndexOf('-', StringComparison.Ordinal);
if (dashIndex >= 0)
{
var versionPart = channel.Substring(0, dashIndex);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think we validate the version component after the dash, so it might try to install a version string such as '10.0.1xx-RANDOM` - but don't think this is new. It likely gets caught elsewhere in the code? Could be worth improving or adding a test for now.

Copy link
Copy Markdown
Member

@nagilson nagilson left a comment

Choose a reason for hiding this comment

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

Thanks for jumping on this!

if (UpdateChannel.TrySplitPartialVersionAndPrereleaseLabel(basePart, out var bandPart, out _))
{
return !string.IsNullOrEmpty(versionPart) && IsValidPartialVersion(versionPart);
return IsValidPartialVersion(bandPart);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I also recognize this function appears to be a 'best-effort' implementation

: channelName;

/// <summary>
/// Tries to split a daily-scope string into a partial-version prefix and a
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does daily-scope string mean a string that is a not fully specified version, or a fully specified version, but one without the daily suffix?

private static string EnsureFeatureBand(string partialVersion)
{
var parts = partialVersion.Split('.');
return parts.Length == 2 ? $"{partialVersion}.1xx" : partialVersion;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this the right assumption - e.g., : https://aka.ms/dotnet/10.0.4xx/daily this is a valid outcome and if I ask for 10.0-daily I'd expect to get 4xx. It might help to demonstrate the type of version input to this function - is it only 11.0-preview.5-daily? If this is true, it could be renamed to AddFeatureBandToPreviewVersion so it isn't misused.

@nagilson
Copy link
Copy Markdown
Member

nagilson commented Jun 3, 2026

3.1.32 as an SDK version also doesn't seem to get flagged, which actually counts as a product error and we hit:

The following installs failed:
  .NET SDK 3.1.32: No release found for version 3.1.32
Error: No release found for version 3.1.32

Any chance that was you trying this version string out .... 😁

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.

4 participants