Skip to content

Conversation

@Chicoo
Copy link
Contributor

@Chicoo Chicoo commented Aug 14, 2025

**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

  • Created a feature/dev branch in your fork (vs. submitting directly from a commit on main)
  • Based off latest main branch of toolkit
  • PR doesn't include merge commits (always rebase on top of our main, if needed)
  • New integration
    • Docs are written
    • Added description of major feature to project description for NuGet package (4000 total character limit, so don't push entire description over that)
  • Tests for the changes have been added (for bug fixes / features) (if applicable)
  • Contains NO breaking changes
  • Every new API (including internal ones) has full XML docs
  • Code follows all style conventions

Other information

Chicoo added 5 commits August 10, 2025 10:39
…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
Copilot AI review requested due to automatic review settings August 14, 2025 17:59
Copy link
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 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

@Chicoo
Copy link
Contributor Author

Chicoo commented Aug 14, 2025

@dotnet-policy-service agree

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Member

@aaronpowell aaronpowell left a 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.

Copy link
Member

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

Copy link
Contributor Author

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.

Copy link
Member

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

Copy link
Contributor Author

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.

Copy link
Member

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

Copy link
Member

@aaronpowell aaronpowell left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Apache Solr Integration

3 participants