Skip to content

Commit 8e12e2a

Browse files
authored
Ensure clone-all starts error collection (#1224)
1 parent 8d6b126 commit 8e12e2a

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,8 @@ private void AssignOutputLogger()
3434
public async Task<int> Validate(Cancel ctx = default)
3535
{
3636
AssignOutputLogger();
37-
await using var collector = new ConsoleDiagnosticsCollector(logger, githubActionsService);
37+
await using var collector = new ConsoleDiagnosticsCollector(logger, githubActionsService).StartAsync(ctx);
3838
var assembleContext = new AssembleContext("dev", collector, new FileSystem(), new FileSystem(), null, null);
39-
_ = collector.StartAsync(ctx);
4039

4140
// this validates all path prefixes are unique, early exit if duplicates are detected
4241
if (!GlobalNavigationFile.ValidatePathPrefixes(assembleContext) || assembleContext.Collector.Errors > 0)
@@ -64,8 +63,7 @@ public async Task<int> ValidateLocalLinkReference([Argument] string? file = null
6463
AssignOutputLogger();
6564
file ??= ".artifacts/docs/html/links.json";
6665

67-
await using var collector = new ConsoleDiagnosticsCollector(logger, githubActionsService);
68-
_ = collector.StartAsync(ctx);
66+
await using var collector = new ConsoleDiagnosticsCollector(logger, githubActionsService).StartAsync(ctx);
6967

7068
var assembleContext = new AssembleContext("dev", collector, new FileSystem(), new FileSystem(), null, null);
7169

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public async Task<int> CloneAll(
5151
var githubEnvironmentInput = githubActionsService.GetInput("environment");
5252
environment ??= !string.IsNullOrEmpty(githubEnvironmentInput) ? githubEnvironmentInput : "dev";
5353

54-
await using var collector = new ConsoleDiagnosticsCollector(logger, githubActionsService);
54+
await using var collector = new ConsoleDiagnosticsCollector(logger, githubActionsService).StartAsync(ctx);
5555

5656
var assembleContext = new AssembleContext(environment, collector, new FileSystem(), new FileSystem(), null, null);
5757
var cloner = new AssemblerRepositorySourcer(logger, assembleContext);
@@ -85,9 +85,7 @@ public async Task<int> BuildAll(
8585
await using var collector = new ConsoleDiagnosticsCollector(logger, githubActionsService)
8686
{
8787
NoHints = true
88-
};
89-
90-
_ = collector.StartAsync(ctx);
88+
}.StartAsync(ctx);
9189

9290
var assembleContext = new AssembleContext(environment, collector, new FileSystem(), new FileSystem(), null, null)
9391
{

tests/docs-assembler.Tests/src/docs-assembler.Tests/GlobalNavigationTests.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,7 @@ public async Task UriResolving()
249249
{
250250
Assert.SkipUnless(HasCheckouts(), $"Requires local checkout folder: {CheckoutDirectory.FullName}");
251251

252-
await using var collector = new DiagnosticsCollector([]);
253-
_ = collector.StartAsync(TestContext.Current.CancellationToken);
252+
await using var collector = new DiagnosticsCollector([]).StartAsync(TestContext.Current.CancellationToken);
254253

255254
var fs = new FileSystem();
256255
var assembleContext = new AssembleContext("prod", collector, fs, fs, null, null);

0 commit comments

Comments
 (0)