Skip to content

Add beta channel support with undotted prerelease version ordering - #5551

Open
Marc-André Moreau (mamoreau-devolutions) wants to merge 8 commits into
mainfrom
copilot/beta-channel-support
Open

Marc-André Moreau (mamoreau-devolutions) wants to merge 8 commits into
mainfrom
copilot/beta-channel-support

Conversation

@mamoreau-devolutions

Copy link
Copy Markdown
Contributor
  • I have read the contributing guidelines, and I agree with the Code of Conduct.
  • Have you checked that there aren't other open pull requests for the same changes?
  • Have you tested that the committed code can be executed without errors?
  • Have you confirmed that this issue is caused by UniGetUI itself, and not by the package manager or the package involved?
    If the same issue can be reproduced outside UniGetUI with the relevant package manager or with the package itself, please report it there first. UniGetUI should only be used to track issues that are specific to UniGetUI's behavior or integration.

Summary

Adds end-to-end beta channel support for UniGetUI using undotted prerelease versions (2026.3.2-beta1, 2026.3.2-beta2, 2026.3.2-beta3 upgrading to 2026.3.2):

  • SemanticVersion (src/UniGetUI.Core.Tools/SemanticVersion.cs): Compare alphanumeric prerelease identifiers with a shared prefix and trailing integer (beta1, beta2, beta10, rc1, rc2) numerically by suffix while preserving standard SemVer ordering (2026.3.2-beta1 < 2026.3.2-beta2 < 2026.3.2-beta10 < 2026.3.2).
  • AutoUpdaterHelpers (src/Shared/AutoUpdater.Helpers.cs) & AvaloniaAutoUpdater (src/UniGetUI.Avalonia/Infrastructure/AvaloniaAutoUpdater.cs):
    • Parse and compare updater versions via SemanticVersion with 4-part .0 core normalization (2026.3.2.0-beta1 == 2026.3.2-beta1 < 2026.3.2 == 2026.3.2.0).
    • Update SelectChannel so Beta is selected when EnableUniGetUIBeta is enabled and Beta is strictly newer than Current, falling back to Current if Beta is absent or once final Current catches up/passes Beta.
  • Settings UI (src/UniGetUI.Avalonia/Views/Pages/SettingsPages/General.axaml.cs): Wire GeneralUpdaterCard.Click ("Check for updates"), GeneralUpdaterCard.StateChanged, and EnableUniGetUIBetaCard.StateChanged to trigger update checks.
  • Release & Version Stamping (scripts/set-version.ps1, .github/workflows/build-release.yml):
    • Fix $ManifestPath in scripts/set-version.ps1 to src/UniGetUI.Avalonia/app.manifest and strip leading v/V and + metadata when computing the 4-part file/assembly version.
    • Preserve prerelease suffixes when computing onedrive-version (2026.3.2-beta1 → 2026.3.2.0-beta1) and pass --prerelease to gh release create when publishing a prerelease version.

Validation

  • dotnet test src/UniGetUI.PackageEngine.Tests/UniGetUI.PackageEngine.Tests.csproj --filter "FullyQualifiedName~SemanticVersionTests" --verbosity q --nologo /p:Platform=x64 /p:UseSharedCompilation=false /m:1 — Passed (32/32 across net10.0 and net10.0-windows10.0.26100.0)
  • dotnet test src/UniGetUI.Tests/UniGetUI.Tests.csproj --filter "FullyQualifiedName~AutoUpdaterTests" --verbosity q --nologo /p:Platform=x64 /p:UseSharedCompilation=false /m:1 — Passed (37/37)
  • dotnet format whitespace src --folder --verify-no-changes --verbosity minimal — Passed
  • dotnet format style src/UniGetUI.Windows.slnx --no-restore --verify-no-changes --verbosity minimal — Passed

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

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.

🟡 Changes recommended

Version-ordering regressions, overlapping updater attempts and invalid macOS beta metadata remain unresolved.

3 open issues
What changed in this PR

Adds beta-channel support across UniGetUI’s updater, settings UI, version stamping and release workflow.

Changes:

  • Adds prerelease comparison, version normalization and stable-channel fallback.
  • Connects update settings to immediate checks and expands regression tests.
  • Adds beta release inputs and prerelease publishing metadata.
File Description
src/​UniGetUI.Tests/​UniGetUI.Tests.csproj Removes the directly linked updater helper.
src/​UniGetUI.Tests/​AutoUpdaterTests.cs Tests beta progression and channel selection.
src/​UniGetUI.PackageEngine.Tests/​SemanticVersionTests.cs Adds undotted prerelease ordering cases.
src/​UniGetUI.Core.Tools/​SemanticVersion.cs Compares matching label suffixes numerically.
src/​UniGetUI.Avalonia/​Views/​Pages/​SettingsPages/​General.axaml.cs Triggers update checks from settings.
src/​UniGetUI.Avalonia/​UniGetUI.Avalonia.csproj Includes shared updater helpers.
src/​UniGetUI.Avalonia/​Infrastructure/​AvaloniaAutoUpdater.cs Uses prerelease-aware comparisons and channel selection.
src/​Shared/​AutoUpdater.Helpers.cs Adds updater version and channel helpers.
scripts/​set-version.ps1 Normalizes versions and corrects the manifest path.
.github/​workflows/​build-release.yml Adds beta inputs and prerelease publishing.

Review effort: Balanced

Comment thread .github/workflows/build-release.yml
Comment thread src/UniGetUI.Avalonia/Views/Pages/SettingsPages/General.axaml.cs
Comment thread src/UniGetUI.Core.Tools/SemanticVersion.cs Outdated
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ering

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

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.

🟡 Changes recommended

Pending attempts prevent channel changes from taking effect, and version normalization discards nonzero revisions.

1 open issue
1 previously missed issue

In code that hasn't changed since last review

Medium severity Preserve nonzero fourth version components

src/​Shared/​AutoUpdater.Helpers.cs:314

Preserve nonzero fourth version components here. NormalizeVersionForComparison drops every revision, not just .0, so 2026.3.2.1-beta1 becomes 2026.3.2-beta.1. The workflow now accepts four-part base versions, but with Current=2026.3.2.0 and Beta=2026.3.2.1-beta1, channel selection incorrectly chooses Current. Only remove a zero revision, and cover nonzero revisions in the updater comparison and channel-selection tests.

3 resolved since last review

Review effort: Balanced

Comment thread src/Shared/AutoUpdater.Helpers.cs Outdated
- Only strip zero fourth version segments (.0) in TryExtractNormalizedCoreVersion so nonzero four-part versions (e.g. 2026.3.2.1-beta1) are preserved during updater version comparison and channel selection
- Track channel per updater attempt in UpdaterAttemptCoordinator so changing channels safely ends an obsolete pending-consent attempt and checks the newly selected channel without overlapping downloads
- Add unit tests covering nonzero four-part revisions and channel switching while awaiting consent

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

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.

🟡 Changes recommended

Channel-change cancellation can leave obsolete, non-closable progress banners visible indefinitely.

1 open issue
1 resolved since last review

Review effort: Balanced

Comment thread src/UniGetUI.Avalonia/Infrastructure/AvaloniaAutoUpdater.cs
Call DismissUpdateBanner() before returning from both channel-change abort branches (after loading ProductInfo and before prompting the user) so any non-closable check/download progress banner is closed when an attempt is superseded.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants