Extract Elastic.Documentation.Search.Contract as zero-dep library#3349
Closed
Mpdreamz wants to merge 14 commits into
Closed
Extract Elastic.Documentation.Search.Contract as zero-dep library#3349Mpdreamz wants to merge 14 commits into
Mpdreamz wants to merge 14 commits into
Conversation
Three projects (Api.Core, Api.Infrastructure, Api.App) collapsed into Elastic.Documentation.Api. Mcp.Remote no longer references any Api.* project — its only deps are ServiceDefaults, services/Search, and services/Assembler. Key moves: - EuidSpanProcessor + EuidLogProcessor → ServiceDefaults (shared) - AddEuidEnrichment helper added to ServiceDefaults - Search gateway interfaces (IFullSearchGateway, INavigationSearchGateway, IChangesGateway) → services/Elastic.Documentation.Search - McpToolSourceName constant inlined into Mcp.Remote Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…x-x64 Enables arm64 image builds to publish and copy the correct architecture artifact rather than always using the amd64 binary. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…r key - Register McpTools ActivitySource in Mcp.Remote TracerProvider so MCP spans are captured - Use GetEntryAssembly() over GetCallingAssembly() for service.version so the host service's version is reported rather than ServiceDefaults - OtlpProxyOptions now checks OTEL_EXPORTER_OTLP_ENDPOINT first then OTLP_PROXY_ENDPOINT as backward-compatible fallback, matching the documented priority order Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Removes the ports-and-adapters boilerplate that required three types (interface + gateway impl + usecase orchestrator) for each feature. Each feature now has a single interface and implementation: - IFullSearchService / FullSearchService (was IGateway + Gateway + Usecase) - INavigationSearchService / NavigationSearchService - IChangesService / ChangesService - IOtlpService / AdotOtlpService IAskAiService/IAskAiMessageFeedbackService renamed from Gateway variants; AddElasticDocsApiUsecases → AddElasticDocsApiServices throughout. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…oject Create Elastic.Documentation.Tooling to hold infrastructure types (ExternalCommandExecutor, GitCheckoutInformationFactory, Exporter, Paths, FileSystemFactory) that dragged YamlDotNet, Proc, IniFileParser, and Nullean.Argh into the domain library. Move YAML converters (SemVersionConverter, ApplicableToYamlConverter) into Elastic.Markdown where they are consumed. Swap YamlMember/YamlSerializable attributes on AppliesTo types for JsonPropertyName equivalents so the domain library no longer depends on YamlDotNet at all. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…ions from Elastic.Documentation IHostedService on IDiagnosticsCollector was vestigial — nothing registers a collector as a hosted service; all callers use the public virtual StartAsync/StopAsync directly. Replace the explicit IHostedService implementation with a private EnsureStarted helper and add StartAsync/StopAsync directly to IDiagnosticsCollector. System.IO.Abstractions is already pulled in transitively via Nullean.ScopedFileSystem so the direct reference was redundant. Elastic.Documentation now has four direct packages: Elastic.Mapping, Microsoft.Extensions.Logging, NetEscapades.EnumGenerators, Nullean.ScopedFileSystem. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Elastic.Documentation.Configuration now contains only YAML schema types and deserializer wiring. Non-schema types are relocated: IEnvironmentVariables and SymlinkValidator move to Elastic.Documentation (domain primitives); CrossLinkEntry and DocSetRegistry move into the existing Builder/ sub-namespace; the dead LenientStringListConverter is deleted. Elastic.Documentation root namespace is pruned: ChangelogEntryType and ChangelogEntrySubtype move to the existing ReleaseNotes/ sub-namespace; SemVersion, VersionSpec, and VersionOrDate move to a new Versions/ sub-namespace; GlobalCliOptions moves to Elastic.Documentation.Tooling (preserving the Elastic.Documentation namespace via pragma so consumers need only a using-directive update, not a project-reference change). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…nfiguration Centralizes all YAML file reading in Elastic.Documentation.Configuration. The five serialization types (ChangelogConfigurationYaml, YamlLenientList, YamlLenientListConverter, TypeEntryYamlConverter) and ChangelogConfigurationLoader move from Elastic.Changelog into Configuration.Changelog/, registered in the shared YamlStaticContext so the single-static-context-per-assembly constraint is respected. Elastic.Changelog consumers drop the old using directives; no new project references are needed since Changelog already references Configuration. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
GlobalCliOptions moved here in PR4 and carries the Argh doc-comment shortnames/summaries that populate the CLI schema. Without GenerateDocumentationFile=true those annotations are invisible to the schema generator, making the schema diff fail in CI. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
website-search-data needs the DocumentationDocument shape and mapping config without pulling in the full Elastic.Documentation assembly (YAML loading, AppliesTo parsing, link registries, etc.). The new project has zero ProjectReferences and a single NuGet dep (Elastic.Mapping), making it safe to take as a standalone dep. DocumentationDocument.Applies changes from ApplicableTo? to IReadOnlyCollection<AppliesToEntry>, eliminating the AppliesTo project dep from the contract. ApplicableTo.ToAppliesTo() centralises the conversion so the wire-format is defined in exactly one place. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Member
Author
|
Reopening against correct base branch (refactor/organize-doc-namespaces) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
website-search-dataneeds to depend onDocumentationDocumentand the Elasticsearch mapping config to interoperate with docs-builder indices, but pulling in the fullElastic.Documentationassembly drags in YAML deserialization, AppliesTo parsing, link registries, and other heavyweight concerns. Without this extraction there is no safe, minimal target to depend on.What
A new
Elastic.Documentation.Search.Contractproject containsDocumentationDocument,ParentDocument,IndexedProduct,DocumentationMappingConfig/LexicalConfig/SemanticConfig/DocumentationAnalysisFactory, and a new wire-formatAppliesToEntryrecord. The project has zeroProjectReferences and a single NuGet dependency (Elastic.Mapping), so external consumers can reference it without inheriting anything from docs-builder itself.Elastic.Documentationgains aProjectReferenceto the contract, so every existing internal consumer (Markdown exporter, ApiExplorer, search service, Assembler, Mcp.Remote) gets the types transitively with no new project references on their end.How
DocumentationDocument.Applieswas previously typed asApplicableTo?— a rich domain type from the AppliesTo subsystem — which would have pulled that subsystem into the contract. The property is now typed asIReadOnlyCollection<AppliesToEntry>?, whereAppliesToEntryis a flat wire-format record matching the JSON shape thatApplicableToJsonConverteralready produced. The conversion is centralized inApplicableTo.ToAppliesTo(), ensuring the lifecycle/sub-type mapping lives in exactly one place. The indexed JSON shape in Elasticsearch is unchanged.