Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 5 additions & 15 deletions .reviewmark.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,40 +71,30 @@ reviews:
paths:
- "docs/reqstream/build-mark/cli/cli.yaml"
- "docs/design/build-mark/cli/cli.md"
- "docs/design/build-mark/cli/context.md"
- "docs/design/build-mark/program.md"
- "test/**/Cli/ContextTests.cs"

- id: BuildMark-SelfTest
title: Review of BuildMark SelfTest subsystem (self-validation)
paths:
- "docs/reqstream/build-mark/self-test/self-test.yaml"
- "docs/design/build-mark/self-test/self-test.md"
- "docs/design/build-mark/self-test/validation.md"
- "test/**/SelfTest/ValidationTests.cs"

- id: BuildMark-Utilities
title: Review of BuildMark Utilities subsystem (shared utilities)
paths:
- "docs/reqstream/build-mark/utilities/utilities.yaml"
- "docs/design/build-mark/utilities/utilities.md"
- "docs/design/build-mark/utilities/path-helpers.md"
- "test/**/Utilities/PathHelpersTests.cs"

- id: BuildMark-RepoConnectors
title: Review of BuildMark RepoConnectors subsystem (repository connectors)
paths:
- "docs/reqstream/build-mark/repo-connectors/repo-connectors.yaml" # subsystem requirements
- "docs/design/build-mark/repo-connectors/repo-connectors.md" # subsystem design
- "docs/design/build-mark/repo-connectors/github-repo-connector.md" # GitHubRepoConnector unit design
- "src/**/RepoConnectors/IRepoConnector.cs" # connector interface
- "src/**/RepoConnectors/RepoConnectorBase.cs" # connector base class
- "src/**/RepoConnectors/RepoConnectorFactory.cs" # connector factory
- "src/**/RepoConnectors/MockRepoConnector.cs" # mock connector
- "src/**/RepoConnectors/ProcessRunner.cs" # process runner
- "test/**/RepoConnectors/MockRepoConnectorTests.cs" # mock connector tests
- "test/**/RepoConnectors/ProcessRunnerTests.cs" # process runner tests
- "test/**/RepoConnectors/RepoConnectorFactoryTests.cs" # factory tests
- "docs/reqstream/build-mark/repo-connectors/repo-connectors.yaml"
- "docs/design/build-mark/repo-connectors/repo-connectors.md"
Comment thread
Malcolmnixon marked this conversation as resolved.
- "test/**/RepoConnectors/MockRepoConnectorTests.cs"
- "test/**/RepoConnectors/ProcessRunnerTests.cs"
- "test/**/RepoConnectors/RepoConnectorFactoryTests.cs"

- id: BuildMark-Architecture
title: Review of BuildMark system-level behavior and integration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,26 @@ public GitHubGraphQLClient(string token, string? graphqlEndpoint = null)
{
// Initialize HTTP client with authentication and user agent headers
var httpClient = new HttpClient();
httpClient.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", token);
httpClient.DefaultRequestHeaders.UserAgent.Add(
new ProductInfoHeaderValue("BuildMark", "1.0"));
try
{
httpClient.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", token);
httpClient.DefaultRequestHeaders.UserAgent.Add(
new ProductInfoHeaderValue("BuildMark", "1.0"));

// Create GraphQL HTTP client with the configured HTTP client
var options = new GraphQLHttpClientOptions
// Create GraphQL HTTP client with the configured HTTP client
var options = new GraphQLHttpClientOptions
{
EndPoint = new Uri(graphqlEndpoint ?? DefaultGitHubGraphQLEndpoint)
};
_graphqlClient = new GraphQLHttpClient(options, new SystemTextJsonSerializer(), httpClient);
_ownsGraphQLClient = true;
}
catch
{
EndPoint = new Uri(graphqlEndpoint ?? DefaultGitHubGraphQLEndpoint)
};
_graphqlClient = new GraphQLHttpClient(options, new SystemTextJsonSerializer(), httpClient);
_ownsGraphQLClient = true;
httpClient.Dispose();
throw;
}
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@ private static string GetTypeFromLabels(IReadOnlyList<IssueLabelInfo> labels)
var matchingType = labels
.Select(label => label.Name.ToLowerInvariant())
.SelectMany(lowerLabel => LabelTypeMap
.Where(kvp => lowerLabel.Contains(kvp.Key))
.Where(kvp => lowerLabel == kvp.Key)
.Select(kvp => kvp.Value))
.FirstOrDefault();
Comment thread
Malcolmnixon marked this conversation as resolved.

Expand All @@ -865,7 +865,7 @@ private static string GetTypeFromLabels(IReadOnlyList<PullRequestLabelInfo> labe
var matchingType = labels
.Select(label => label.Name.ToLowerInvariant())
.SelectMany(lowerLabel => LabelTypeMap
.Where(kvp => lowerLabel.Contains(kvp.Key))
.Where(kvp => lowerLabel == kvp.Key)
.Select(kvp => kvp.Value))
.FirstOrDefault();

Expand Down
16 changes: 8 additions & 8 deletions test/DemaConsulting.BuildMark.Tests/SelfTest/ValidationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ public void Validation_Run_WithTrxResultsFile_WritesTrxFile()
using var outputWriter = new StringWriter();
using var errorWriter = new StringWriter();

var originalOut = Console.Out;
var originalError = Console.Error;
try
{
// Capture console output
Expand All @@ -67,10 +69,8 @@ public void Validation_Run_WithTrxResultsFile_WritesTrxFile()
finally
{
// Restore console output
var standardOutput = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = true };
Console.SetOut(standardOutput);
var standardError = new StreamWriter(Console.OpenStandardError()) { AutoFlush = true };
Console.SetError(standardError);
Console.SetOut(originalOut);
Console.SetError(originalError);
}
}
finally
Expand Down Expand Up @@ -101,6 +101,8 @@ public void Validation_Run_WithXmlResultsFile_WritesJUnitFile()
using var outputWriter = new StringWriter();
using var errorWriter = new StringWriter();

var originalOut = Console.Out;
var originalError = Console.Error;
try
{
// Capture console output
Expand All @@ -122,10 +124,8 @@ public void Validation_Run_WithXmlResultsFile_WritesJUnitFile()
finally
{
// Restore console output
var standardOutput = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = true };
Console.SetOut(standardOutput);
var standardError = new StreamWriter(Console.OpenStandardError()) { AutoFlush = true };
Console.SetError(standardError);
Console.SetOut(originalOut);
Console.SetError(originalError);
}
}
finally
Expand Down