Skip to content

fix: resolve failing "👌 Verify build" CI job by providing Refitter.Core as a local NuGet package#1152

Closed
christianhelle wants to merge 5 commits into
mainfrom
feat/PRD-0002-decouple-msbuild
Closed

fix: resolve failing "👌 Verify build" CI job by providing Refitter.Core as a local NuGet package#1152
christianhelle wants to merge 5 commits into
mainfrom
feat/PRD-0002-decouple-msbuild

Conversation

@christianhelle

@christianhelle christianhelle commented Jun 15, 2026

Copy link
Copy Markdown
Owner

Description:

The 👌 Verify build GitHub Actions job in msbuild.yml was failing with:

error: NU1101: Unable to find package Refitter.Core. No packages exist with this id in source(s): D:\a\refitter\refitter\test\MSBuild
error: Package 'Refitter.MSBuild' is incompatible with 'all' frameworks

Root cause: Refitter.MSBuild.csproj references Refitter.Core via a <ProjectReference>. When dotnet pack generates the NuGet package, this project reference is converted into a NuGet package dependency on Refitter.Core in the .nuspec manifest. The CI workflow's Prepare step used dotnet add package Refitter.MSBuild -s ., which restricts NuGet to only the local test/MSBuild directory as a source. Because Refitter.Core was never packed and placed into that local feed, NuGet could not resolve the dependency and the restore step failed.

Fix: Updated .github/workflows/msbuild.yml to pack Refitter.Core.csproj and register the resulting .nupkg in the local NuGet feed before packing and installing Refitter.MSBuild:

dotnet pack -c release ../../src/Refitter.Core/Refitter.Core.csproj -o .
nuget add .\Refitter.Core.1.0.0.nupkg -source .

This ensures NuGet can resolve the Refitter.Core dependency when installing Refitter.MSBuild from the local feed. All of Refitter.Core's transitive dependencies (NSwag, Microsoft.CodeAnalysis, etc.) are already present in the NuGet cache from the earlier dotnet restore ../../src/Refitter.slnx step and require no additional changes.

Summary by CodeRabbit

  • New Features

    • Refactored code generation infrastructure to support flexible generation approaches with improved error handling and timeout management.
  • Chores

    • Updated MSBuild workflow to build and publish Refitter.Core package.
    • Enhanced test coverage for generation mechanisms.

@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Introduces an IGeneratorRunner interface with two concrete implementations—CliGeneratorRunner (subprocess via dotnet) and CoreGeneratorRunner (in-process via RefitGenerator)—plus a TestGeneratorRunner test double and OutputPlanner helper. RefitterGenerateTask is refactored to use the new abstraction, removing the prior IProcessRunner/IRuntimeResolver seams.

Changes

IGeneratorRunner abstraction and MSBuild task refactor

Layer / File(s) Summary
IGeneratorRunner interface and OutputPlanner helper
src/Refitter.Core/IGeneratorRunner.cs, src/Refitter.Core/OutputPlanner.cs
Defines the IGeneratorRunner contract returning generated file paths, and adds OutputPlanner.ShouldRerouteToContractsFolder to decide contracts-folder routing based on settings and filename.
CliGeneratorRunner: subprocess-based implementation
src/Refitter.Core/CliGeneratorRunner.cs
Spawns dotnet with the refitter DLL, collects stdout/stderr asynchronously, enforces a configurable timeout, validates exit code (collecting Error:/ERROR: lines), and parses GeneratedFileMarker lines to return generated paths.
CoreGeneratorRunner: in-process implementation
src/Refitter.Core/CoreGeneratorRunner.cs
Uses RefitGenerator in-process; branches on GenerateMultipleFiles, applies OutputPlanner for contracts-folder rerouting, normalizes line endings, ensures directories exist, and returns full output paths.
TestGeneratorRunner: injectable test double
src/Refitter.Core/TestGeneratorRunner.cs
Adds a test double with optional delegate handler; RunAsync dispatches to the handler when set or returns an empty array.
RefitterGenerateTask wiring and runner selection
src/Refitter.MSBuild/Refitter.MSBuild.csproj, src/Refitter.MSBuild/RefitterGenerateTask.cs
Adds ProjectReference to Refitter.Core, replaces ProcessRunner/RuntimeResolver injection with IGeneratorRunner injection, implements CreateDefaultRunner to resolve refitter.dll and select CLI or in-process runner, and replaces the process-based Execute path with TryRunGenerator/RunGenerator.
RefitterGenerateTaskTests updates
src/Refitter.Tests/MSBuild/RefitterGenerateTaskTests.cs
Injects CoreGeneratorRunner or TestGeneratorRunner delegates, adds failure-path tests for thrown exceptions, TimeoutException, and no-files-reported InvalidOperationException, renames methods to runner-centric names, and removes DelegatingProcessRunner/DelegatingRuntimeResolver.
MSBuild workflow: Refitter.Core packaging
.github/workflows/msbuild.yml
Updates the MSBuild workflow to pack and publish the Refitter.Core NuGet package alongside the existing Refitter and Refitter.MSBuild packages.

Sequence Diagram(s)

sequenceDiagram
  participant MSBuild
  participant RefitterGenerateTask
  participant CreateDefaultRunner
  participant CliGeneratorRunner
  participant CoreGeneratorRunner
  participant dotnetProcess as dotnet Process
  participant RefitGenerator

  MSBuild->>RefitterGenerateTask: Execute()
  RefitterGenerateTask->>CreateDefaultRunner: GeneratorRunner ?? CreateDefaultRunner()
  CreateDefaultRunner->>CreateDefaultRunner: ResolveRefitterDllForTask()
  alt refitter.dll found
    CreateDefaultRunner-->>RefitterGenerateTask: CliGeneratorRunner
    RefitterGenerateTask->>CliGeneratorRunner: RunAsync(settings, flags, ct)
    CliGeneratorRunner->>dotnetProcess: Start(dotnet refitter.dll args)
    dotnetProcess-->>CliGeneratorRunner: stdout/stderr lines
    CliGeneratorRunner-->>RefitterGenerateTask: generated file paths
  else refitter.dll not found
    CreateDefaultRunner-->>RefitterGenerateTask: CoreGeneratorRunner
    RefitterGenerateTask->>CoreGeneratorRunner: RunAsync(settings, flags, ct)
    CoreGeneratorRunner->>RefitGenerator: Generate(settings)
    RefitGenerator-->>CoreGeneratorRunner: generated code
    CoreGeneratorRunner-->>RefitterGenerateTask: written file paths
  end
  RefitterGenerateTask-->>MSBuild: GeneratedFiles / success or error
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • christianhelle/refitter#1129: Introduced IProcessRunner/IRuntimeResolver seams in RefitterGenerateTask that this PR directly replaces with IGeneratorRunner.
  • christianhelle/refitter#1067: Introduced GeneratedFile: marker parsing in the CLI output, which CliGeneratorRunner.ParseGeneratedFilePath builds upon.
  • christianhelle/refitter#745: Established the GeneratedFiles MSBuild output property that this PR now populates via runner results.

Poem

🐇 A rabbit hops through the code one day,
No more subprocess spawning to get in the way!
IGeneratorRunner leaps into the scene,
CLI or in-process — both sleek and keen.
The tests inject runners with a twitch of the nose,
And OutputPlanner routes contracts to where they should go! 🌿

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 7.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: resolving the failing CI job by providing Refitter.Core as a local NuGet package, which is the primary objective addressing the build verification issue.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/PRD-0002-decouple-msbuild

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@christianhelle christianhelle changed the title refactor: decouple MSBuild task from CLI binary dependency Decouple MSBuild task from CLI binary dependency Jun 15, 2026
@christianhelle christianhelle self-assigned this Jun 15, 2026
@christianhelle christianhelle added enhancement New feature, bug fix, or request .NET Pull requests that contain changes to .NET code labels Jun 15, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/Refitter.Tests/MSBuild/RefitterGenerateTaskTests.cs (1)

291-375: 🛠️ Refactor suggestion | 🟠 Major | 🏗️ Heavy lift

Update this new OpenAPI scenario test to follow required test helpers and matrix coverage.

This test currently uses hand-written JSON and only validates one OpenAPI 3.0 case. Please align it with project test conventions by using SwaggerFileHelper.CreateSwaggerJsonFile(), adding an OpenAPI 2.0 counterpart, and asserting generated code compilation via BuildHelper.BuildCSharp(..., targetFramework: "net8.0"|"net9.0"|"net10.0").

As per coding guidelines, "Use SwaggerFileHelper.CreateSwaggerFile() for YAML temp files and CreateSwaggerJsonFile() for JSON in tests", "Use BuildHelper.BuildCSharp() in tests to verify generated code compiles, supporting net8.0, net9.0, and net10.0 via the targetFramework parameter", and "Test with both OpenAPI 2.0 and 3.0 specifications when working with OpenAPI specifications".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/Refitter.Tests/MSBuild/RefitterGenerateTaskTests.cs` around lines 291 -
375, The test method
Execute_Should_Use_CoreGeneratorRunner_When_No_Cli_Available() needs to be
refactored to follow project conventions. Replace the hand-written JSON schema
creation with SwaggerFileHelper.CreateSwaggerJsonFile() for consistency. Create
a second test or parameterize the existing test to cover OpenAPI 2.0
specification in addition to OpenAPI 3.0. Add verification that the generated
code compiles by calling BuildHelper.BuildCSharp() after the code generation
with targetFramework parameter supporting "net8.0", "net9.0", and "net10.0".
This ensures the test validates both proper code generation and successful
compilation across multiple target frameworks.

Source: Coding guidelines

🧹 Nitpick comments (1)
src/Refitter.Core/TestGeneratorRunner.cs (1)

9-9: ⚡ Quick win

Rename _handler to follow repository private-field naming.

Use handler (camelCase, no underscore prefix) for the private field to match project conventions.

♻️ Proposed fix
-    private readonly Func<RefitGeneratorSettings, bool, bool, CancellationToken, Task<IReadOnlyList<string>>>? _handler;
+    private readonly Func<RefitGeneratorSettings, bool, bool, CancellationToken, Task<IReadOnlyList<string>>>? handler;
@@
-        _handler = handler;
+        this.handler = handler;
@@
-        if (_handler is not null)
+        if (handler is not null)
         {
-            return await _handler(settings, skipValidation, noLogging, cancellationToken).ConfigureAwait(false);
+            return await handler(settings, skipValidation, noLogging, cancellationToken).ConfigureAwait(false);
         }

As per coding guidelines, "Private fields must use camelCase without underscore prefix (e.g., openApiPath not _openApiPath)".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/Refitter.Core/TestGeneratorRunner.cs` at line 9, The private field
`_handler` uses an underscore prefix, which violates the repository's naming
convention for private fields. Rename the field `_handler` to `handler`
(camelCase without underscore prefix) throughout the TestGeneratorRunner class,
including all references to this field such as constructor assignments and any
usages within methods.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/Refitter.Core/CliGeneratorRunner.cs`:
- Around line 30-38: The CLI arguments are being built as a single interpolated
string by concatenating values like refitterDll and settings.OpenApiPath
directly into the args variable, which fails when these paths contain spaces or
quotes since the subprocess cannot parse them correctly. Instead of building
args as a string, construct the arguments as a list or array of tokens
(individual argument strings), then pass that collection to the process
execution method. This ensures proper handling of special characters and spaces
in file paths. Apply this change at the main location where args is initially
set and also at the second location mentioned in the review (lines 45-48) where
additional arguments are conditionally appended.

In `@src/Refitter.Core/CoreGeneratorRunner.cs`:
- Around line 63-66: The GetContractsOutputPath method resolves
ContractsOutputFolder relative to the process working directory instead of
anchoring to the settings file root, causing misplaced file generation. Fix the
GetContractsOutputPath method to resolve relative paths from the directory
containing the settings file, ensuring ContractsOutputFolder is always
interpreted relative to the settings file's location regardless of the current
working directory. Verify this same issue and correction applies at the other
affected location around lines 104-107 where similar path resolution occurs.

In `@src/Refitter.MSBuild/Refitter.MSBuild.csproj`:
- Around line 22-24: The Refitter.MSBuild.csproj project is a production project
that currently lacks warning-as-error enforcement. Add a PropertyGroup element
to the project file that sets TreatWarningsAsErrors to true, ensuring that all
compiler warnings are treated as errors during the build process. This will
prevent silent regressions and maintain code quality standards across the
production codebase.

In `@src/Refitter.MSBuild/RefitterGenerateTask.cs`:
- Around line 95-107: The CreateDefaultRunner() method selects a bundled
refitter DLL without verifying that the host machine has the required runtime
installed, causing failures when the first available binary by TFM order
(net10.0, net9.0, net8.0) is not compatible with the host. Modify the
ResolveRefitterDllForTask method or the logic in CreateDefaultRunner to check
host runtime compatibility before returning a refitter DLL path. Ensure that
only a binary whose target runtime is available on the host is selected, and if
no compatible binary exists, fall back to the CoreGeneratorRunner as a safe
default rather than failing with an unusable CLI binary.

---

Outside diff comments:
In `@src/Refitter.Tests/MSBuild/RefitterGenerateTaskTests.cs`:
- Around line 291-375: The test method
Execute_Should_Use_CoreGeneratorRunner_When_No_Cli_Available() needs to be
refactored to follow project conventions. Replace the hand-written JSON schema
creation with SwaggerFileHelper.CreateSwaggerJsonFile() for consistency. Create
a second test or parameterize the existing test to cover OpenAPI 2.0
specification in addition to OpenAPI 3.0. Add verification that the generated
code compiles by calling BuildHelper.BuildCSharp() after the code generation
with targetFramework parameter supporting "net8.0", "net9.0", and "net10.0".
This ensures the test validates both proper code generation and successful
compilation across multiple target frameworks.

---

Nitpick comments:
In `@src/Refitter.Core/TestGeneratorRunner.cs`:
- Line 9: The private field `_handler` uses an underscore prefix, which violates
the repository's naming convention for private fields. Rename the field
`_handler` to `handler` (camelCase without underscore prefix) throughout the
TestGeneratorRunner class, including all references to this field such as
constructor assignments and any usages within methods.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8ccb288f-cb83-401b-9187-7cbbdcfec7de

📥 Commits

Reviewing files that changed from the base of the PR and between 441a76d and 068555b.

📒 Files selected for processing (8)
  • src/Refitter.Core/CliGeneratorRunner.cs
  • src/Refitter.Core/CoreGeneratorRunner.cs
  • src/Refitter.Core/IGeneratorRunner.cs
  • src/Refitter.Core/OutputPlanner.cs
  • src/Refitter.Core/TestGeneratorRunner.cs
  • src/Refitter.MSBuild/Refitter.MSBuild.csproj
  • src/Refitter.MSBuild/RefitterGenerateTask.cs
  • src/Refitter.Tests/MSBuild/RefitterGenerateTaskTests.cs

Comment on lines +30 to +38
var args = $"{refitterDll} --settings-file \"{settings.OpenApiPath}\" --simple-output";
if (noLogging)
{
args += " --no-logging";
}
if (skipValidation)
{
args += " --skip-validation";
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Build CLI arguments as tokens, not a single interpolated string.

The current argument composition can break when refitterDll or settings paths include spaces/quotes, causing the subprocess to parse arguments incorrectly and fail generation.

🐛 Proposed fix
-        var args = $"{refitterDll} --settings-file \"{settings.OpenApiPath}\" --simple-output";
-        if (noLogging)
-        {
-            args += " --no-logging";
-        }
-        if (skipValidation)
-        {
-            args += " --skip-validation";
-        }
+        ProcessStartInfo startInfo = new()
+        {
+            FileName = "dotnet",
+            WorkingDirectory = processDirectory,
+            RedirectStandardOutput = true,
+            RedirectStandardError = true,
+            RedirectStandardInput = true,
+            UseShellExecute = false,
+            CreateNoWindow = true,
+        };
+        startInfo.ArgumentList.Add(refitterDll);
+        startInfo.ArgumentList.Add("--settings-file");
+        startInfo.ArgumentList.Add(settings.OpenApiPath);
+        startInfo.ArgumentList.Add("--simple-output");
+        if (noLogging) startInfo.ArgumentList.Add("--no-logging");
+        if (skipValidation) startInfo.ArgumentList.Add("--skip-validation");
@@
-            StartInfo = new ProcessStartInfo
-            {
-                FileName = "dotnet",
-                Arguments = args,
-                WorkingDirectory = processDirectory,
-                RedirectStandardOutput = true,
-                RedirectStandardError = true,
-                RedirectStandardInput = true,
-                UseShellExecute = false,
-                CreateNoWindow = true,
-            }
+            StartInfo = startInfo

Also applies to: 45-48

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/Refitter.Core/CliGeneratorRunner.cs` around lines 30 - 38, The CLI
arguments are being built as a single interpolated string by concatenating
values like refitterDll and settings.OpenApiPath directly into the args
variable, which fails when these paths contain spaces or quotes since the
subprocess cannot parse them correctly. Instead of building args as a string,
construct the arguments as a list or array of tokens (individual argument
strings), then pass that collection to the process execution method. This
ensures proper handling of special characters and spaces in file paths. Apply
this change at the main location where args is initially set and also at the
second location mentioned in the review (lines 45-48) where additional arguments
are conditionally appended.

Comment on lines +63 to +66
if (OutputPlanner.ShouldRerouteToContractsFolder(settings, outputFile))
{
outputPath = GetContractsOutputPath(settings, outputFile);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Contracts output path resolution can write files to the wrong directory.

GetContractsOutputPath resolves ContractsOutputFolder without anchoring to the settings file root, so relative contracts folders can be interpreted from the process working directory. This diverges from the existing contracts-path contract and can misplace generated files.

Also applies to: 104-107

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/Refitter.Core/CoreGeneratorRunner.cs` around lines 63 - 66, The
GetContractsOutputPath method resolves ContractsOutputFolder relative to the
process working directory instead of anchoring to the settings file root,
causing misplaced file generation. Fix the GetContractsOutputPath method to
resolve relative paths from the directory containing the settings file, ensuring
ContractsOutputFolder is always interpreted relative to the settings file's
location regardless of the current working directory. Verify this same issue and
correction applies at the other affected location around lines 104-107 where
similar path resolution occurs.

Comment on lines +22 to +24
<ItemGroup>
<ProjectReference Include="..\Refitter.Core\Refitter.Core.csproj" />
</ItemGroup>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Enable warning-as-error enforcement in this production project.

Since this project is production-facing and gained a new dependency edge, warnings should be promoted to errors to prevent silent regressions.

🛡️ Proposed fix
 <PropertyGroup>
     <TargetFramework>netstandard2.0</TargetFramework>
+    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
     <Product>Refitter MSBuild Tasks</Product>

As per coding guidelines, "Enable TreatWarningsAsErrors on production projects in C#".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/Refitter.MSBuild/Refitter.MSBuild.csproj` around lines 22 - 24, The
Refitter.MSBuild.csproj project is a production project that currently lacks
warning-as-error enforcement. Add a PropertyGroup element to the project file
that sets TreatWarningsAsErrors to true, ensuring that all compiler warnings are
treated as errors during the build process. This will prevent silent regressions
and maintain code quality standards across the production codebase.

Source: Coding guidelines

Comment on lines +95 to +107
private IGeneratorRunner CreateDefaultRunner()
{
var packageFolder = GetPackageFolder();
var refitterDll = ResolveRefitterDllForTask(packageFolder);

if (!string.IsNullOrWhiteSpace(refitterDll) && System.IO.File.Exists(refitterDll))
{
TryLogCommandLine($"Using CLI adapter with {refitterDll}");
return new Core.CliGeneratorRunner(refitterDll, ProcessTimeoutMilliseconds);
}

TryLogCommandLine("Using Core generator runner (in-process)");
return new Core.CoreGeneratorRunner();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | 🏗️ Heavy lift

Default runner selection is not runtime-compatible and can pick an unusable CLI binary.

The new resolver picks the first existing bundled binary by TFM order (net10.0, then net9.0, then net8.0) without checking host runtime compatibility. On machines lacking that runtime, generation fails even when another bundled binary would work.

Also applies to: 135-151

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/Refitter.MSBuild/RefitterGenerateTask.cs` around lines 95 - 107, The
CreateDefaultRunner() method selects a bundled refitter DLL without verifying
that the host machine has the required runtime installed, causing failures when
the first available binary by TFM order (net10.0, net9.0, net8.0) is not
compatible with the host. Modify the ResolveRefitterDllForTask method or the
logic in CreateDefaultRunner to check host runtime compatibility before
returning a refitter DLL path. Ensure that only a binary whose target runtime is
available on the host is selected, and if no compatible binary exists, fall back
to the CoreGeneratorRunner as a safe default rather than failing with an
unusable CLI binary.

Copilot AI changed the title Decouple MSBuild task from CLI binary dependency fix: resolve failing "👌 Verify build" CI job by providing Refitter.Core as a local NuGet package Jun 15, 2026
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot

See analysis details on SonarQube Cloud

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
.github/workflows/msbuild.yml (1)

37-38: 💤 Low value

Refitter.Core packaging steps are correctly placed.

The order ensures Refitter.Core is available in the local NuGet source before Refitter.MSBuild package is consumed by the test project (line 41), which is essential since Refitter.MSBuild now depends on Refitter.Core.

For consistency with lines 35-36, consider adding an explicit build step for Refitter.Core before the pack step:

📝 Optional consistency improvement
 dotnet build -c release ../../src/Refitter/Refitter.csproj
 dotnet build -c release ../../src/Refitter.MSBuild/Refitter.MSBuild.csproj
+dotnet build -c release ../../src/Refitter.Core/Refitter.Core.csproj
 dotnet pack -c release ../../src/Refitter.Core/Refitter.Core.csproj -o .

While not strictly necessary (line 36 transitively builds Refitter.Core via ProjectReference, and dotnet pack will build if needed), an explicit build step would make the workflow more uniform and self-documenting.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/msbuild.yml around lines 37 - 38, For consistency with the
explicit build steps at lines 35-36, add an explicit build step for
Refitter.Core before the pack step (line 37). Add a dotnet build command
targeting the Refitter.Core.csproj file with release configuration before the
dotnet pack command. This makes the workflow more uniform and self-documenting,
even though the pack step would transitively build the project if needed.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In @.github/workflows/msbuild.yml:
- Around line 37-38: For consistency with the explicit build steps at lines
35-36, add an explicit build step for Refitter.Core before the pack step (line
37). Add a dotnet build command targeting the Refitter.Core.csproj file with
release configuration before the dotnet pack command. This makes the workflow
more uniform and self-documenting, even though the pack step would transitively
build the project if needed.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 14f98a1c-bc4f-42aa-ab4f-282e2c35002c

📥 Commits

Reviewing files that changed from the base of the PR and between 068555b and fdd28ad.

📒 Files selected for processing (1)
  • .github/workflows/msbuild.yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature, bug fix, or request .NET Pull requests that contain changes to .NET code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants