Skip to content

Retarget to netstandard2.0 + automate publish; include AbortOnCancel - #17

Merged
mavickers merged 5 commits into
masterfrom
feature/target-framework
Jul 8, 2026
Merged

mavickers merged 5 commits into
masterfrom
feature/target-framework

Conversation

@mavickers

Copy link
Copy Markdown
Owner

Summary

  • Retarget Cargo library to a single netstandard2.0 target (broadens floor to .NET Framework 4.6.1+; zero-dependency lib needs no polyfills)
  • Fix invalid .net7.0/.net8.0 monikers in the test project
  • Merge feature/bug-fixes: adds WithAbortOnCancel Bus option + tests
  • Automate publishing: merge-to-master now builds, tests, packs, pushes to nuget.org, and tags the published version

Verification

  • Library builds clean against netstandard2.0 (0 warnings)
  • 44/44 tests pass on net8.0

Merging this PR triggers the first automated publish.

mavickers and others added 5 commits March 21, 2026 08:02
- Add _withAbortOnCancel field and WithAbortOnCancel()/WithNoAbortOnCancel()
  fluent methods to Bus<T>
- When enabled, cancellation records an abort result instead of throwing
  OperationCanceledException, allowing the final station to run
- Refactor loop to hoist stationType/isLastStation above cancellation check
  and wrap station execution in else branch
- Add cancellation test stations: SyncAdderThenCancel, AsyncAdderThenCancel,
  AsyncCooperativeCanceller
- Add tests 15-18 for default cancellation throw behavior
- Add tests 19-22 for AbortOnCancel graceful abort behavior

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Document WithAbortOnCancel()/WithNoAbortOnCancel() in README features,
  cancellation section, and API reference table
- Add "Last updated" timestamp to README
- Add Releasing section to CLAUDE.md
- Cargo: single netstandard2.0 target replaces net472;net48;net6.0;net7.0;net8.0 (broadens floor to .NET Framework 4.6.1+; zero-dependency lib needs no polyfills)
- Cargo.Tests: fix invalid .net7.0/.net8.0 monikers; keep runnable TFMs
- CLAUDE.md: document new target layout
Bring WithAbortOnCancel Bus option into the next release alongside the netstandard2.0 retarget.
- Trigger publish workflow on push to master (was tag push, which never ran)
- Add Nerdbank.GitVersioning step to compute the published version
- After nuget push, auto-tag the commit with that version and push the tag
- Add --skip-duplicate and tag-exists guard so re-runs are safe
- Grant contents:write so the workflow can push tags
- Update CLAUDE.md Releasing section to describe the automated flow
Copilot AI review requested due to automatic review settings July 8, 2026 01:50
@mavickers
mavickers merged commit c76e9be into master Jul 8, 2026
1 check passed

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 broadens library compatibility by retargeting LightPath.Cargo to netstandard2.0, adds an option to treat cancellation as a graceful abort (WithAbortOnCancel), and introduces an automated publish workflow that releases on merges to master.

Changes:

  • Retarget Cargo library to netstandard2.0 and fix invalid test TFMs (.net7.0/.net8.0 → net7.0/net8.0).
  • Add WithAbortOnCancel / WithNoAbortOnCancel behavior plus integration tests and README updates.
  • Add a publish.yml workflow to build/test/pack/push to NuGet and tag the published version.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
README.md Documents new cancellation behavior and API options (needs framework/usage corrections per comments).
CLAUDE.md Updates repo/docs notes, including release automation details.
Cargo/Cargo.csproj Retargets library to netstandard2.0.
Cargo/Bus.cs Implements WithAbortOnCancel behavior in pipeline execution.
Cargo.Tests/Integration/Stations/Async.cs Adds stations used by new cancellation tests.
Cargo.Tests/Integration/Async.cs Adds/adjusts integration tests covering cancellation + AbortOnCancel scenarios.
Cargo.Tests/Cargo.Tests.csproj Fixes invalid TFMs and keeps multi-targeting for tests.
.github/workflows/publish.yml Adds automated publish-on-master workflow (needs Linux build scoping and action pinning per comments).
Comments suppressed due to low confidence (1)

.github/workflows/publish.yml:36

  • dotnet build Cargo.sln on ubuntu-latest will try to build all TFMs in Cargo.Tests (including net472/net48), which typically fails on Linux because .NET Framework reference assemblies aren’t available. Since the workflow only runs tests on net8.0, build/test steps should be scoped to Linux-runnable TFMs (or switch the job to a Windows runner).
      - name: Build
        run: dotnet build Cargo.sln --configuration Release

      - name: Test
        run: dotnet test Cargo.sln --configuration Release --no-build --framework net8.0

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

Comment thread Cargo/Bus.cs
Comment on lines 77 to 78
var stationType = stationList[currentStationIndex];
var isLastStation = stationList[currentStationIndex] == stationList.Last();
Comment thread README.md
Comment on lines +224 to +231
var result = await Bus.New<OrderContext>()
.WithAbortOnCancel()
.WithStation<SlowStation>()
.WithFinalStation<CleanupStation>()
.GoAsync(context, cts.Token);

// No exception thrown — check bus.Package.IsAborted instead
```
Comment thread README.md
- **Cancellation** — pass a `CancellationToken` to `GoAsync()`, accessible via `Package.CancellationToken`. Optionally treat cancellation as a graceful abort instead of an exception.
- **Tracing** — built-in trace messages for pipeline execution
- **Result tracking** — inspect results from each station via `Package.Results`
- **Multi-target** — supports net472, net48, net6.0, net7.0, net8.0
Comment thread README.md
Comment on lines 298 to +302
- .NET 7.0
- .NET 8.0

*Last updated: 2026-03-21*

Comment on lines +28 to +31
- name: Compute version (Nerdbank.GitVersioning)
id: nbgv
uses: dotnet/nbgv@master

@mavickers
mavickers deleted the feature/target-framework branch July 8, 2026 01:57
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