Skip to content

removed some stuff I shouldn't have - #2247

Merged
david-driscoll merged 2 commits into
mainfrom
feature/oops-generator-tests
Jun 28, 2026
Merged

removed some stuff I shouldn't have#2247
david-driscoll merged 2 commits into
mainfrom
feature/oops-generator-tests

Conversation

@david-driscoll

Copy link
Copy Markdown
Member

No description provided.

@github-actions github-actions Bot added this to the v10.0.3 milestone Jun 28, 2026
@david-driscoll
david-driscoll force-pushed the feature/oops-generator-tests branch from 8327cc0 to 16b7a93 Compare June 28, 2026 04:38
@github-actions

github-actions Bot commented Jun 28, 2026

Copy link
Copy Markdown

Test Results

0 tests  ±0   0 ✅ ±0   0s ⏱️ ±0s
0 suites ±0   0 💤 ±0 
0 files   ±0   0 ❌ ±0 

Results for commit dc3d7cb. ± Comparison against base commit 4ebe309.

♻️ This comment has been updated with latest results.

@codacy-production codacy-production Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR is currently not up to standards according to Codacy, with 250 new issues and 113 new clones detected. A significant logic error in the diagnostic filtering logic (VerifyGeneratorTextContext.cs) suggests that the 'Implement diagnostic severity filtering' acceptance criterion is not correctly fulfilled; the current implementation likely filters out all diagnostics when no filter is provided.

Furthermore, the PR introduces critical portability issues by hardcoding local Windows filesystem paths in the NuGet configuration and including IDE-specific metadata. These issues must be addressed to ensure the project remains buildable in CI/CD and cross-platform environments.

About this PR

  • The PR title is generic and lacks a description, which hinders the review process. Additionally, IDE-specific configuration files (the .idea folder) are being committed. These should be removed and added to .gitignore to keep the repository clean of environment-specific metadata.

Test suggestions

  • Verify diagnostic filtering by severity level in Source Generator tests.
  • Ensure CancellationToken is correctly passed to the generator GenerateAsync method.
  • Verify TUnit logging sink correctly captures and formats logs.
  • Verify XUnit integration correctly resolves types using AutoFake, AutoMock, and AutoSubstitute containers.

TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback

if (customizer.GetInvocationList() is { Length: > 0, } methods)
{
return (results, target, data) =>
return customizer.GetInvocationList() is { Length: > 0, } methods

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 HIGH RISK

Safely access the invocation list of the 'customizer' delegate using the null-conditional operator to prevent a NullReferenceException.

Suggested change
return customizer.GetInvocationList() is { Length: > 0, } methods
return customizer?.GetInvocationList() is { Length: > 0, } methods

See Issue in Codacy

<add key="automatic" value="True" />
</packageRestore>
<packageSources>
<add key="local" value="C:\Development\RocketSurgeonsGuild\Testing\artifacts\nuget\" />

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 HIGH RISK

Avoid using absolute local paths (e.g., C:\...) in NuGet.config. This prevents the repository from being portable and will cause build failures in CI/CD environments or on other developers' machines. Use relative paths instead.

<?xml version="1.0" encoding="UTF-8"?>
<module external.system.id="pyproject.toml" type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$/../../apm_modules/dotnet/skills/tests/dotnet-test/code-testing-agent/fixtures/python-workspace-integrity" />

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 MEDIUM RISK

Avoid referencing paths outside the repository boundaries (e.g., ../../apm_modules/...). This prevents the project from being self-contained.

data["FinalDiagnostics"] = target.FinalDiagnostics.Where(s => s.Severity >= target.Severity).OrderDiagnosticResults();
data["GeneratorDiagnostics"] = target.Results.ToDictionary(z => z.Key.FullName!, z => z.Value.Diagnostics.OrderDiagnosticResults());
data["AnalyzerDiagnostics"] = target.AnalyzerResults.ToDictionary(z => z.Key.FullName!, z => z.Value.Diagnostics.OrderDiagnosticResults());
data["GeneratorDiagnostics"] = target.Results.ToDictionary(z => z.Key.FullName!, z => z.Value.Diagnostics.Where(s => s.Severity >= target.Severity).OrderDiagnosticResults());

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 MEDIUM RISK

The filtering logic s.Severity >= target.Severity will return false if target.Severity is null (the default). This results in all diagnostics being filtered out when no specific filter is requested. Update the logic to include all diagnostics by default, e.g., s.Severity >= (target.Severity ?? DiagnosticSeverity.Hidden).

{
return new(new { target.Diagnostics, }, target.SyntaxTrees.Select(Customizers.Selector));
}
private static ConversionResult Convert(GeneratorTestResult target, IReadOnlyDictionary<string, object> context) => new(new { target.Diagnostics, }, target.SyntaxTrees.Select(Customizers.Selector));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 HIGH RISK

Potential null dereference of 'target'. Consider using null-safe navigation or adding a guard clause.

Suggested change
private static ConversionResult Convert(GeneratorTestResult target, IReadOnlyDictionary<string, object> context) => new(new { target.Diagnostics, }, target.SyntaxTrees.Select(Customizers.Selector));
private static ConversionResult Convert(GeneratorTestResult target, IReadOnlyDictionary<string, object> context) => new(new { target?.Diagnostics, }, target?.SyntaxTrees.Select(Customizers.Selector) ?? []);

See Issue in Codacy

public static TestRecord Create(
TestContext testContext,
LogEventLevel logEventLevel = LogEventLevel.Verbose,
string? outputTemplate = null

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 MEDIUM RISK

Suggestion: Avoid using optional parameters in public methods to maintain better backward compatibility and stable binary contracts. Consider using method overloading for the 'Create' method instead.

See Issue in Codacy

public void GetTestUniqueId() => outputHelper.GetTestUniqueId().ShouldBe("66d256d940db996ce53528d6d76407726a8eaa10");

[Fact]
public void GetTestHashId() => outputHelper.GetTestHashId().ShouldBe(-485969091);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚪ LOW RISK

Suggestion: Avoid asserting against hardcoded hash results. Hash implementations are not guaranteed to be stable across different .NET runtimes or architectures, which can lead to flaky tests.

@codecov

codecov Bot commented Jun 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 45.21%. Comparing base (4ebe309) to head (dc3d7cb).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2247   +/-   ##
=======================================
  Coverage   45.21%   45.21%           
=======================================
  Files          38       38           
  Lines        3001     3001           
  Branches      185      185           
=======================================
  Hits         1357     1357           
  Misses       1594     1594           
  Partials       50       50           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@david-driscoll
david-driscoll merged commit 71f89e7 into main Jun 28, 2026
9 of 10 checks passed
@david-driscoll
david-driscoll deleted the feature/oops-generator-tests branch June 28, 2026 04:42
@codacy-production

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 11 high · 87 medium · 2 minor

Alerts:
⚠ 100 issues (≤ 0 issues of at least minor severity)

Results:
100 new issues

Category Results
Compatibility 66 medium
UnusedCode 14 medium
BestPractice 7 medium
CodeStyle 2 minor
Performance 11 high

View in Codacy

🟢 Metrics 111 complexity · 115 duplication

Metric Results
Complexity 111
Duplication 115

View in Codacy

AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

@github-actions github-actions Bot added the ✨ mysterious We forgot to label this label Jun 28, 2026
@github-actions github-actions Bot modified the milestones: v10.0.3, v10.0.4, v10.0.5, v10.0.6, v10.0.7 Jun 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ mysterious We forgot to label this

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant