Skip to content

Commit dbf6d53

Browse files
authored
Fix injection VersionsConfiguration in docs-assembler (#1489)
1 parent 519c2df commit dbf6d53

File tree

4 files changed

+10
-18
lines changed

4 files changed

+10
-18
lines changed

docs/testing/req.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
---
22
applies_to:
3-
stack: preview 9.0, ga 9.1
3+
stack: ga
4+
serverless:
5+
elasticsearch: ga
6+
mapped_pages:
7+
- https://www.elastic.co/guide/en/elasticsearch/reference/current/es-connectors-usage.html
48
---
5-
69
# Requirements
710

811
```{applies_to}

src/tooling/docs-assembler/AssembleContext.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using System.Reflection;
77
using Elastic.Documentation.Configuration;
88
using Elastic.Documentation.Configuration.Assembler;
9+
using Elastic.Documentation.Configuration.Versions;
910
using Elastic.Documentation.Diagnostics;
1011

1112
namespace Documentation.Assembler;

src/tooling/docs-assembler/Cli/RepositoryCommands.cs

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,11 @@
2323
using Elastic.Markdown.Exporters;
2424
using Elastic.Markdown.IO;
2525
using Microsoft.Extensions.Logging;
26+
using Microsoft.Extensions.Options;
2627

2728
namespace Documentation.Assembler.Cli;
2829

29-
internal sealed class RepositoryCommands(ICoreService githubActionsService, ILoggerFactory logger)
30+
internal sealed class RepositoryCommands(ICoreService githubActionsService, ILoggerFactory logger, IOptions<VersionsConfiguration> versionsConfigOption)
3031
{
3132
private readonly ILogger<Program> _log = logger.CreateLogger<Program>();
3233

@@ -166,20 +167,6 @@ public async Task<int> UpdateLinkIndexAll(ContentSource contentSource, Cancel ct
166167
{
167168
{ NarrativeRepository.RepositoryName, assembleContext.Configuration.Narrative }
168169
};
169-
var versionsConfig = new VersionsConfiguration
170-
{
171-
VersioningSystems = new Dictionary<VersioningSystemId, VersioningSystem>
172-
{
173-
{
174-
VersioningSystemId.Stack, new VersioningSystem
175-
{
176-
Id = VersioningSystemId.Stack,
177-
Current = new SemVersion(8, 0, 0),
178-
Base = new SemVersion(8, 0, 0)
179-
}
180-
}
181-
}
182-
};
183170
await Parallel.ForEachAsync(repositories,
184171
new ParallelOptions
185172
{
@@ -195,7 +182,7 @@ await Parallel.ForEachAsync(repositories,
195182
collector,
196183
new FileSystem(),
197184
new FileSystem(),
198-
versionsConfig,
185+
versionsConfigOption.Value,
199186
checkout.Directory.FullName,
200187
outputPath
201188
);

src/tooling/docs-assembler/Program.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
.AddSingleton<DiagnosticsCollector>()
1616
);
1717

18+
1819
ConsoleApp.ServiceProvider = serviceProvider;
1920

2021
var app = ConsoleApp.Create();

0 commit comments

Comments
 (0)