Skip to content

Conversation

@MatteoDelOmbra
Copy link
Contributor

@MatteoDelOmbra MatteoDelOmbra commented Jan 22, 2026

Review Checklist

  • Task version updated (x.x.0)
  • CHANGELOG.md updated
  • Solution builds
  • Warnings resolved (if possible)
  • Typos resolved
  • Tests cover new code
  • Description how to run tests locally added to README.md (if needed)
  • All tests pass locally

Summary by CodeRabbit

  • Chores

    • Version bumps across Microsoft SQL packages (BatchOperation 2.2.0, BulkInsert 3.1.0, ExecuteProcedure 2.3.0, ExecuteQuery 2.3.0, ExecuteQueryToFile 2.2.0).
  • Refactor

    • Standardized await usage to improve execution of asynchronous methods across all packages.
  • Documentation

    • Updated changelogs with new release entries reflecting the changes.
  • Style

    • Minor formatting and documentation cleanup for consistency.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 22, 2026

Walkthrough

Standardized async awaits to use ConfigureAwait(false) across multiple Frends.MicrosoftSQL packages, bumped package versions and consolidated csproj TargetFrameworks to a single net6.0 TargetFramework; changelogs and minor formatting/doc edits included. No public API signature changes.

Changes

Cohort / File(s) Summary
CHANGELOG updates
Frends.MicrosoftSQL.BatchOperation/CHANGELOG.md, Frends.MicrosoftSQL.BulkInsert/CHANGELOG.md, Frends.MicrosoftSQL.ExecuteProcedure/CHANGELOG.md, Frends.MicrosoftSQL.ExecuteQuery/CHANGELOG.md, Frends.MicrosoftSQL.ExecuteQueryToFile/CHANGELOG.md
Added new version entries (2.2.0/2.3.0/3.1.0) with "Improve execution of async methods" notes and minor reformatting.
ConfigureAwait(false) async updates
Frends.MicrosoftSQL.BatchOperation/Frends.MicrosoftSQL.BatchOperation/BatchOperation.cs, Frends.MicrosoftSQL.BulkInsert/Frends.MicrosoftSQL.BulkInsert/BulkInsert.cs, Frends.MicrosoftSQL.ExecuteProcedure/Frends.MicrosoftSQL.ExecuteProcedure/ExecuteProcedure.cs, Frends.MicrosoftSQL.ExecuteQuery/Frends.MicrosoftSQL.ExecuteQuery/ExecuteQuery.cs, Frends.MicrosoftSQL.ExecuteQueryToFile/.../Definitions/CsvFileWriter.cs
Replaced awaited async calls (OpenAsync, ExecuteHandler, ReadAsync/ReadAsync loops, ExecuteReaderAsync, CommitAsync, RollbackAsync, CloseAsync, etc.) with ConfigureAwait(false); control flow and APIs unchanged.
Project file / version updates
Frends.MicrosoftSQL.BatchOperation/.../Frends.MicrosoftSQL.BatchOperation.csproj, Frends.MicrosoftSQL.BulkInsert/.../Frends.MicrosoftSQL.BulkInsert.csproj, Frends.MicrosoftSQL.ExecuteProcedure/.../Frends.MicrosoftSQL.ExecuteProcedure.csproj, Frends.MicrosoftSQL.ExecuteQuery/.../Frends.MicrosoftSQL.ExecuteQuery.csproj, Frends.MicrosoftSQL.ExecuteQueryToFile/.../Frends.MicrosoftSQL.ExecuteQueryToFile.csproj
Switched from multi-targeting (TargetFrameworks) to single TargetFramework (net6.0) and bumped package versions; whitespace/formatting normalization.
Minor formatting / enums/doc edits
Frends.MicrosoftSQL.ExecuteQueryToFile/.../Enums/FileEncoding.cs, Frends.MicrosoftSQL.ExecuteQueryToFile/.../Enums/ReturnFormat.cs
Removed XML doc for FileEncoding, trimmed blank lines and adjusted formatting; no API changes.

Sequence Diagram(s)

(omitted — changes standardize await usage and do not introduce new multi-component control flows)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • ttossavainen
  • jefim

Poem

🐰
I hop through awaits with a nimble cheer,
ConfigureAwait clears the context near.
Packages updated, csprojs aligned,
Async steps steadier, no threads entwined.
A rabbit applauds the tidy design.

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Title check ⚠️ Warning The title 'Fspes 53' is a vague issue reference that does not clearly convey the main technical change of the pull request. Use a descriptive title like 'Add ConfigureAwait(false) to async methods across MicrosoftSQL packages' to clearly communicate the primary change.
Docstring Coverage ⚠️ Warning Docstring coverage is 28.57% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing touches
  • 📝 Generate docstrings

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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

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

⚠️ Outside diff range comments (8)
Frends.MicrosoftSQL.BatchOperation/Frends.MicrosoftSQL.BatchOperation/BatchOperation.cs (2)

21-21: Make the task class static.

The class MicrosoftSQL contains only static members (static constructor, static methods) and should be declared as public static class to comply with Microsoft C# coding standards and the FT0004 rule for Frends task classes.


40-40: Add Error object to Result class with Message and AdditionalInfo properties.

The Result class is missing the Error object structure required by coding guidelines. Currently it only has an ErrorMessage string property, but task result classes must include an Error object with Message and AdditionalInfo properties. This is causing the FT0011 pipeline failure.

Frends.MicrosoftSQL.BulkInsert/Frends.MicrosoftSQL.BulkInsert/BulkInsert.cs (3)

17-17: Pipeline failure: Task class must be static.

The pipeline error FT0004: Task class 'MicrosoftSQL' should be static indicates this class needs the static modifier.

Proposed fix
-public class MicrosoftSQL
+public static class MicrosoftSQL

26-27: Pipeline failure: Result class needs structured Error property.

The pipeline error FT0011: Class should include a 'Error' property indicates the Result class in Definitions/Result.cs needs modification. Per coding guidelines, task result classes should include an "Error object with Message and AdditionalInfo" rather than a simple ErrorMessage string.

The Result class currently has string ErrorMessage but should have an Error object:

public class Error
{
    public string Message { get; private set; }
    public string AdditionalInfo { get; private set; }
    
    internal Error(string message, string additionalInfo)
    {
        Message = message;
        AdditionalInfo = additionalInfo;
    }
}

Then update Result to use Error Error instead of string ErrorMessage.


3-3: Remove unused import.

Microsoft.IdentityModel.Abstractions is not used anywhere in this file and should be removed to comply with C# code cleanliness standards.

Frends.MicrosoftSQL.ExecuteQuery/Frends.MicrosoftSQL.ExecuteQuery/ExecuteQuery.cs (1)

17-17: Make the task class static to satisfy FT0004.

Line 17 defines a non-static task class, which fails the build rule. Please mark it static.

✅ Proposed fix
-public class MicrosoftSQL
+public static class MicrosoftSQL
Frends.MicrosoftSQL.ExecuteProcedure/Frends.MicrosoftSQL.ExecuteProcedure/ExecuteProcedure.cs (2)

18-18: Make the task class static to satisfy FT0004.

Line 18 defines a non-static task class, which fails the build rule. Please mark it static.

✅ Proposed fix
-public class MicrosoftSQL
+public static class MicrosoftSQL

93-95: Update Result to include an Error object (Message + AdditionalInfo).

Lines 93–95 and 103–109 construct Result, but the build rule FT0011 (and coding guidelines) require a dedicated Error object with Message and AdditionalInfo instead of ErrorMessage string. Please update Definitions/Result.cs accordingly and adjust these constructions.
As per coding guidelines, Result types must include a flat Error object with Message and AdditionalInfo.

Also applies to: 103-109

🤖 Fix all issues with AI agents
In
`@Frends.MicrosoftSQL.ExecuteQuery/Frends.MicrosoftSQL.ExecuteQuery/ExecuteQuery.cs`:
- Around line 105-107: The Result constructor calls must be changed to use the
new flat Error object (with Message and AdditionalInfo) instead of the old
ErrorMessage string: update Definitions/Result.cs to add/require an Error
property/class (e.g., Error { string Message; string AdditionalInfo; }) and then
replace the two places that construct Result (the occurrences around result =
new Result(true, dataReader.RecordsAffected, null, await LoadData(...)) and the
other construction near the later branch) to pass an Error instance (null for no
error) or new Error { Message = "...", AdditionalInfo = "..." } where
appropriate; ensure the Result constructor signature and all call sites
(including any code that used ErrorMessage) are updated to match the new Error
type and populate AdditionalInfo with contextual details.

In
`@Frends.MicrosoftSQL.ExecuteQueryToFile/Frends.MicrosoftSQL.ExecuteQueryToFile/Definitions/CsvFileWriter.cs`:
- Line 164: Remove the stray space before the member-access operator on the
CsvFileWriter usage: locate the call to csvWriter .WriteField(formattedValue,
false) (in CsvFileWriter.cs) and change it to use
csvWriter.WriteField(formattedValue, false) so the dot directly follows the
variable name and the StyleCop SA1019 warning is resolved.
🧹 Nitpick comments (1)
Frends.MicrosoftSQL.ExecuteProcedure/CHANGELOG.md (1)

9-13: Pre-existing format issue: missing section header in 2.2.0 entry.

The 2.2.0 entry is missing the ### Changed (or ### Added/### Fixed) header before the list items. Per Keep a Changelog format, each version should have categorized sections. Consider fixing this while you're updating the file.

Suggested fix
 ## [2.2.0] - 2024-12-16

+### Changed
+
 - Added method to form JToken from the SqlDataReader so that SqlGeography and SqlGeometry typed objects can be handled.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

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

⚠️ Outside diff range comments (2)
Frends.MicrosoftSQL.ExecuteQueryToFile/Frends.MicrosoftSQL.ExecuteQueryToFile/Definitions/CsvFileWriter.cs (2)

33-50: Add missing XML documentation to fix pipeline failure.

The pipeline is failing with error FT0014 because the public method SaveQueryToCSV is missing required XML documentation.

Proposed fix
+    /// <summary>
+    /// Executes the SQL query and saves the results to a CSV file.
+    /// </summary>
+    /// <param name="cancellationToken">Token to monitor for cancellation requests.</param>
+    /// <returns>A Result containing the row count and output file information.</returns>
     public async Task<Result> SaveQueryToCSV(CancellationToken cancellationToken)

The addition of ConfigureAwait(false) on line 43 is a good improvement for library code to avoid capturing the synchronization context.


84-97: Remove dead code: unused method call.

Line 87 calls options.GetFieldDelimiterAsString() but discards the result. This appears to be dead code that should be removed.

Proposed fix
         if (dotnetType == typeof(string))
         {
             var str = (string)value;
-            options.GetFieldDelimiterAsString();
             str = str.Replace("\"", "\\\"");
             str = str.Replace("\r\n", " ");
             str = str.Replace("\r", " ");
             str = str.Replace("\n", " ");

@MichalFrends1 MichalFrends1 merged commit 49898ae into main Jan 22, 2026
5 checks passed
@MichalFrends1 MichalFrends1 deleted the fspes-53 branch January 22, 2026 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants