-
Couldn't load subscription status.
- Fork 131
Feature/solr integration #802
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
Feature/solr integration #802
Conversation
…alth checks
- Add SolrResource with CoreName property and connection string support
- Implement SolrBuilderExtensions with AddSolr method for flexible configuration
- Add SolrHealthCheck for core-specific health monitoring using admin/ping endpoint
- Support custom ports and core names with automatic core pre-creation
- Provide connection strings with format: http://{host}:{port}/solr/{coreName}
- Add comprehensive unit tests covering all configuration scenarios
- Add integration tests with Docker container validation
- Update example AppHost with default and custom Solr configurations
- Add complete README with installation instructions and Apache Solr link
- Clean up using statements and optimize imports
- All 11 tests passing with full Docker-based validation
- Replace custom SolrHealthCheck class with built-in AddUrlGroup method - Remove SolrHealthCheck.cs file for cleaner codebase - Use direct URI construction for core-specific health endpoints - Maintain same functionality with less complexity and better maintainability - All 11 tests still passing with simplified approach
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 introduces a new hosting integration for Apache Solr container resources in .NET Aspire Community Toolkit. It provides a comprehensive implementation with container configuration, health checks, and connection string management for Solr cores.
Key Changes
- Adds a complete Solr hosting integration with configurable port and core name parameters
- Implements health check functionality to verify Solr core availability via admin ping endpoint
- Provides connection string expression that includes the full URL path to the specific Solr core
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/CommunityToolkit.Aspire.Hosting.Solr/SolrBuilderExtensions.cs |
Main extension method for adding Solr resources with container configuration and health checks |
src/CommunityToolkit.Aspire.Hosting.Solr/SolrResource.cs |
Resource class defining Solr container with connection string and endpoint properties |
src/CommunityToolkit.Aspire.Hosting.Solr/SolrContainerImageTags.cs |
Container image configuration using Solr 9.7 from docker.io |
tests/CommunityToolkit.Aspire.Hosting.Solr.Tests/SolrResourceTests.cs |
Unit tests for resource creation and configuration |
tests/CommunityToolkit.Aspire.Hosting.Solr.Tests/AppHostTests.cs |
Integration tests verifying container startup and health checks |
examples/solr/Program.cs |
Example application demonstrating Solr resource usage |
| Various project and solution files | Project structure and dependency configuration |
src/CommunityToolkit.Aspire.Hosting.Solr/SolrBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
|
@dotnet-policy-service agree |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
src/CommunityToolkit.Aspire.Hosting.Solr/SolrBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
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.
You need to update tests.yaml so that the new test project is detected - if you check out the failing check "Verify Test List" it'll have a diff of the change needed.
src/CommunityToolkit.Aspire.Hosting.Solr/CommunityToolkit.Aspire.Hosting.Solr.csproj
Outdated
Show resolved
Hide resolved
src/CommunityToolkit.Aspire.Hosting.Solr/CommunityToolkit.Aspire.Hosting.Solr.csproj
Outdated
Show resolved
Hide resolved
src/CommunityToolkit.Aspire.Hosting.Solr/CommunityToolkit.Aspire.Hosting.Solr.csproj
Outdated
Show resolved
Hide resolved
src/CommunityToolkit.Aspire.Hosting.Solr/SolrBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
src/CommunityToolkit.Aspire.Hosting.Solr/SolrBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
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.
If there's no need for a custom health check, let's remove this file
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.
The integration adds a Solr Core to the container and the healthcheck is needed to check if the core is available. Otherwise it cannot be used.
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.
ok, but there's no code in this file
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.
Damn, missed that. I moved the health check to SolrBuilderExtensions as that felt cleaner, but forgot to remove the HealthCheck file.
File is removed now.
…re.Hosting.Solr.csproj Co-authored-by: Aaron Powell <me@aaron-powell.com>
…re.Hosting.Solr.csproj Co-authored-by: Aaron Powell <me@aaron-powell.com>
…re.Hosting.Solr.csproj Co-authored-by: Aaron Powell <me@aaron-powell.com>
Co-authored-by: Aaron Powell <me@aaron-powell.com>
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.
ok, but there's no code in this file
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.
Looks good, I'll merge it shortly and we'll targe the CT 9.8 release for it to be released.
**Closes #792 **
Adds a hosting integration for the Solr container. It implements a health check to see if the created core is available and exposes the full URL to the core as a connection string.
PR Checklist
Other information