Skip to content

feat(reactive): add Punchclock.Reactive package#476

Merged
ChrisPulman merged 2 commits into
mainfrom
CP_add-punchclock-reactive
Jun 24, 2026
Merged

feat(reactive): add Punchclock.Reactive package#476
ChrisPulman merged 2 commits into
mainfrom
CP_add-punchclock-reactive

Conversation

@ChrisPulman

@ChrisPulman ChrisPulman commented Jun 23, 2026

Copy link
Copy Markdown
Member

What kind of change does this PR introduce?

Feature and migration support for System.Reactive consumers.

What is the new behavior?

Adds a Punchclock.Reactive project that links the shared Punchclock source with REACTIVE_SHIM enabled and references ReactiveUI.Primitives.Reactive. The reactive package variant exposes System.Reactive-friendly Unit and IScheduler shapes while the existing lean Punchclock package continues to use ReactiveUI.Primitives RxVoid and ISequencer.

The shared queue code now has package-variant aliases for scheduler, unit, and disposable types, plus a scheduler helper that handles the System.Reactive IScheduler delegate signature. The new project is included in the solution and has PublicAPI baselines for every target framework.

What is the current behavior?

Punchclock only builds the lean ReactiveUI.Primitives package variant, so System.Reactive-first consumers do not have a dedicated package surface compiled against System.Reactive scheduler and unit conventions.

Checklist

  • I have read the Contribute guide
  • 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 completed locally:

  • dotnet restore .\Punchclock.slnx
  • dotnet build .\Punchclock.slnx -c Release --no-restore /clp:ErrorsOnly
  • dotnet test --project .\Punchclock.Tests\Punchclock.Tests.csproj -c Release --framework net8.0 --coverage --coverage-output-format cobertura --results-directory .\TestResults\net8.0 -- --disable-logo --report-trx --maximum-parallel-tests 1
  • Repeated the same MTP/TUnit coverage run for net9.0, net10.0, and net11.0
  • mtpunittestmcp solution coverage reported 100% line coverage and no missed coverage

No local Contribute/CONTRIBUTING guide file was present in this checkout.

Package updates:

- Add a Punchclock.Reactive project that links the shared Punchclock source with REACTIVE_SHIM enabled.

- Reference ReactiveUI.Primitives.Reactive and expose System.Reactive Unit and IScheduler shapes for reactive consumers.

- Add the project to Punchclock.slnx and centralize the ReactiveUI.Primitives.Reactive package version.

Implementation updates:

- Share OperationQueue, keyed operation, extension, and priority queue code across lean and reactive package variants.

- Add scheduler and disposable aliases for the lean and reactive builds.

- Add a scheduler helper for the System.Reactive IScheduler delegate shape.

API and tests:

- Add Punchclock.Reactive PublicAPI baselines for all target frameworks.

- Update tests for the shared RxVoid alias and current OperationQueue behavior.

Validation:

- dotnet restore Punchclock.slnx

- dotnet build Punchclock.slnx -c Release --no-restore /clp:ErrorsOnly

- dotnet test Punchclock.Tests for net8.0, net9.0, net10.0, and net11.0 with MTP Cobertura coverage

- mtpunittestmcp solution coverage: 100% line coverage with no missed coverage
@codecov

codecov Bot commented Jun 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (03e1aa9) to head (b9440dd).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #476   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            5         5           
  Lines          307       311    +4     
  Branches        63        62    -1     
=========================================
+ Hits           307       311    +4     

☔ 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.

@ChrisPulman ChrisPulman marked this pull request as ready for review June 24, 2026 06:37
@glennawatson glennawatson requested a review from Copilot June 24, 2026 06:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a new Punchclock.Reactive package variant that compiles the shared Punchclock queue implementation against System.Reactive-friendly shapes (e.g., System.Reactive.Unit and System.Reactive.Concurrency.IScheduler) while keeping the existing Punchclock package on the lean ReactiveUI.Primitives surface.

Changes:

  • Added a new Punchclock.Reactive project that links the shared Punchclock source with REACTIVE_SHIM enabled and appropriate System.Reactive/ReactiveUI.Primitives.Reactive usings and references.
  • Updated shared queue code to use package-variant aliases (Unit, IScheduler, Disposable) and introduced a scheduler helper to handle differing Schedule(...) delegate signatures.
  • Updated package versions to ReactiveUI.Primitives 5.6.0 and added ReactiveUI.Primitives.Reactive 5.6.0, plus solution/project wiring and PublicAPI baselines.

Reviewed changes

Copilot reviewed 27 out of 27 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/Punchclock/Punchclock.csproj Adds global using aliases to unify Unit/IScheduler/Disposable shapes for the lean package build.
src/Punchclock/PriorityQueueHelper.cs Switches namespace based on REACTIVE_SHIM to support dual package variants.
src/Punchclock/OperationQueueExtensions.cs Uses alias-based Unit and IScheduler types; adds shimmed namespace; updates cancellation observable types.
src/Punchclock/OperationQueue.cs Introduces ScheduleStart helper to bridge scheduler signature differences; updates queue internals to alias-based types.
src/Punchclock/KeyedOperation{T}.cs Updates operation evaluation to return alias-based Unit and supports shimmed namespace.
src/Punchclock/KeyedOperation.cs Updates cancellation and evaluation contracts to alias-based Unit and supports shimmed namespace.
src/Punchclock.Tests/OperationQueueExtensionsTests.cs Minor cleanup of RxVoid alias usage (tests still validate RxVoid behavior).
src/Punchclock.Tests/KeyedOperationTests.cs Renames local alias usage to align with Unit naming in shared code.
src/Punchclock.slnx Adds the new Punchclock.Reactive project to the solution.
src/Punchclock.Reactive/Punchclock.Reactive.csproj New reactive variant project: links shared sources, enables REACTIVE_SHIM, and defines System.Reactive-based aliases/usings.
src/Punchclock.Reactive/PublicAPI/** Adds per-TFM PublicAPI baselines for the new reactive project.
src/Directory.Packages.props Bumps ReactiveUI.Primitives and adds ReactiveUI.Primitives.Reactive package versions.

Comment thread src/Punchclock/OperationQueueExtensions.cs
Comment thread src/Punchclock/OperationQueueExtensions.cs
Comment thread src/Punchclock/OperationQueueExtensions.cs
Comment thread src/Punchclock/OperationQueueExtensions.cs
Comment thread src/Punchclock/OperationQueueExtensions.cs
Comment thread src/Punchclock/OperationQueueExtensions.cs
Comment thread src/Punchclock/OperationQueueExtensions.cs
@ChrisPulman ChrisPulman merged commit 9c1778c into main Jun 24, 2026
7 checks passed
@ChrisPulman ChrisPulman deleted the CP_add-punchclock-reactive branch June 24, 2026 07:55
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jul 9, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants