feat(search): move DocumentationDocument and friends into Elastic.Documentation#3553
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (18)
💤 Files with no reviewable changes (3)
✅ Files skipped from review due to trivial changes (3)
🚧 Files skipped from review as they are similar to previous changes (9)
📝 WalkthroughWalkthroughAdds local documentation search records ( Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/Elastic.Documentation/Elastic.Documentation.csproj`:
- Around line 14-15: The ProjectReference for Elastic.Internal.Search.Contract
in the Elastic.Documentation.csproj file uses a hardcoded workspace-specific
external path (../../../../.supacode/repos/...) that will not work in other
environments. As indicated by the TODO comment, replace this ProjectReference
with a PackageReference to the contract package instead, or if the package
version is not yet published, restructure the reference to use a repo-local path
that does not depend on external workspace layouts. Remove the external path
dependency to ensure the project can be restored and built in any environment.
In
`@src/services/search/Elastic.Documentation.Search/Elastic.Documentation.Search.csproj`:
- Around line 19-20: The ProjectReference pointing to the hardcoded
`.supacode/repos/website-search-data/...` path in the
Elastic.Documentation.Search.csproj file creates a portability issue by forcing
a specific directory layout dependency. Replace this ProjectReference to
Elastic.Internal.Search.Contract.csproj with a PackageReference to the
Elastic.Internal.Search.Contract NuGet package once it is published, or if it is
already published, use the PackageReference immediately instead of the
path-based ProjectReference to ensure the project can be restored and built in
any environment without requiring a specific sibling checkout structure.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 0f3ddfc4-85a4-4bba-a979-88bca5bcbe19
📒 Files selected for processing (18)
Directory.Packages.propssrc/Elastic.Documentation/AppliesTo/ApplicableTo.cssrc/Elastic.Documentation/Elastic.Documentation.csprojsrc/Elastic.Documentation/Search/AppliesToEntry.cssrc/Elastic.Documentation/Search/DocumentationDocument.cssrc/Elastic.Documentation/Search/DocumentationMappingConfig.cssrc/Elastic.Documentation/Search/DocumentationMappingExtensions.cssrc/Elastic.Documentation/Search/IndexedProduct.cssrc/Elastic.Documentation/Serialization/SourceGenerationContext.cssrc/api/Elastic.Documentation.Mcp.Remote/Gateways/DocumentGateway.cssrc/services/Elastic.Documentation.Assembler/Building/AssemblerSitemapService.cssrc/services/search/Elastic.Documentation.Search/ChangesService.cssrc/services/search/Elastic.Documentation.Search/Common/ElasticsearchClientAccessor.cssrc/services/search/Elastic.Documentation.Search/Common/ElasticsearchClientJsonResolver.cssrc/services/search/Elastic.Documentation.Search/Elastic.Documentation.Search.csprojtests-integration/Elastic.Documentation.IntegrationTests/Search/SearchBootstrapFixture.cstests-integration/Mcp.Remote.IntegrationTests/McpToolsIntegrationTestsBase.cstests-integration/Search.IntegrationTests/SearchRelevanceTests.cs
💤 Files with no reviewable changes (3)
- src/services/Elastic.Documentation.Assembler/Building/AssemblerSitemapService.cs
- src/api/Elastic.Documentation.Mcp.Remote/Gateways/DocumentGateway.cs
- src/Elastic.Documentation/AppliesTo/ApplicableTo.cs
9592958 to
0a6c880
Compare
…umentation Move DocumentationDocument, AppliesToEntry, IndexedProduct, and DocumentationMappingConfig (+ DocumentationMappingExtensions) from the Elastic.Internal.Search.Contract NuGet package into the Elastic.Documentation project under the Elastic.Documentation.Search namespace. These types belong to the docs producer, not the shared contract. Wire up runtime polymorphism via SearchDocumentPolymorphism.Compose(): - Register DocumentationDocument as a "docs" derived type on both ISearchDocument and SearchDocumentBase at startup in ElasticsearchClientJsonResolver. - Enable WithFallback() so missing/unknown $type deserializes to a concrete SearchDocumentBase instead of throwing NotSupportedException. Bump Elastic.Mapping to 0.48.0 to match the updated contract dependency. Use a temporary ProjectReference to the local contract branch until the new package version is published. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ageReference 0.11.0 The temporary local ProjectReference (pointing at a supacode workspace path) broke CI. Replace with the now-published NuGet package and remove the unused `using Elastic.Internal.Search` that caused an ambiguous SourceGenerationContext reference after the contract package gained its own. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com>
0a6c880 to
cca988a
Compare
Summary
Moves
DocumentationDocument,AppliesToEntry,IndexedProduct, andDocumentationMappingConfig(plus the extractedDocumentationMappingExtensions) from theElastic.Internal.Search.ContractNuGet package into theElastic.Documentationproject under theElastic.Documentation.Searchnamespace. These docs-builder-specific types belong to the docs producer, not the shared contract package.SearchDocumentPolymorphism.Compose()(new in the companion contract PR):DocumentationDocument → "docs"on bothISearchDocumentandSearchDocumentBaseat startup.WithFallback()so missing/unknown$typedeserializes to a concreteSearchDocumentBaseinstead of throwingNotSupportedException.ElasticsearchClientJsonResolveris rewritten to useCompose(), composing the contract, Elasticsearch, and docs source-gen contexts.Elastic.Mappingbumped to0.48.0to match the updated contract dependency.ProjectReferenceto the local contract branch (TODO: switch back toPackageReferenceonce published).Depends on
website-search-data PR #215 — introduces
SearchDocumentPolymorphismand removesDocumentationDocumentfrom the contract package. Switch theProjectReferenceback to aPackageReferencebefore merging this PR (after PR #215 is published).Test plan
dotnet build— 0 errors, 1 pre-existing vulnerability warningdotnet-lintpre-push hook — passes (no formatting violations)dotnet test tests/Elastic.Documentation.Build.Tests/— 44 tests, all greentests-integration/) compile cleanly; runtime requires ES connection🤖 Generated with Claude Code