Skip to content

Conversation

@JerrettDavis
Copy link
Owner

No description provided.

@JerrettDavis JerrettDavis self-assigned this Sep 14, 2025
@JerrettDavis JerrettDavis added documentation Improvements or additions to documentation enhancement New feature or request labels Sep 14, 2025
Copy link

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 pull request adds significant new functionality to the PatternKit library by implementing chain patterns and expanding the pattern set across behavioral, creational, and structural categories. The changes include new chain builders for sequential operations, strategy composition for complex workflows, and comprehensive examples demonstrating real-world usage patterns.

  • Adds chain pattern implementations including ActionChain and ChainBuilder for sequential operations
  • Expands builder patterns with MutableBuilder and Composer for object construction workflows
  • Introduces extensive example applications including transaction pipelines, API gateways, and composed notification strategies
  • Implements source generators for strategy pattern code generation
  • Updates project structure to support multi-targeting (net8.0 and net9.0)

Reviewed Changes

Copilot reviewed 69 out of 69 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
PatternKit.Core Adds core chain builders, mutable builders, and composer patterns
PatternKit.Examples Comprehensive examples showing transaction processing, API routing, and strategy composition
PatternKit.Generators Source generators for automatic strategy pattern implementation
Test projects Extensive test coverage using TinyBDD framework with multi-target support
Project configurations Updates to support dual targeting and package references

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@codecov-commenter
Copy link

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@JerrettDavis JerrettDavis changed the title Feature/add chain patterns Add Chain Patterns and Better Documentation Sep 15, 2025
@github-actions
Copy link

Code Coverage

Summary
  Generated on: 09/15/2025 - 03:18:19
  Coverage date: 09/15/2025 - 03:18:11 - 09/15/2025 - 03:18:16
  Parser: MultiReport (6x Cobertura)
  Assemblies: 4
  Classes: 65
  Files: 28
  Line coverage: 87.8%
  Covered lines: 1241
  Uncovered lines: 171
  Coverable lines: 1412
  Total lines: 5045
  Branch coverage: 77.6% (337 of 434)
  Covered branches: 337
  Total branches: 434
  Method coverage: 85.7% (330 of 385)
  Full method coverage: 80.2% (309 of 385)
  Covered methods: 330
  Fully covered methods: 309
  Total methods: 385

PatternKit.Core                                                                  92.6%
  PatternKit.Behavioral.Chain.ActionChain<T>                                     84.7%
  PatternKit.Behavioral.Chain.ResultChain<T1, T2>                                 100%
  PatternKit.Behavioral.Strategy.ActionStrategy<T>                                 97%
  PatternKit.Behavioral.Strategy.AsyncStrategy<T1, T2>                           93.5%
  PatternKit.Behavioral.Strategy.Strategy<T1, T2>                                 100%
  PatternKit.Behavioral.Strategy.TryStrategy<T1, T2>                             95.8%
  PatternKit.Common.Option<T>                                                      60%
  PatternKit.Common.Throw                                                         100%
  PatternKit.Common.TryHandlerExtensions                                         33.3%
  PatternKit.Creational.Builder.BranchBuilder<T1, T2>                             100%
  PatternKit.Creational.Builder.BuilderExtensions                                 100%
  PatternKit.Creational.Builder.ChainBuilder<T>                                   100%
  PatternKit.Creational.Builder.Composer<T1, T2>                                  100%
  PatternKit.Creational.Builder.MutableBuilder<T>                                 100%

PatternKit.Examples                                                              86.2%
  PatternKit.Examples.ApiGateway.Demo                                            97.8%
  PatternKit.Examples.ApiGateway.MiniRouter                                      96.6%
  PatternKit.Examples.ApiGateway.Request                                           75%
  PatternKit.Examples.ApiGateway.Response                                         100%
  PatternKit.Examples.ApiGateway.Responses                                        100%
  PatternKit.Examples.Chain.AuthLoggingDemo                                      95.2%
  PatternKit.Examples.Chain.CardProcessors                                        100%
  PatternKit.Examples.Chain.CardTenderStrategy                                      0%
  PatternKit.Examples.Chain.CashTenderStrategy                                      0%
  PatternKit.Examples.Chain.ChainStage                                            100%
  PatternKit.Examples.Chain.CharityRoundUpRule                                     20%
  PatternKit.Examples.Chain.ConfigDriven.Bundle1OffEach                          14.2%
  PatternKit.Examples.Chain.ConfigDriven.CardTender                              72.2%
  PatternKit.Examples.Chain.ConfigDriven.Cash2Pct                                16.6%
  PatternKit.Examples.Chain.ConfigDriven.CashTender                              90.9%
  PatternKit.Examples.Chain.ConfigDriven.CharityRoundUp                           100%
  PatternKit.Examples.Chain.ConfigDriven.ConfigDrivenPipelineBuilderExtensions   94.2%
  PatternKit.Examples.Chain.ConfigDriven.ConfigDrivenPipelineDemo                 100%
  PatternKit.Examples.Chain.ConfigDriven.Loyalty5Pct                               20%
  PatternKit.Examples.Chain.ConfigDriven.NickelCashOnly                          77.7%
  PatternKit.Examples.Chain.ConfigDriven.PipelineOptions                          100%
  PatternKit.Examples.Chain.Customer                                              100%
  PatternKit.Examples.Chain.DeviceBus                                             100%
  PatternKit.Examples.Chain.GenericProcessor                                      100%
  PatternKit.Examples.Chain.HttpRequest                                           100%
  PatternKit.Examples.Chain.HttpResponse                                            0%
  PatternKit.Examples.Chain.IRoundingRule                                         100%
  PatternKit.Examples.Chain.LineItem                                              100%
  PatternKit.Examples.Chain.MediatedTransactionPipelineDemo                       100%
  PatternKit.Examples.Chain.NickelCashOnlyRule                                    100%
  PatternKit.Examples.Chain.NoopCharityTracker                                      0%
  PatternKit.Examples.Chain.RoundingPipeline                                      100%
  PatternKit.Examples.Chain.Tender                                                100%
  PatternKit.Examples.Chain.TenderRouterFactory                                  91.3%
  PatternKit.Examples.Chain.TenderStrategyRegistry                                  0%
  PatternKit.Examples.Chain.TransactionContext                                    100%
  PatternKit.Examples.Chain.TransactionPipeline                                   100%
  PatternKit.Examples.Chain.TransactionPipelineBuilder                           92.3%
  PatternKit.Examples.Chain.TxResult                                              100%
  PatternKit.Examples.Coercion.Coercer<T>                                        83.3%
  PatternKit.Examples.Coercion.CoercerExtensions                                  100%
  PatternKit.Examples.Generators.IntParser                                         60%
  PatternKit.Examples.Generators.OrderRouter                                     95.2%
  PatternKit.Examples.Generators.ScoreLabeler                                     100%
  PatternKit.Examples.Strategies.Composed.ChannelPolicy                           100%
  PatternKit.Examples.Strategies.Composed.ChannelPolicyFactory                    100%
  PatternKit.Examples.Strategies.Composed.ComposedStrategies                     94.2%
  PatternKit.Examples.Strategies.Composed.SendContext                             100%
  PatternKit.Examples.Strategies.Composed.SendResult                              100%

PatternKit.Generators                                                            93.9%
  PatternKit.Generators.StrategyGenerator                                        93.9%

PatternKit.Generators.Abstractions                                                  0%
  PatternKit.Generators.GenerateStrategyAttribute                                   0%

Copy link

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 99 out of 100 changed files in this pull request and generated 8 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

.And("classifying -2", s => Execute(s, -2))
.Then("should fall through to fallback 'other'", r => r is { Matched: true, Value: "other" })
.AssertPassed();
return;
Copy link

Copilot AI Sep 15, 2025

Choose a reason for hiding this comment

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

[nitpick] Unnecessary return statement at the end of an async Task method. This can be removed as the method will return naturally.

Copilot uses AI. Check for mistakes.
})
.And("paid by card", _ => ctx.Result!.Value.Code == "paid" && ctx.Log.Any(x => x.Contains("auth: captured")))
.AssertPassed();
return;
Copy link

Copilot AI Sep 15, 2025

Choose a reason for hiding this comment

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

The local function Pipe() is defined after a return statement, making it unreachable. Move the local function definition before the return statement or restructure the method.

Copilot uses AI. Check for mistakes.
@JerrettDavis JerrettDavis merged commit c27593f into main Sep 15, 2025
4 checks passed
@JerrettDavis JerrettDavis deleted the feature/add-chain-patterns branch September 15, 2025 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants