Skip to content

fix: address copilot review cleanup#491

Merged
JerrettDavis merged 1 commit into
mainfrom
cleanup/copilot-object-pool-race
Jun 1, 2026
Merged

fix: address copilot review cleanup#491
JerrettDavis merged 1 commit into
mainfrom
cleanup/copilot-object-pool-race

Conversation

@JerrettDavis
Copy link
Copy Markdown
Owner

Summary

  • synchronize ObjectPool rent/return/dispose paths so returned items cannot be retained after disposal
  • add ObjectPool regression coverage for returning an outstanding lease after disposal
  • clean up older Copilot review nits: culture-sensitive facade expectation, scenario display names, and Composer/Proxy async docs/diagnostic wording

Validation

  • dotnet test test\PatternKit.Tests\PatternKit.Tests.csproj --framework net8.0 --filter "FullyQualifiedName~ObjectPool" --no-restore
  • dotnet test test\PatternKit.Examples.Tests\PatternKit.Examples.Tests.csproj --framework net8.0 --filter "FullyQualifiedNameFacadeSpecsTests|FullyQualifiedNameMediatedTransactionPipelineCoverageTests" --no-restore
  • dotnet test test\PatternKit.Generators.Tests\PatternKit.Generators.Tests.csproj --framework net8.0 --filter "FullyQualifiedName~ComposerGeneratorTests" --no-restore
  • dotnet build PatternKit.slnx --no-restore

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 31, 2026

⚠️ Deprecation Warning: The deny-licenses option is deprecated for possible removal in the next major release. For more information, see issue 997.

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

  • .github/workflows/pr-validation.yml

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

This PR tightens ObjectPool disposal/rent/return behavior and cleans up test, documentation, and diagnostic wording around prior review feedback.

Changes:

  • Synchronizes ObjectPool<T> rent/return/dispose paths and adds regression coverage for returning a lease after disposal.
  • Updates facade and transaction pipeline scenario display names and culture-sensitive facade expectations.
  • Revises Composer/Proxy async generation documentation and Composer diagnostic wording.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/PatternKit.Core/Creational/ObjectPool/ObjectPool.cs Adds locking around pool disposal, renting, returning, and draining retained items.
test/PatternKit.Tests/Creational/ObjectPool/ObjectPoolTests.cs Adds regression coverage for disposing a pool before returning a disposable leased item.
test/PatternKit.Examples.Tests/Generators/FacadeSpecsTests.cs Updates scenario names and makes quote expectation culture-aware.
test/PatternKit.Examples.Tests/Chain/MediatedTransactionPipelineDemoTests.cs Updates several scenario display names.
src/PatternKit.Generators/ComposerGenerator.cs Revises PKCOM009 diagnostic title/message.
src/PatternKit.Generators.Abstractions/Proxy/GenerateProxyAttribute.cs Clarifies GenerateAsync inference remarks.
src/PatternKit.Generators.Abstractions/Composer/ComposerAttribute.cs Clarifies GenerateAsync inference remarks.
docs/generators/composer.md Documents optional async cancellation token behavior and updates PKCOM009 wording.

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

title: "CancellationToken parameter required",
messageFormat: "Method '{0}' is async but missing CancellationToken parameter. Async methods should have a CancellationToken parameter.",
title: "CancellationToken parameter is invalid",
messageFormat: "Method '{0}' is async and declares an optional cancellation parameter, but it is not System.Threading.CancellationToken",
@codecov
Copy link
Copy Markdown

codecov Bot commented May 31, 2026

Codecov Report

❌ Patch coverage is 96.42857% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.42%. Comparing base (caf68e1) to head (3acf6ba).

Files with missing lines Patch % Lines
...atternKit.Core/Creational/ObjectPool/ObjectPool.cs 96.29% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             main     #491     +/-   ##
=========================================
  Coverage   97.42%   97.42%             
=========================================
  Files         583      583             
  Lines       47419    47456     +37     
  Branches     3086       34   -3052     
=========================================
+ Hits        46198    46236     +38     
+ Misses       1221     1220      -1     
Flag Coverage Δ
unittests 97.42% <96.42%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 31, 2026

Test Results

    12 files      12 suites   10m 54s ⏱️
 4 063 tests  4 063 ✅ 0 💤 0 ❌
12 620 runs  12 620 ✅ 0 💤 0 ❌

Results for commit 3acf6ba.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 31, 2026

🔍 PR Validation Results

Version: ``

✅ Validation Steps

  • Build solution
  • Run tests
  • Build documentation
  • Dry-run NuGet packaging

📊 Artifacts

Dry-run artifacts have been uploaded and will be available for 7 days.


This comment was automatically generated by the PR validation workflow.

@JerrettDavis JerrettDavis force-pushed the cleanup/copilot-object-pool-race branch from a41ea0f to 2ab50d9 Compare May 31, 2026 23:16
Copilot AI review requested due to automatic review settings May 31, 2026 23:31
@JerrettDavis JerrettDavis force-pushed the cleanup/copilot-object-pool-race branch from 2ab50d9 to 4ab28c5 Compare May 31, 2026 23:31
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

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Comment on lines 78 to 79
_onReturn?.Invoke(value);
if (_shouldReturn is not null && !_shouldReturn(value))
/// <summary>
/// Gets or sets whether async interceptor hooks should be generated.
/// If not specified, async support is inferred from the contract
/// Attribute usage that omits this named property is inferred by the generator from the contract
/// Gets or sets whether to generate async methods.
/// When omitted, async generation is inferred from the presence of async steps or terminal.
/// Set to true/false explicitly to control async generation.
/// Attribute usage that omits this named property is inferred by the generator from async steps or terminal.
@JerrettDavis JerrettDavis force-pushed the cleanup/copilot-object-pool-race branch from 4ab28c5 to cebefb2 Compare May 31, 2026 23:47
Synchronizes ObjectPool rent/return/dispose paths to avoid post-disposal retention, adds a regression scenario, and cleans up older Copilot review nits around culture-sensitive facade assertions, scenario titles, and Composer/Proxy async docs.
Copilot AI review requested due to automatic review settings June 1, 2026 00:01
@JerrettDavis JerrettDavis force-pushed the cleanup/copilot-object-pool-race branch from cebefb2 to 3acf6ba Compare June 1, 2026 00:01
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

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

Code Coverage

Summary
  Generated on: 06/01/2026 - 00:10:03
  Coverage date: 06/01/2026 - 00:07:11 - 06/01/2026 - 00:09:51
  Parser: MultiReport (12x Cobertura)
  Assemblies: 5
  Classes: 1727
  Files: 583
  Line coverage: 97.4%
  Covered lines: 46234
  Uncovered lines: 1222
  Coverable lines: 47456
  Total lines: 101290
  Branch coverage: 84.4% (14657 of 17361)
  Covered branches: 14657
  Total branches: 17361
  Method coverage: 97.2% (9021 of 9277)
  Full method coverage: 91.6% (8498 of 9277)
  Covered methods: 9021
  Fully covered methods: 8498
  Total methods: 9277

PatternKit.Core                                                                                                       96%
  PatternKit.Application.ActivityTracking.ActivityGateState                                                          100%
  PatternKit.Application.ActivityTracking.ActivityLease                                                              100%
  PatternKit.Application.ActivityTracking.ActivityRecord                                                             100%
  PatternKit.Application.ActivityTracking.ActivityTracker                                                            100%
  PatternKit.Application.Aggregates.AggregateCommandHandler<T1, T2, T3>                                              100%
  PatternKit.Application.Aggregates.AggregateCommandResult<T>                                                        100%
  PatternKit.Application.Aggregates.AggregateRoot<T1, T2>                                                            100%
  PatternKit.Application.AntiCorruption.AntiCorruptionLayer<T1, T2>                                                 90.4%
  PatternKit.Application.AntiCorruption.AntiCorruptionResult<T>                                                      100%
  PatternKit.Application.AuditLog.AuditLogAppendResult<T>                                                           85.7%
  PatternKit.Application.AuditLog.InMemoryAuditLog<T1, T2>                                                          95.4%
  PatternKit.Application.BoundedContexts.BoundedContextAdapter                                                       100%
  PatternKit.Application.BoundedContexts.BoundedContextCapability                                                   83.3%
  PatternKit.Application.BoundedContexts.BoundedContextDescriptor                                                   95.4%
  PatternKit.Application.ContextMaps.ContextMapDescriptor                                                           96.8%
  PatternKit.Application.ContextMaps.ContextMapRelationship                                                          100%
  PatternKit.Application.DataMapping.DataMapper<T1, T2>                                                             94.6%
  PatternKit.Application.DataMapping.DataMapperError                                                                  90%
  PatternKit.Application.DataMapping.DataMapperResult<T>                                                            84.6%
  PatternKit.Application.DomainEvents.DomainEventDispatcher<T>                                                      95.4%
  PatternKit.Application.DomainEvents.DomainEventDispatchResult                                                      100%
  PatternKit.Application.DomainServices.DomainServiceOperation<T1, T2>                                               100%
  PatternKit.Application.DomainServices.DomainServiceRegistry<T1, T2>                                                100%
  PatternKit.Application.EventSourcing.EventStoreAppendResult                                                        100%
  PatternKit.Application.EventSourcing.InMemoryEventStore<T1, T2>                                                   97.9%
  PatternKit.Application.EventSourcing.StoredEvent<T1, T2>                                                            80%
  PatternKit.Application.EventualConsistency.EventualConsistencyEvaluation<T>                                       92.3%
  PatternKit.Application.EventualConsistency.EventualConsistencyMonitor<T>                                          97.2%
  PatternKit.Application.EventualConsistency.EventualConsistencyMonitorState<T>                                      100%
  PatternKit.Application.EventualConsistency.EventualConsistencyWatermarks<T>                                       96.7%
  PatternKit.Application.FeatureToggles.FeatureToggleDecision                                                       87.5%
  PatternKit.Application.FeatureToggles.FeatureToggleRule<T>                                                         100%
  PatternKit.Application.FeatureToggles.FeatureToggleSet<T>                                                         96.9%
  PatternKit.Application.IdentityMap.IdentityMap<T1, T2>                                                             100%
  PatternKit.Application.IdentityMap.IdentityMapResult<T>                                                           92.8%
  PatternKit.Application.ManualTaskGates.ManualTaskGate<T>                                                          98.5%
  PatternKit.Application.ManualTaskGates.ManualTaskGateState<T>                                                      100%
  PatternKit.Application.ManualTaskGates.ManualTaskRecord<T>                                                        96.9%

@JerrettDavis JerrettDavis merged commit ead24a8 into main Jun 1, 2026
13 checks passed
@JerrettDavis JerrettDavis deleted the cleanup/copilot-object-pool-race branch June 1, 2026 00:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants