-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Initial project setup with Lambda timeout middleware and comprehensive documentation #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…hensive documentation - Add LambdaTimeoutLinkMiddleware for Lambda timeout-aware request cancellation - Add ApplicationBuilder extension method UseLambdaTimeoutLinkedCancellation() - Create comprehensive documentation structure with examples and best practices - Set up GitHub Actions for CI/CD (build, test, docs deployment) - Configure solution structure with proper organization - Add CLAUDE.md for future AI assistance context 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Create test project LayeredCraft.Lambda.AspNetCore.HostingExtensions.Tests - Add project reference to main library - Configure xUnit test runner settings - Add to solution structure in test folder 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Add mkdocs.yml with Material theme configuration - Add requirements.txt for Python documentation dependencies - Add custom CSS styling for LayeredCraft branding - Configure navigation, search, and code highlighting - Enable dark/light theme toggle and responsive design 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Remove docs/assets/css/extra.css (not needed, follows CDK constructs pattern) - Remove extra_css reference from mkdocs.yml - Keep only Jekyll style.scss to match existing LayeredCraft documentation pattern - Align with CDK constructs repo structure using Material theme defaults 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Update requirements.txt to match CDK constructs versions exactly - Replace git-revision-date-localized plugin with minify plugin - Remove pymdown-extensions dependency (included with mkdocs-material) - Fix GitHub Actions build error with missing plugin 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
There was a problem hiding this 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 establishes the foundational structure for LayeredCraft Lambda ASP.NET Core Hosting Extensions, implementing a comprehensive Lambda timeout middleware with full documentation and CI/CD infrastructure.
- Core implementation of
LambdaTimeoutLinkMiddlewarefor intelligent timeout handling - Complete project setup with solution structure, documentation, and CI/CD pipelines
- Comprehensive documentation site with middleware guides and real-world examples
Reviewed Changes
Copilot reviewed 19 out of 21 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/LayeredCraft.Lambda.AspNetCore.HostingExtensions/Middleware/LambdaTimeoutLinkMiddleware.cs | Core middleware implementation for linking Lambda timeout with HTTP request cancellation |
| src/LayeredCraft.Lambda.AspNetCore.HostingExtensions/Extensions/ApplicationBuilderExtensions.cs | Extension method for easy middleware integration |
| src/LayeredCraft.Lambda.AspNetCore.HostingExtensions/LayeredCraft.Lambda.AspNetCore.HostingExtensions.csproj | Main library project file with dependencies |
| test/LayeredCraft.Lambda.AspNetCore.HostingExtensions.Tests/ | Test project setup with placeholder tests |
| docs/ | Complete documentation structure with middleware guides and examples |
| Solution and build files | Project organization, CI/CD workflows, and package configuration |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
...etCore.HostingExtensions.Tests/LayeredCraft.Lambda.AspNetCore.HostingExtensions.Tests.csproj
Show resolved
Hide resolved
- Add 12 complete unit tests covering all middleware functionality - Fix critical middleware bug in timeout vs client disconnect detection - Implement robust cancellation token registration with timestamps - Add short-circuit optimization for expired Lambda timeouts - Create comprehensive test infrastructure with AutoFixture specimen builders - Add convention-based parameter naming for different test scenarios - Enhance HttpContextSpecimenBuilder for Lambda context simulation - Add RequestDelegateSpecimenBuilder for delegate behavior testing - Verify proper token linking, restoration, and response handling - Test constructor validation, null checks, and edge cases 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
There was a problem hiding this 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 27 out of 29 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| }; | ||
| } | ||
|
|
||
| private static HttpContext CreateDefaultHttpContext(ISpecimenContext context, bool hasLambdaContext = true, bool responseStarted = false, bool preCancelled = false) |
Copilot
AI
Sep 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method has too many boolean parameters which makes it difficult to understand the intended behavior from call sites. Consider using an options pattern or separate factory methods for different scenarios.
| return parameterName switch | ||
| { | ||
| // For tests that need to capture the token during execution | ||
| "capturingnext" or "capturingdelegate" => CreateCapturingRequestDelegate(), | ||
|
|
||
| // For tests that just need to verify it was called | ||
| "trackingnext" or "trackingdelegate" => CreateTrackingRequestDelegate(), | ||
|
|
||
| // For timeout cancellation testing | ||
| "timeoutdelegate" or "timeoutcancelling" => CreateTimeoutCancellingDelegate(), | ||
|
|
||
| // For client disconnect cancellation testing | ||
| "disconnectdelegate" or "disconnectcancelling" => CreateClientDisconnectDelegate(), | ||
|
|
||
| // Default: simple delegate that just completes | ||
| _ => CreateSimpleRequestDelegate() | ||
| }; |
Copilot
AI
Sep 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using parameter names with string matching creates brittle test dependencies. Consider using an enum or attribute-based approach to specify the desired delegate behavior more explicitly.
… coverage - Add Microsoft.Testing.Extensions.CodeCoverage v17.14.2 for code coverage reporting - Enables coverage analysis with Microsoft Testing Platform (MTP) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Summary
This PR establishes the initial project setup for LayeredCraft Lambda ASP.NET Core Hosting Extensions, implementing a comprehensive Lambda timeout middleware with full documentation and CI/CD pipeline.
Changes
Core Implementation
UseLambdaTimeoutLinkedCancellation()for easy integrationDocumentation
Project Setup
Key Features
Test plan
dotnet build🤖 Generated with Claude Code