Skip to content

Conversation

@MichalFrends1
Copy link
Contributor

@MichalFrends1 MichalFrends1 commented Oct 23, 2025

… error handling, include changelog and migration file

[]# Frends Task Pull Request

Summary

Review Checklist

1. Frends Task Project Files

  • Path: Frends.*/Frends.*/*.csproj
  • Targets .NET 8
  • Uses MIT license (<PackageLicenseExpression>MIT</PackageLicenseExpression>)
  • Contains required fields:
    • <Version>
    • <Authors>Frends</Authors>
    • <Description>
    • <RepositoryUrl>
    • <GenerateDocumentationFile>true</GenerateDocumentationFile>

2. File: FrendsTaskMetadata.json

  • Present: Frends.*/Frends.*/FrendsTaskMetadata.json
  • FrendsTaskMetadata.json contains correct task method reference
  • FrendsTaskMetadata.json is included in the project nuget package with path = "/"

3. File: README.md

  • Present: Frends.*/README.md
  • Contains badges (build, license, coverage)
  • Includes developer setup instructions
  • Does not include parameter descriptions

4. File: CHANGELOG.md

  • Present: Frends.*/CHANGELOG.md
  • Includes all functional changes
  • Indicates breaking changes with upgrade notes
  • Avoids non-functional notes like "refactored xyz"
  • CHANGELOG.md is included in the project nuget package with path = "/"

5. File: migration.json

  • Present: Frends.*/Frends.*/migration.json
  • Contains breaking change migration information for Frends, if breaking changes exist
  • migration.json is included in the project nuget package with path = "/"

6. Source Code Documentation

  • Path: Frends.*/Frends.*/*.cs
  • Every public method and class has:
    • <summary> XML comments
    • <example> XML comments
    • Optionally <frendsdocs> XML comments, if needed
  • Follows Microsoft C# code conventions
  • Uses semantic task result documentation (Success, Error, Data)

7. GitHub Actions Workflows

  • Path: .github/workflows/*.yml
  • Task has required workflow files:
    • *_test.yml
    • *_main.yml
    • *_release.yml
  • Correct workdir pointing to task folder
  • Docker setup included if task depends on external system (docker-compose.yml)

8. Task Result Object Structure

  • Path: Frends.*/Frends.*/*.cs
  • Category attribute is present, if applicable
  • All task result classes include:
    • Success (bool)
    • Task-specific return value (e.g., Data, FilePaths), if needed
    • Error object with Message and AdditionalInfo
  • Result structure is flat and simple
  • Does not use 3rd-party types
  • Uses dynamic JToken only when structure is unknown

Additional Notes

Summary by CodeRabbit

Release Notes

  • New Features

    • Streamlined template configuration using unified FullTaskName parameter
    • Added migration support for task versioning
  • Improvements

    • Enhanced error handling with customizable error messages
    • Upgraded target framework to .NET 8
    • Enabled stricter code analysis checks
  • Tests

    • Added comprehensive error handling test suite
  • Chores

    • Updated package version to 1.4.0
    • Improved property initialization patterns

… error handling, include changelog and migration file
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 23, 2025

Walkthrough

The PR refactors the template configuration to use a unified FullTaskName parameter (format: "Frends.ClassName.MethodName") with derived values extracted via regex forms. It introduces centralized error handling via an ErrorHandler utility class, updates the target framework to net8.0, adds FrendsTaskAnalyzers integration, and reorganizes project build configuration to include new package assets.

Changes

Cohort / File(s) Summary
Template Configuration
Frends.Template/.template.config/template.json
Introduced FullTaskName parameter as the primary input; converted className, taskName, and workflows to derived values using new regex-based forms GetClassName and GetMethodName for extraction.
Error Handling Infrastructure
Frends.Template/Frends.Echo.Execute/Helpers/ErrorHandler.cs
New internal static utility class providing centralized error handling logic via Handle() method that manages exception throwing and error result construction based on configuration flags.
Type Definitions
Frends.Template/Frends.Echo.Execute/Definitions/Error.cs, Connection.cs, Options.cs, Result.cs
Updated Error.AdditionalInfo from dynamic to Exception; added inline initializers to Options properties (ThrowErrorOnFailure = true, ErrorMessageOnFailure = string.Empty); replaced DefaultValue attribute with inline initializer for Connection.ConnectionString; updated XML documentation for clarity.
Main Task Implementation
Frends.Template/Frends.Echo.Execute/Frends.Echo.Execute.cs
Added input validation for negative repeat counts; replaced inline error handling with call to ErrorHandler.Handle(); updated XML documentation and using directives.
Build Configuration
FrendsTaskTemplate.csproj, Frends.Template/Frends.Echo.Execute/Frends.Echo.Execute.csproj
Updated template version from 1.3.0 to 1.4.0 and target framework from net6.0 to net8.0; converted FrendsTaskMetadata.json to AdditionalFiles item; added migration.json and CHANGELOG.md to package assets; added FrendsTaskAnalyzers package reference with strict configuration.
Workflow Configuration
Frends.Template/workflows/Execute_build_and_test_on_main.yml, Execute_build_and_test_on_push.yml, Execute_release.yml
Added strict_analyzers: true input parameter to reusable workflow invocations across all three workflow files.
Tests and Suppressions
Frends.Template/Frends.Echo.Execute.Tests/ErrorHandlerTest.cs, GlobalSuppressions.cs, Frends.Template/Frends.Echo.Execute/GlobalSuppressions.cs
Added comprehensive ErrorHandlerTest suite with three test methods; updated StyleCop suppressions to include SA0001::XmlCommentAnalysisDisabled and reorganized documentation rule suppressions.
Documentation & Metadata
README.md, Frends.Template/README.md, Frends.Template/CHANGELOG.md, Frends.Template/migration.json
Updated README with FullTaskName parameter documentation; fixed capitalization and hyphenation in README; reclassified changelog entry to "Added"; introduced initial migration descriptor with no migration steps.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

The PR spans multiple files across configuration, infrastructure, and testing layers, but most changes follow consistent patterns: parameter restructuring through derived values, straightforward utility addition, and property initialization updates. The primary complexity lies in understanding the template configuration refactoring and verifying the regex patterns for GetClassName and GetMethodName extract values correctly across use cases.

Possibly related PRs

Suggested reviewers

  • MatteoDelOmbra
  • jefim

Poem

🐰 A template hops with one new name,
Full and bright—FullTaskName's the game!
Derived values spring from regex forms,
While ErrorHandler standardizes norms,
Framework leaps to net8.0's delight! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 7.14% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "Simplify template parameters to single FullTaskName, add analyzer and…" accurately reflects the primary objectives documented in the PR. The title correctly identifies two major changes: the introduction of a single FullTaskName parameter to replace multiple individual parameters, and the addition of the FrendsTaskAnalyzers package. These changes are clearly present throughout the raw_summary and align with the stated intent. The title is specific and relevant rather than vague or misleading, and a teammate reviewing the commit history would understand the core focus of these changes. While the title ends with an ellipsis suggesting truncation and doesn't comprehensively cover all modifications (such as error handling implementation or framework upgrade), this is acceptable given that titles are not expected to capture every detail of the changeset.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch FSPW-625-additional-configuration

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
Contributor

@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: 3

🧹 Nitpick comments (3)
Frends.Template/Frends.Echo.Execute/migration.json (1)

7-7: Empty Description field in migration metadata.

The Description field is empty for the 1.0.0 migration entry. Consider adding a brief description such as "Initial release" or "Initial implementation" to document the purpose of this migration version.

Apply this diff to add a description:

-        "Description": "",
+        "Description": "Initial release",
Frends.Template/Frends.Echo.Execute/Frends.Echo.Execute.cs (1)

40-41: Consider using ArgumentException for input validation.

While the validation correctly prevents negative repeat counts, using ArgumentException or ArgumentOutOfRangeException would be more semantically appropriate for parameter validation than the generic Exception.

Apply this diff to use a more specific exception type:

-            if (input.Repeat < 0)
-                throw new Exception("Repeat count cannot be negative.");
+            if (input.Repeat < 0)
+                throw new ArgumentOutOfRangeException(nameof(input.Repeat), "Repeat count cannot be negative.");
Frends.Template/Frends.Echo.Execute.Tests/ErrorHandlerTest..cs (1)

8-8: Consider removing or clarifying the TODO comment.

The current test implementation uses Repeat = -1 to trigger validation exceptions, which is a reasonable approach for testing error handling. If this scenario is acceptable, the TODO can be removed; otherwise, clarify what additional scenarios are needed.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b4c5e6d and 6fe4d25.

📒 Files selected for processing (14)
  • Frends.Template/.template.config/template.json (3 hunks)
  • Frends.Template/CHANGELOG.md (1 hunks)
  • Frends.Template/Frends.Echo.Execute.Tests/ErrorHandlerTest..cs (1 hunks)
  • Frends.Template/Frends.Echo.Execute.Tests/GlobalSuppressions.cs (1 hunks)
  • Frends.Template/Frends.Echo.Execute/Definitions/Options.cs (1 hunks)
  • Frends.Template/Frends.Echo.Execute/Frends.Echo.Execute.cs (3 hunks)
  • Frends.Template/Frends.Echo.Execute/Frends.Echo.Execute.csproj (1 hunks)
  • Frends.Template/Frends.Echo.Execute/GlobalSuppressions.cs (1 hunks)
  • Frends.Template/Frends.Echo.Execute/Helpers/ErrorHandler.cs (1 hunks)
  • Frends.Template/Frends.Echo.Execute/migration.json (1 hunks)
  • Frends.Template/workflows/Execute_build_and_test_on_main.yml (1 hunks)
  • Frends.Template/workflows/Execute_build_and_test_on_push.yml (1 hunks)
  • Frends.Template/workflows/Execute_release.yml (1 hunks)
  • README.md (2 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
Frends.*/Frends.*/*.cs

⚙️ CodeRabbit configuration file

Frends.*/Frends.*/*.cs: Ensure every public method and class:

  • Has and XML comments
  • If the documentation is very long then it can also use element
  • Follows Microsoft C# code conventions
  • Uses semantic task result documentation (e.g., Success, Error, Data)

Frends.*/Frends.*/*.cs: Validate all task result classes include:

  • Success (bool)
  • Task-specific return value (e.g. Data, FilePaths)
  • Error object with Message and AdditionalInfo
  • Ensure result structure is flat, simple, and avoids 3rd-party types.
    • Use dynamic or JToken only when the structure is unknown.

Files:

  • Frends.Template/Frends.Echo.Execute/GlobalSuppressions.cs
  • Frends.Template/Frends.Echo.Execute/Frends.Echo.Execute.cs
  • Frends.Template/Frends.Echo.Execute.Tests/GlobalSuppressions.cs
  • Frends.Template/Frends.Echo.Execute.Tests/ErrorHandlerTest..cs
Frends.*/**/*.cs

⚙️ CodeRabbit configuration file

Frends.*/**/*.cs: Code must follow Microsoft C# coding standards, including:

  • PascalCase for public members and task parameters
  • Proper naming for abbreviations (Csv, Url, Api)
  • Use of var only when type is obvious
  • Clean structure and no unused code

Files:

  • Frends.Template/Frends.Echo.Execute/GlobalSuppressions.cs
  • Frends.Template/Frends.Echo.Execute/Helpers/ErrorHandler.cs
  • Frends.Template/Frends.Echo.Execute/Frends.Echo.Execute.cs
  • Frends.Template/Frends.Echo.Execute/Definitions/Options.cs
  • Frends.Template/Frends.Echo.Execute.Tests/GlobalSuppressions.cs
  • Frends.Template/Frends.Echo.Execute.Tests/ErrorHandlerTest..cs
Frends.*/CHANGELOG.md

⚙️ CodeRabbit configuration file

Frends.*/CHANGELOG.md: Validate format against Keep a Changelog (https://keepachangelog.com/en/1.0.0/)
Include all functional changes and indicate breaking changes with upgrade notes.
Avoid notes like "refactored xyz" unless it affects functionality.

Files:

  • Frends.Template/CHANGELOG.md
Frends.*/Frends.*/*.csproj

⚙️ CodeRabbit configuration file

Frends.*/Frends.*/*.csproj: Ensure the .csproj targets .NET 6 or 8, uses the MIT license, and includes the following fields:

= Frends


= true
= MIT
Follow Microsoft C# project file conventions.

Files:

  • Frends.Template/Frends.Echo.Execute/Frends.Echo.Execute.csproj
Frends.*/Frends.*.Tests/*

⚙️ CodeRabbit configuration file

Frends.*/Frends.*.Tests/*: Confirm unit tests exist and provide at least 80% coverage.
Tests should:

  • Load secrets via dotenv
  • Use mocking where real systems can't be simulated
  • Follow Microsoft unit testing naming and structuring conventions

Files:

  • Frends.Template/Frends.Echo.Execute.Tests/GlobalSuppressions.cs
  • Frends.Template/Frends.Echo.Execute.Tests/ErrorHandlerTest..cs
🧬 Code graph analysis (3)
Frends.Template/Frends.Echo.Execute/Helpers/ErrorHandler.cs (4)
Frends.Template/Frends.Echo.Execute/Frends.Echo.Execute.cs (2)
  • Echo (13-57)
  • Result (25-56)
Frends.Template/Frends.Echo.Execute.Tests/ErrorHandlerTest..cs (1)
  • Options (49-53)
Frends.Template/Frends.Echo.Execute/Definitions/Options.cs (1)
  • Options (9-33)
Frends.Template/Frends.Echo.Execute/Definitions/Error.cs (1)
  • Error (6-20)
Frends.Template/Frends.Echo.Execute/Frends.Echo.Execute.cs (1)
Frends.Template/Frends.Echo.Execute/Helpers/ErrorHandler.cs (1)
  • ErrorHandler (9-41)
Frends.Template/Frends.Echo.Execute.Tests/ErrorHandlerTest..cs (2)
Frends.Template/Frends.Echo.Execute/Frends.Echo.Execute.cs (1)
  • Echo (13-57)
Frends.Template/Frends.Echo.Execute/Definitions/Options.cs (1)
  • Options (9-33)
🔇 Additional comments (24)
Frends.Template/Frends.Echo.Execute/GlobalSuppressions.cs (1)

9-9: LGTM: Documentation suppression aligns with custom analyzer approach.

The suppression of SA1600 is appropriate since FrendsTaskAnalyzers (added to the .csproj) will handle documentation validation.

Frends.Template/CHANGELOG.md (1)

5-7: LGTM: Correct changelog category.

Using "Added" for initial implementation follows the Keep a Changelog format correctly.

README.md (2)

37-37: LGTM: Simplified template command.

The updated command using a single --FullTaskName parameter simplifies the template usage and aligns with the template.json changes.


66-68: LGTM: Clear template option documentation.

The template options section accurately documents the new FullTaskName parameter with its format and default value.

Frends.Template/Frends.Echo.Execute/Frends.Echo.Execute.csproj (2)

34-36: LGTM: Correct use of AdditionalFiles for metadata.

Changing FrendsTaskMetadata.json to AdditionalFiles enables the FrendsTaskAnalyzers to access and validate the metadata during build.


40-41: LGTM: Proper packaging of migration and changelog files.

The migration.json and CHANGELOG.md files are correctly configured to be included in the NuGet package root, as required by the coding guidelines.

Frends.Template/Frends.Echo.Execute.Tests/GlobalSuppressions.cs (2)

3-3: LGTM: Standard test project suppressions.

The SA0001 suppression is appropriate for test projects and follows Frends documentation guidelines.


11-11: LGTM: File header suppression for tests.

The SA1633 suppression for file headers is standard for test projects and aligns with Frends documentation guidelines.

Frends.Template/.template.config/template.json (2)

17-23: LGTM: Simplified template parameter.

The new FullTaskName parameter consolidates the previous separate parameters into a single, more intuitive input. The format "Frends.ClassName.MethodName" is clear and follows Frends naming conventions.


24-35: LGTM: Derived symbols reduce user input.

Converting className and taskName to derived symbols eliminates redundant user input and ensures consistency between the FullTaskName and its components.

Frends.Template/workflows/Execute_build_and_test_on_main.yml (1)

17-17: LGTM: Enabling strict analyzers improves code quality.

Adding strict_analyzers: true enables stricter analyzer checks in the CI/CD pipeline, which aligns with the addition of FrendsTaskAnalyzers and helps catch issues earlier.

Frends.Template/workflows/Execute_release.yml (1)

12-12: LGTM! Enabling strict analyzers in release workflow.

This change aligns with the PR's goal of introducing stricter analyzer checks across all workflows.

Frends.Template/Frends.Echo.Execute/Frends.Echo.Execute.cs (2)

6-6: LGTM! Helper namespace imported for centralized error handling.

The using directive correctly references the new ErrorHandler helper class.


52-54: LGTM! Error handling properly delegated to centralized handler.

The error handling is correctly delegated to ErrorHandler.Handle, which provides consistent error processing based on the Options configuration.

Frends.Template/workflows/Execute_build_and_test_on_push.yml (1)

17-17: LGTM! Enabling strict analyzers in build/test workflow.

This change aligns with the PR's goal of introducing stricter analyzer checks across all workflows.

Frends.Template/Frends.Echo.Execute/Definitions/Options.cs (2)

24-24: LGTM! Property initializer ensures runtime default.

The initializer guarantees the property defaults to true at runtime, complementing the [DefaultValue] attribute which serves the design-time/UI layer.


32-32: LGTM! Property initializer ensures runtime default.

The initializer guarantees the property defaults to an empty string at runtime, complementing the [DefaultValue] attribute which serves the design-time/UI layer.

Frends.Template/Frends.Echo.Execute/Helpers/ErrorHandler.cs (3)

6-16: LGTM! Complete XML documentation provided.

The class and method have proper <summary>, <param>, and <returns> XML documentation as required by the coding guidelines.


29-39: LGTM! Error result construction follows task result requirements.

The error result properly includes:

  • Success = false
  • Error object with Message and AdditionalInfo
  • Flat structure as required by coding guidelines

17-27: Critical: throw ex; loses stack trace information.

Line 26 uses throw ex; which resets the stack trace. Use throw; to preserve the original exception's stack trace for better debugging.

Apply this diff to preserve stack trace:

             if (!string.IsNullOrEmpty(options.ErrorMessageOnFailure))
             {
                 throw new Exception(options.ErrorMessageOnFailure, ex);
             }

-            throw ex;
+            throw;

Likely an incorrect or invalid review comment.

Frends.Template/Frends.Echo.Execute.Tests/ErrorHandlerTest..cs (4)

14-20: LGTM! Test correctly validates exception throwing behavior.

The test properly verifies that an exception is thrown when ThrowErrorOnFailure is true.


22-29: LGTM! Test correctly validates failure result behavior.

The test properly verifies that a failed Result is returned when ThrowErrorOnFailure is false.


31-40: LGTM! Test correctly validates custom error message.

The test properly verifies that the custom error message is included in the thrown exception.


42-53: LGTM! Helper methods provide clear test data.

The helper methods properly construct test inputs with documented invalid values to trigger error scenarios.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@MatteoDelOmbra
Copy link
Contributor

  • Update framework for FrendsTaskTempate.csproj to 8.0
  • Update version of template to 1.4.0
  • Fix Connection.cs to
    public string ConnectionString { get; set; } = string.Empty
  • Fix Error.cs to
    /// object { Exception AdditionalInfo }
    public Exception AdditionalInfo { get; set; }
  • Fix Result.cs to
    /// object { string Message, Exception AdditionalInfo }
  • Fix ErrorHandlerTest.cs file name (double dot)
  • Remove ending newline in GlobalSupression.cs (task proj)
  • Fix comment in execute.cs to
    /// object { bool Success, string Output, object Error { string Message, Exception AdditionalInfo } }

@MatteoDelOmbra
Copy link
Contributor

Fix README to
You can install the Task via Frends UI Task View.
(capital Frends letter)

@MatteoDelOmbra
Copy link
Contributor

Fix README to

Third-party licenses

(hyphenate)

@MatteoDelOmbra
Copy link
Contributor

Fix Execute.cs to
Task Class for Echo operations.

@MatteoDelOmbra
Copy link
Contributor

Make errorhandler internal and remove all xml comments from this file (we dont need that)

Copy link
Contributor

@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

🧹 Nitpick comments (4)
Frends.Template/Frends.Echo.Execute/Definitions/Connection.cs (1)

18-19: Remove redundant DefaultValue attribute.

The [DefaultValue("")] attribute is now redundant with the inline initializer = string.Empty;. Modern C# best practice is to use inline initialization for default values.

Apply this diff to remove the redundant attribute:

     [DisplayFormat(DataFormatString = "Text")]
-    [DefaultValue("")]
     public string ConnectionString { get; set; } = string.Empty;
Frends.Template/Frends.Echo.Execute/Definitions/Error.cs (1)

1-1: Good refactor to strong typing, but consider serialization implications.

The change from dynamic to Exception provides better type safety and aligns with the TODO comment recommending strong typing. The Exception type is a .NET built-in (not third-party), so it complies with the coding guidelines.

Note that Exception objects may not serialize cleanly in all scenarios (e.g., JSON over HTTP). Consider documenting this limitation or providing guidance in the template TODO comment if Error objects will cross serialization boundaries.

Also applies to: 19-21

Frends.Template/Frends.Echo.Execute.Tests/ErrorHandlerTest.cs (2)

8-20: TODO comment may be outdated.

The test uses Repeat = -1 which IS a real invalid input scenario (triggers the validation at line 40 in Execute.cs). The TODO comment suggests adjusting to use "real invalid Input scenario," but this is already valid.

Consider updating or removing the TODO comment.


14-40: Good test coverage of error-handling paths.

The three test methods cover the main error-handling scenarios: throwing on failure, returning failed result, and custom error messages. The test design is clean and follows NUnit conventions.

Consider adding assertions to verify:

  • Error.AdditionalInfo is populated in the failed result test (line 27)
  • Error.Message content in the failed result test

Example:

 var result = Echo.Execute(DefaultInput(), DefaultConnection(), options, CancellationToken.None);
 Assert.That(result.Success, Is.False);
+Assert.That(result.Error, Is.Not.Null);
+Assert.That(result.Error.AdditionalInfo, Is.Not.Null);
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1bd3e47 and 7f050a7.

📒 Files selected for processing (9)
  • Frends.Template/Frends.Echo.Execute.Tests/ErrorHandlerTest.cs (1 hunks)
  • Frends.Template/Frends.Echo.Execute/Definitions/Connection.cs (1 hunks)
  • Frends.Template/Frends.Echo.Execute/Definitions/Error.cs (2 hunks)
  • Frends.Template/Frends.Echo.Execute/Definitions/Result.cs (1 hunks)
  • Frends.Template/Frends.Echo.Execute/Frends.Echo.Execute.cs (4 hunks)
  • Frends.Template/Frends.Echo.Execute/GlobalSuppressions.cs (1 hunks)
  • Frends.Template/Frends.Echo.Execute/Helpers/ErrorHandler.cs (1 hunks)
  • Frends.Template/README.md (2 hunks)
  • FrendsTaskTemplate.csproj (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • Frends.Template/README.md
🧰 Additional context used
📓 Path-based instructions (3)
Frends.*/**/*.cs

⚙️ CodeRabbit configuration file

Frends.*/**/*.cs: Code must follow Microsoft C# coding standards, including:

  • PascalCase for public members and task parameters
  • Proper naming for abbreviations (Csv, Url, Api)
  • Use of var only when type is obvious
  • Clean structure and no unused code

Files:

  • Frends.Template/Frends.Echo.Execute/Definitions/Error.cs
  • Frends.Template/Frends.Echo.Execute/Definitions/Connection.cs
  • Frends.Template/Frends.Echo.Execute/GlobalSuppressions.cs
  • Frends.Template/Frends.Echo.Execute/Definitions/Result.cs
  • Frends.Template/Frends.Echo.Execute.Tests/ErrorHandlerTest.cs
  • Frends.Template/Frends.Echo.Execute/Helpers/ErrorHandler.cs
  • Frends.Template/Frends.Echo.Execute/Frends.Echo.Execute.cs
Frends.*/Frends.*/*.cs

⚙️ CodeRabbit configuration file

Frends.*/Frends.*/*.cs: Ensure every public method and class:

  • Has and XML comments
  • If the documentation is very long then it can also use element
  • Follows Microsoft C# code conventions
  • Uses semantic task result documentation (e.g., Success, Error, Data)

Frends.*/Frends.*/*.cs: Validate all task result classes include:

  • Success (bool)
  • Task-specific return value (e.g. Data, FilePaths)
  • Error object with Message and AdditionalInfo
  • Ensure result structure is flat, simple, and avoids 3rd-party types.
    • Use dynamic or JToken only when the structure is unknown.

Files:

  • Frends.Template/Frends.Echo.Execute/GlobalSuppressions.cs
  • Frends.Template/Frends.Echo.Execute.Tests/ErrorHandlerTest.cs
  • Frends.Template/Frends.Echo.Execute/Frends.Echo.Execute.cs
Frends.*/Frends.*.Tests/*

⚙️ CodeRabbit configuration file

Frends.*/Frends.*.Tests/*: Confirm unit tests exist and provide at least 80% coverage.
Tests should:

  • Load secrets via dotenv
  • Use mocking where real systems can't be simulated
  • Follow Microsoft unit testing naming and structuring conventions

Files:

  • Frends.Template/Frends.Echo.Execute.Tests/ErrorHandlerTest.cs
🧬 Code graph analysis (4)
Frends.Template/Frends.Echo.Execute/Definitions/Result.cs (1)
Frends.Template/Frends.Echo.Execute/Definitions/Error.cs (1)
  • Error (8-22)
Frends.Template/Frends.Echo.Execute.Tests/ErrorHandlerTest.cs (2)
Frends.Template/Frends.Echo.Execute/Frends.Echo.Execute.cs (1)
  • Echo (13-57)
Frends.Template/Frends.Echo.Execute/Definitions/Connection.cs (1)
  • Connection (11-20)
Frends.Template/Frends.Echo.Execute/Helpers/ErrorHandler.cs (3)
Frends.Template/Frends.Echo.Execute/Frends.Echo.Execute.cs (2)
  • Echo (13-57)
  • Result (25-56)
Frends.Template/Frends.Echo.Execute/Definitions/Result.cs (1)
  • Result (6-25)
Frends.Template/Frends.Echo.Execute/Definitions/Error.cs (1)
  • Error (8-22)
Frends.Template/Frends.Echo.Execute/Frends.Echo.Execute.cs (1)
Frends.Template/Frends.Echo.Execute/Helpers/ErrorHandler.cs (1)
  • ErrorHandler (6-32)
🔇 Additional comments (10)
Frends.Template/Frends.Echo.Execute/GlobalSuppressions.cs (2)

9-9: LGTM! Appropriate suppression for custom analyzer integration.

The SA1600 suppression is correctly configured to delegate documentation enforcement to the custom FrendsTaskAnalyzers, which aligns with the PR's goal of integrating analyzer-based checks. This allows internal/private members to remain undocumented while custom analyzers enforce documentation on public APIs as required by the coding guidelines.


12-12: LGTM! Standard file header suppression.

The SA1633 suppression is appropriate for the template project structure and follows the established Frends documentation guidelines.

FrendsTaskTemplate.csproj (1)

5-5: LGTM! Version and framework updates are appropriate.

The PackageVersion bump to 1.4.0 and TargetFramework update to net8.0 align with the PR objectives and template modernization.

Also applies to: 12-12

Frends.Template/Frends.Echo.Execute/Definitions/Result.cs (1)

23-23: LGTM! Documentation updated to match Error structure.

The XML example now correctly reflects the updated Error.AdditionalInfo type and aligns with the changes in Error.cs.

Frends.Template/Frends.Echo.Execute/Frends.Echo.Execute.cs (4)

6-6: LGTM! Necessary import for centralized error handling.


11-11: LGTM! Documentation updates match PR requirements.

The class summary and return documentation have been updated correctly as requested in PR comments.

Also applies to: 23-23


40-41: Good defensive validation.

The negative repeat count validation prevents invalid input and provides clear error messaging.


52-54: Excellent refactor to centralize error handling.

Delegating to ErrorHandler.Handle provides consistent error behavior across the task and simplifies maintenance.

Frends.Template/Frends.Echo.Execute.Tests/ErrorHandlerTest.cs (1)

42-53: LGTM! Helper methods improve test readability.

Frends.Template/Frends.Echo.Execute/Helpers/ErrorHandler.cs (1)

6-31: LGTM! Clean centralized error-handling implementation.

The ErrorHandler class provides consistent error-handling behavior:

  • Correctly throws exceptions when throwOnFailure is true (with optional custom message wrapper)
  • Builds failed Result objects with proper Error structure when not throwing
  • Error message composition handles both empty and non-empty errorMessageOnFailure values

The internal visibility and absence of XML comments align with PR comment requirements.

@MatteoDelOmbra MatteoDelOmbra merged commit 1fe2277 into main Oct 24, 2025
4 checks passed
@MatteoDelOmbra MatteoDelOmbra deleted the FSPW-625-additional-configuration branch October 24, 2025 09:21
@coderabbitai coderabbitai bot mentioned this pull request Dec 10, 2025
43 tasks
@coderabbitai coderabbitai bot mentioned this pull request Dec 19, 2025
43 tasks
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