From 3e2af567fdceb707907b548752d5215ccec927cb Mon Sep 17 00:00:00 2001 From: Jan Calanog Date: Tue, 1 Jul 2025 15:26:18 +0200 Subject: [PATCH] Fix injection VersionsConfiguration in docs-assembler --- docs/testing/req.md | 7 +++++-- src/tooling/docs-assembler/AssembleContext.cs | 1 + .../docs-assembler/Cli/RepositoryCommands.cs | 19 +++---------------- src/tooling/docs-assembler/Program.cs | 1 + 4 files changed, 10 insertions(+), 18 deletions(-) diff --git a/docs/testing/req.md b/docs/testing/req.md index 526abebc6..24cd5f6f9 100644 --- a/docs/testing/req.md +++ b/docs/testing/req.md @@ -1,8 +1,11 @@ --- applies_to: - stack: preview 9.0, ga 9.1 + stack: ga + serverless: + elasticsearch: ga +mapped_pages: + - https://www.elastic.co/guide/en/elasticsearch/reference/current/es-connectors-usage.html --- - # Requirements ```{applies_to} diff --git a/src/tooling/docs-assembler/AssembleContext.cs b/src/tooling/docs-assembler/AssembleContext.cs index 4fd695ef0..0c2efca3d 100644 --- a/src/tooling/docs-assembler/AssembleContext.cs +++ b/src/tooling/docs-assembler/AssembleContext.cs @@ -6,6 +6,7 @@ using System.Reflection; using Elastic.Documentation.Configuration; using Elastic.Documentation.Configuration.Assembler; +using Elastic.Documentation.Configuration.Versions; using Elastic.Documentation.Diagnostics; namespace Documentation.Assembler; diff --git a/src/tooling/docs-assembler/Cli/RepositoryCommands.cs b/src/tooling/docs-assembler/Cli/RepositoryCommands.cs index caa6e6c8d..b09691413 100644 --- a/src/tooling/docs-assembler/Cli/RepositoryCommands.cs +++ b/src/tooling/docs-assembler/Cli/RepositoryCommands.cs @@ -23,10 +23,11 @@ using Elastic.Markdown.Exporters; using Elastic.Markdown.IO; using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; namespace Documentation.Assembler.Cli; -internal sealed class RepositoryCommands(ICoreService githubActionsService, ILoggerFactory logger) +internal sealed class RepositoryCommands(ICoreService githubActionsService, ILoggerFactory logger, IOptions versionsConfigOption) { private readonly ILogger _log = logger.CreateLogger(); @@ -166,20 +167,6 @@ public async Task UpdateLinkIndexAll(ContentSource contentSource, Cancel ct { { NarrativeRepository.RepositoryName, assembleContext.Configuration.Narrative } }; - var versionsConfig = new VersionsConfiguration - { - VersioningSystems = new Dictionary - { - { - VersioningSystemId.Stack, new VersioningSystem - { - Id = VersioningSystemId.Stack, - Current = new SemVersion(8, 0, 0), - Base = new SemVersion(8, 0, 0) - } - } - } - }; await Parallel.ForEachAsync(repositories, new ParallelOptions { @@ -195,7 +182,7 @@ await Parallel.ForEachAsync(repositories, collector, new FileSystem(), new FileSystem(), - versionsConfig, + versionsConfigOption.Value, checkout.Directory.FullName, outputPath ); diff --git a/src/tooling/docs-assembler/Program.cs b/src/tooling/docs-assembler/Program.cs index 1272f048e..cdaab2a22 100644 --- a/src/tooling/docs-assembler/Program.cs +++ b/src/tooling/docs-assembler/Program.cs @@ -15,6 +15,7 @@ .AddSingleton() ); + ConsoleApp.ServiceProvider = serviceProvider; var app = ConsoleApp.Create();