Skip to content

Fix ValidatePackageList test regex to handle servicing pre-release branding#5326

Merged
akoeplinger merged 2 commits intomainfrom
copilot/fix-package-list-validation
Mar 9, 2026
Merged

Fix ValidatePackageList test regex to handle servicing pre-release branding#5326
akoeplinger merged 2 commits intomainfrom
copilot/fix-package-list-validation

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 9, 2026

LinuxInstallerTests.ValidatePackageList fails on SDK band build branches because package filenames include a servicing pre-release label (e.g. dotnet-sdk-10.0.0-servicing.26159.104-x64.rpm) that the normalization regex didn't recognize, leaving the label in the normalized name and causing a mismatch against expected patterns.

Change

  • Added servicing to the alternation group in RemoveVersionFromPackageNameRegex so the full version token — including the servicing.* suffix — is stripped when normalizing package filenames for comparison:
- [GeneratedRegex(@"\d+\.\d+\.\d+(?:-(?:alpha|rc|rtm|preview)(?:\.\d+)*)?", ...)]
+ [GeneratedRegex(@"\d+\.\d+\.\d+(?:-(?:alpha|rc|rtm|preview|servicing)(?:\.\d+)*)?", ...)]

dotnet-sdk-10.0.0-servicing.26159.104-x64.rpm now normalizes to dotnet-sdk-*-x64.rpm, matching the expected pattern.

Original prompt

This section details on the original issue you should resolve

<issue_title>[Operational Issue]: LinuxInstallerTests.ValidatePackageList is failing on branches using "servicing" branding</issue_title>
<issue_description>### Error

E.g. https://dev.azure.com/dnceng/internal/_build/results?buildId=2921884&view=logs&j=0877f6c4-4cbd-5847-bf60-83b123bf06f7&t=3ac6f9bd-79eb-5b63-f408-35742ccc2e3e&s=88443c40-f44f-5ad2-2c9d-5e26a4f665d6

  Failed Microsoft.DotNet.Installer.Tests.LinuxInstallerTests.ValidateRpmPackageList [12 ms]
  Error Message:
   Package list validation failed for Rpm:
Expected:
dotnet-sdk-*-newkey-x64.rpm
dotnet-sdk-*-x64.rpm
Actual:
dotnet-sdk-*-servicing.26159.104-azl-x64.rpm
dotnet-sdk-*-servicing.26159.104-newkey-x64.rpm
dotnet-sdk-*-servicing.26159.104-x64.rpm
  Stack Trace:
     at Microsoft.DotNet.Installer.Tests.LinuxInstallerTests.ValidatePackageList(PackageType packageType) in /_/test/Microsoft.DotNet.Installer.Tests/LinuxInstallerTests.cs:line 766
   at Microsoft.DotNet.Installer.Tests.LinuxInstallerTests.ValidateRpmPackageList() in /_/test/Microsoft.DotNet.Installer.Tests/LinuxInstallerTests.cs:line 173
   at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
  Skipped Microsoft.DotNet.Installer.Tests.LinuxInstallerTests.RpmPackageMetadataTest [1 ms]
  Passed Microsoft.DotNet.Installer.Tests.LinuxInstallerTests.RpmScenarioTest(repo: "mcr.microsoft.com/dotnet/runtime-deps", tag: "10.0-azurelinux3.0") [7 m 31 s]
  Passed Microsoft.DotNet.Installer.Tests.LinuxInstallerTests.DebScenarioTest(repo: "mcr.microsoft.com/dotnet/runtime-deps", tag: "10.0-noble") [7 m 22 s]
[xUnit.net 00:14:53.68]     Microsoft.DotNet.Installer.Tests.LinuxInstallerTests.ValidateDebPackageList [FAIL]
[xUnit.net 00:14:53.68]       Package list validation failed for Deb:
[xUnit.net 00:14:53.68]       Expected:
[xUnit.net 00:14:53.68]       dotnet-sdk-*-newkey-x64.deb
[xUnit.net 00:14:53.68]       dotnet-sdk-*-x64.deb
[xUnit.net 00:14:53.68]       Actual:
[xUnit.net 00:14:53.68]       dotnet-sdk-*-servicing.26159.104-newkey-x64.deb
[xUnit.net 00:14:53.68]       dotnet-sdk-*-servicing.26159.104-x64.deb
[xUnit.net 00:14:53.68]       Stack Trace:
[xUnit.net 00:14:53.68]         /_/test/Microsoft.DotNet.Installer.Tests/LinuxInstallerTests.cs(766,0): at Microsoft.DotNet.Installer.Tests.LinuxInstallerTests.ValidatePackageList(PackageType packageType)
[xUnit.net 00:14:53.68]         /_/test/Microsoft.DotNet.Installer.Tests/LinuxInstallerTests.cs(179,0): at Microsoft.DotNet.Installer.Tests.LinuxInstallerTests.ValidateDebPackageList()
[xUnit.net 00:14:53.68]            at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
[xUnit.net 00:14:53.68]            at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
[xUnit.net 00:14:54.83]   Finished:    Microsoft.DotNet.Installer.Tests
  Failed Microsoft.DotNet.Installer.Tests.LinuxInstallerTests.ValidateDebPackageList [< 1 ms]
  Error Message:
   Package list validation failed for Deb:
Expected:
dotnet-sdk-*-newkey-x64.deb
dotnet-sdk-*-x64.deb
Actual:
dotnet-sdk-*-servicing.26159.104-newkey-x64.deb
dotnet-sdk-*-servicing.26159.104-x64.deb
  Stack Trace:
     at Microsoft.DotNet.Installer.Tests.LinuxInstallerTests.ValidatePackageList(PackageType packageType) in /_/test/Microsoft.DotNet.Installer.Tests/LinuxInstallerTests.cs:line 766
   at Microsoft.DotNet.Installer.Tests.LinuxInstallerTests.ValidateDebPackageList() in /_/test/Microsoft.DotNet.Installer.Tests/LinuxInstallerTests.cs:line 179
   at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
  Passed Microsoft.DotNet.Installer.Tests.LinuxInstallerTests.DebPackageMetadataTest(repo: "mcr.microsoft.com/dotnet/runtime-deps", tag: "10.0-noble") [1 s]

Links

Presumably this regex needs to be updated to include servicing:

// Remove version numbers from package names: "dotnet-runtime-10.0.0-rc.1.25480.112-x64.rpm" -> "dotnet-runtime-*-x64.rpm"
[GeneratedRegex(@"\d+\.\d+\.\d+(?:-(?:rc|rtm|preview)(?:\.\d+)*)?", RegexOptions.CultureInvariant)]
private static partial Regex RemoveVersionFromPackageNameRegex { get; }

Root Cause

unknown

Blocking

  • This issue is blocking

Affected Releases

  • .NET 10
  • .NET 10 (SDK band build)
  • .NET 11</issue_description>

Comments on the Issue (you are @copilot in this section)


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

Co-authored-by: akoeplinger <1376924+akoeplinger@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failing LinuxInstallerTests.ValidatePackageList for servicing branding Fix ValidatePackageList test regex to handle servicing pre-release branding Mar 9, 2026
@akoeplinger akoeplinger marked this pull request as ready for review March 9, 2026 18:00
@akoeplinger akoeplinger requested review from a team as code owners March 9, 2026 18:00
Copilot AI review requested due to automatic review settings March 9, 2026 18:00
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

Updates the Linux installer package list test normalization to recognize servicing as a pre-release label, preventing mismatches on SDK band build branches where package filenames include -servicing.*.

Changes:

  • Extend RemoveVersionFromPackageNameRegex to include servicing in the pre-release alternation group.
  • Ensure package filenames like dotnet-sdk-10.0.0-servicing.26159.104-x64.rpm normalize correctly to the expected wildcard pattern.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@akoeplinger akoeplinger enabled auto-merge (squash) March 9, 2026 19:10
@akoeplinger

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@akoeplinger akoeplinger merged commit a70814a into main Mar 9, 2026
15 checks passed
@akoeplinger akoeplinger deleted the copilot/fix-package-list-validation branch March 9, 2026 22:21
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.

[Operational Issue]: LinuxInstallerTests.ValidatePackageList is failing on branches using "servicing" branding

4 participants