Skip to content

fix: migrate validation to ReactiveUI primitives#933

Merged
glennawatson merged 3 commits into
mainfrom
CP_reactiveui-primitives-validation-migration
Jun 30, 2026
Merged

fix: migrate validation to ReactiveUI primitives#933
glennawatson merged 3 commits into
mainfrom
CP_reactiveui-primitives-validation-migration

Conversation

@ChrisPulman

Copy link
Copy Markdown
Member

What kind of change does this PR introduce?

Bug fix / migration update for the ReactiveUI.Validation move to ReactiveUI.Primitives-based ReactiveUI packages.

What is the new behavior?

  • ReactiveUI.Validation builds against the primitives scheduler/disposable surface while keeping DynamicData/System.Reactive interop localized.
  • WPF and WinForms samples use primitives MultipleDisposable activation registration.
  • Avalonia samples no longer depend on the stale ReactiveUI.Avalonia bridge; the login sample uses Avalonia bindings with direct validation context subscriptions.
  • Test scheduler usage and API approval snapshots are aligned with the primitives public API surface.

What is the current behavior?

The solution fails to build after the ReactiveUI update because some code still assumes System.Reactive scheduler/disposable APIs and stale platform adapter behavior. API approvals also reflect the old scheduler/disposable public shape.

Checklist

  • Tests have been added or updated (for bug fixes / features)
  • Docs have been added or updated (for bug fixes / features)
  • Changes target the main branch
  • PR title follows Conventional Commits

Additional information

Validation performed from src:

  • dotnet build ReactiveUI.Validation.slnx -c Release
  • dotnet test --solution ReactiveUI.Validation.slnx -c Release
  • dotnet test --project tests/ReactiveUI.Validation.Tests/ReactiveUI.Validation.Tests.csproj -c Release -- --coverage --coverage-output-format cobertura --disable-logo --no-progress

The MTP coverage report for net10 reported 99.85% line coverage and 99.64% branch coverage.

Core changes:

- Align validation context scheduler and disposable APIs with ReactiveUI.Primitives.

- Keep DynamicData/System.Reactive interop localized where observable combination is required.

- Harden observable validation constructor input handling.

Samples:

- Update WPF and WinForms activation bindings to use primitives MultipleDisposable registration.

- Remove stale ReactiveUI.Avalonia bridge usage and bind the Avalonia login sample through Avalonia bindings plus ValidationContext subscriptions.

Tests and API approvals:

- Move test scheduler usage to ImmediateSequencer.

- Refresh API approval baselines for the primitives public API surface.

Validation:

- dotnet build ReactiveUI.Validation.slnx -c Release

- dotnet test --solution ReactiveUI.Validation.slnx -c Release

- dotnet test --project tests/ReactiveUI.Validation.Tests/ReactiveUI.Validation.Tests.csproj -c Release -- --coverage --coverage-output-format cobertura --disable-logo --no-progress
## Changes
- Disable native apphost generation for test projects because Microsoft Testing Platform runs the test assemblies directly and the .NET preview SDK CI build was failing while copying missing apphost files on Ubuntu.
- Update ReactiveValidationObject scheduler XML docs to reference the ReactiveUI.Primitives CurrentThreadSequencer type.

## Verification
- dotnet build ReactiveUI.Validation.slnx -c Release
- dotnet test --solution ReactiveUI.Validation.slnx -c Release -- --coverage --coverage-output-format cobertura --disable-logo --no-progress
@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (fc4aa8b) to head (f97286b).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #933   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           21        21           
  Lines          668       665    -3     
  Branches       113       114    +1     
=========================================
- Hits           668       665    -3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

## Changes
- Add a TUnit constructor guard test for ObservableValidation when the source observable is null.
- Cover the constructor branch Codecov reported as partially covered on the PR diff.

## Verification
- Targeted TUnit test passed across net8.0, net9.0, and net10.0.
- Full TUnit coverage run passed with 576 tests.
- MTP Cobertura query confirmed no missed coverage for ObservableValidationBase.
@ChrisPulman ChrisPulman marked this pull request as ready for review June 30, 2026 21:45
@glennawatson glennawatson merged commit 478752e into main Jun 30, 2026
6 checks passed
@glennawatson glennawatson deleted the CP_reactiveui-primitives-validation-migration branch June 30, 2026 21:51
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