Add CronCraft dependency injection registration#19
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughAdds an ChangesAddCronCraft DI Registration
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
🎉 Thank you for your contribution! This PR was included in CronCraft v1.0.5 and is now live on NuGet for everyone to use. We really appreciate the time and effort you put in — it makes the library better for the whole community! 🚀 |
There was a problem hiding this comment.
Pull request overview
Adds an idiomatic dependency-injection registration entrypoint for CronCraft so consumers can register CronCraftService (and optional CronSettings configuration) via a single IServiceCollection extension method, with accompanying docs and integration tests.
Changes:
- Introduces
IServiceCollection.AddCronCraft(...)to register options infrastructure andCronCraftServiceas a singleton. - Updates repository and package READMEs with DI usage guidance.
- Adds DI-focused integration tests and required DI package references.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents AddCronCraft DI registration and injection usage. |
| CronCraft/README.md | Mirrors DI documentation for the packaged README. |
| CronCraft/Extensions/ServiceCollectionExtensions.cs | Adds AddCronCraft extension to register options + singleton service. |
| CronCraft/CronCraft.csproj | Adds DI abstractions package dependency needed for IServiceCollection extensions. |
| CronCraft.Test/ServiceCollectionExtensionsTest.cs | Adds integration tests for singleton registration, configuration, and fluent chaining. |
| CronCraft.Test/CronCraft.Test.csproj | Adds DI package dependency for ServiceCollection/BuildServiceProvider usage in tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| `IServiceCollection`: | ||
|
|
||
| ```csharp | ||
| using CronCraft.Extensions; |
| `IServiceCollection`: | ||
|
|
||
| ```csharp | ||
| using CronCraft.Extensions; |
|
🎉 Thank you for your contribution! This PR was included in CronCraft v1.0.6 and is now live on NuGet for everyone to use. We really appreciate the time and effort you put in — it makes the library better for the whole community! 🚀 |
Summary
AddCronCraft()as anIServiceCollectionextensionCronSettingsconfigurationCronCraftServiceas a singletonWhy
Consumers currently need to register
CronSettingsandCronCraftServicemanually. This adds an idiomatic one-call registration API for ASP.NET Core and generic host applications while keeping direct, non-DI usage available.Closes #9
Validation
dotnet test CronCraft.Test/CronCraft.Test.csproj --no-restore— 39 tests passeddotnet build CronCraft.sln --no-restore— succeeded with 0 warnings and 0 errorsSummary by CodeRabbit
New Features
Tests
Documentation