Skip to content

Frends.odf.write text document#7

Merged
MichalFrends1 merged 7 commits into
mainfrom
Frends.Odf.WriteTextDocument
Jun 15, 2026
Merged

Frends.odf.write text document#7
MichalFrends1 merged 7 commits into
mainfrom
Frends.Odf.WriteTextDocument

Conversation

@MichalFrends1

@MichalFrends1 MichalFrends1 commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Default PR template

Please review my changes :)

Review Checklist

1. Frends Task Project File

  • Path: Frends.*/Frends.*/*.csproj
  • Contains required fields:
    • <TargetFramework>net8.0</TargetFramework>
    • <Version>x.0.0</Version>
    • <Authors>Frends</Authors>
    • <PackageLicenseExpression>MIT</PackageLicenseExpression>
    • <GenerateDocumentationFile>true</GenerateDocumentationFile>
    • <Description>
    • [ ]
      <RepositoryUrl>https://github.com/FrendsPlatform/Frends.SYSTEM/tree/main/Frends.SYSTEM.ACTION</RepositoryUrl>
    • <Nullable>disable</Nullable>
  • Contains required package references:
    • StyleCop.Analyzers v1.2.0-beta.556
    • FrendsTaskAnalyzers v1.*
  • Contains required files:
    • <Content Include="migration.json" PackagePath="/" Pack="true"/>
    • <Content Include="../CHANGELOG.md" PackagePath="/" Pack="true"/>
    • <AdditionalFiles Include="FrendsTaskMetadata.json" PackagePath="/" Pack="true"/>
  • Auto formatting applied

2. Frends Task Test Project File

  • Path: Frends.*/Frends.*.Tests/*.Tests.csproj
  • Contains required fields:
    • <TargetFramework>net8.0</TargetFramework>
    • <IsPackable>false</IsPackable>
    • <Nullable>disable</Nullable>
  • Contains required package references:
    • StyleCop.Analyzers v1.2.0-beta.556
  • Auto formatting applied

3. Additional Files

  • Present only one LICENSE file per repository
    • Should be MIT License unless otherwise specified
  • Present only one .gitignore file per repository
    • Includes .idea/ folders
  • Present: Frends.*/README.md
    • Contains badges (build, license, coverage)
    • Includes developer setup instructions
    • Includes test setup instructions
    • Does not include parameter descriptions
  • Present: Frends.*/CHANGELOG.md
    • Includes all functional changes
    • Indicates breaking changes with upgrade notes
    • Avoids non-functional notes like "refactored xyz"
    • Uses the KeepAChangelog format
  • Present: Frends.*/Frends.*/FrendsTaskMetadata.json
    • Contains task method reference Frends.System.Action.System.Action
  • Present: Frends.*/Frends.*/migration.json
    • Contains breaking change migration information for Frends if breaking changes exist
  • StyleCop.Analyzers suppression files added and setup:
    • Present: Frends.*/Frends.*/GlobalSuppressions.cs
    • Present: Frends.*/Frends.*.Tests/GlobalSuppressions.cs
    • Follows standards from Frends Task Template
  • Auto formatting applied

4. Source Code

  • Solution builds
  • File-scoped namespace applied
  • Usings placed before the namespace
  • Unused code is removed
  • Warnings resolved (if possible)
  • Follows Microsoft C# code conventions
  • Typos and grammar mistakes resolved
  • Auto formatting applied

5. GitHub Actions Workflows

  • Path: .github/workflows/*.yml
  • Task has required workflow files:
    • *_release.yml
      • contains secret feed_api_key: ${{ secrets.TASKS_FEED_API_KEY }}
    • *_test_on_main.yml
      • contains secret badge_service_api_key: ${{ secrets.BADGE_SERVICE_API_KEY }}
    • *_test_on_push.yml
      • contains secret badge_service_api_key: ${{ secrets.BADGE_SERVICE_API_KEY }}
      • contains secret test_feed_api_key: ${{ secrets.TASKS_TEST_FEED_API_KEY }}
  • default permissions set for GITHUB_TOKEN
  • workdir: Frends.SYSTEM.ACTION
  • strict_analyzers: true
  • dotnet_version: 8.0.x
  • Docker setup included if task depends on external system (prebuild_command: docker-compose up -d)

Summary by CodeRabbit

Release Notes

  • New Features

    • Added Frends.Odf.WriteTextDocument task to create OpenDocument Text (.odt) files with JSON-based content injection and configurable file handling
  • Tests

    • Added comprehensive test suite covering error handling, validation, and various input scenarios
  • Chores

    • Configured GitHub Actions for automated testing and package release
    • Added project build configuration and metadata
    • Updated repository documentation

@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@MichalFrends1, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 44 minutes and 25 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b721e1c7-750a-4040-8655-5e40f33987f8

📥 Commits

Reviewing files that changed from the base of the PR and between aa90fdf and fbef274.

📒 Files selected for processing (3)
  • Frends.Odf.WriteTextDocument/Frends.Odf.WriteTextDocument/Frends.Odf.WriteTextDocument.cs
  • Frends.Odf.WriteTextDocument/Frends.Odf.WriteTextDocument/Frends.Odf.WriteTextDocument.csproj
  • Frends.Odf.WriteTextDocument/README.md

Walkthrough

Introduces the complete Frends.Odf.WriteTextDocument Frends task from scratch. The task accepts a JSON array payload and an output file path, loads an embedded ODT template, injects each JSON property as a <text:p> paragraph into content.xml, and writes the resulting .odt file atomically. Includes helper classes, an NUnit test suite, three CI/CD workflows, and packaging metadata.

Changes

Frends.Odf.WriteTextDocument task

Layer / File(s) Summary
Public definitions and project configuration
Frends.Odf.WriteTextDocument/Frends.Odf.WriteTextDocument/Definitions/Enums.cs, Definitions/Error.cs, Definitions/Input.cs, Definitions/Options.cs, Definitions/Result.cs, Frends.Odf.WriteTextDocument.csproj, FrendsTaskMetadata.json, GlobalSuppressions.cs, Frends.Odf.WriteTextDocument.sln
Defines Input, Options, Result, Error, and ActionOnExistingFile public types; configures the SDK-style project with embedded template and NuGet packaging; registers the task method in FrendsTaskMetadata.json.
ValidationHandler and ErrorHandler helpers
Frends.Odf.WriteTextDocument/Helpers/ValidationHandler.cs, Helpers/ErrorHandler.cs
ValidationHandler.Run aggregates DataAnnotation validation errors and throws. ErrorHandler.Handle either rethrows cancellation, wraps and rethrows exceptions based on ThrowErrorOnFailure, or returns a failed Result with the configured error message.
WriteTextDocument ODT generation method
Frends.Odf.WriteTextDocument/Frends.Odf.WriteTextDocument/Frends.Odf.WriteTextDocument.cs
Validates destination path, extension, directory, and JSON payload shape; loads the embedded template.odt; opens it as a ZIP in update mode; reads content.xml with XXE-hardened settings; appends <text:p> elements per JSON property; replaces content.xml; and atomically moves the result to the destination respecting ActionOnExistingFile.
Test infrastructure and NUnit test suites
Frends.Odf.WriteTextDocument.Tests/TestBase.cs, Tests/Helpers/TestHelper.cs, Tests/FunctionalTests.cs, Tests/ErrorHandlerTest.cs, Tests/Frends.Odf.WriteTextDocument.Tests.csproj, Tests/GlobalSuppressions.cs
TestBase provisions and cleans up temp .odt files; TestHelper.ReadOdtContent extracts content.xml from a generated .odt; FunctionalTests covers happy path, collision modes, unicode, null values, and validation rejections; ErrorHandlerTest verifies ThrowErrorOnFailure and custom error message behavior.
CI workflows, metadata, and documentation
.github/workflows/WriteTextDocument_*.yml, Frends.Odf.WriteTextDocument/CHANGELOG.md, Frends.Odf.WriteTextDocument/README.md, Frends.Odf.WriteTextDocument/migration.json, README.md
Adds release, test-on-main, and test-on-push reusable-workflow pipelines; migration.json with v1.0.0 entry; CHANGELOG.md initial entry; task README.md; and a root README.md list entry.

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant Odf
  participant ValidationHandler
  participant EmbeddedTemplate as Assembly Resources
  participant ZipArchive as ODT ZIP
  participant FileSystem

  Caller->>Odf: WriteTextDocument(input, options, ct)
  Odf->>ValidationHandler: Run(input, options)
  Odf->>Odf: validate FilePath (.odt ext, dir exists), payload non-empty, JSON array-of-objects
  Odf->>EmbeddedTemplate: GetManifestResourceStream(template.odt)
  EmbeddedTemplate-->>Odf: MemoryStream
  Odf->>ZipArchive: Open(MemoryStream, Update)
  Odf->>ZipArchive: GetEntry(content.xml)
  ZipArchive-->>Odf: content.xml stream (XXE-hardened XmlReaderSettings)
  Odf->>Odf: inject text:p per JSON property into XDocument
  Odf->>ZipArchive: Delete old content.xml, CreateEntry, write updated XDocument
  Odf->>FileSystem: write MemoryStream to GUID temp file
  Odf->>FileSystem: File.Move(temp → destination, overwrite flag)
  Odf-->>Caller: Result { Success=true, FilePath }
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • FrendsPlatform/Frends.Odf#3: Directly overlaps with this PR's Frends.Odf.WriteTextDocument structure, including the same GitHub Actions workflows, Odf.WriteTextDocument method, helper classes, definitions, and test layout.

Poem

🐇 Hoppity-hop, a new task is born,
From JSON to .odt each morn!
The template loads up with a ZIP-archive flair,
text:p paragraphs fill every line with care.
Tests green, workflows primed, the rabbit cheers loud —
WriteTextDocument ships, wrapped snug in its cloud! ✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 12.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Frends.odf.write text document' is overly vague and does not clearly convey the main change; it reads as a generic namespace/feature name rather than a concise summary of what the PR accomplishes. Revise the title to be more specific and action-oriented, e.g., 'Implement WriteTextDocument task for ODF text generation' or 'Add WriteTextDocument feature to generate ODT files from JSON'.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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 Frends.Odf.WriteTextDocument

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.

@MichalFrends1

Copy link
Copy Markdown
Contributor Author

@coderabbitai please do review

@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown

@MichalFrends1 Sure! I'll review the changes in this PR right away.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai 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.

Actionable comments posted: 5

🤖 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 @.github/workflows/WriteTextDocument_release.yml:
- Line 10: Replace all mutable `@main` workflow references with pinned commit
SHAs to address supply-chain security risks. In
`.github/workflows/WriteTextDocument_release.yml` at line 10, replace the
`@main` reference in the
FrendsPlatform/FrendsTasks/.github/workflows/release.yml uses statement with a
specific commit SHA. In `.github/workflows/WriteTextDocument_test_on_main.yml`
at line 15, replace the `@main` reference in the
FrendsPlatform/FrendsTasks/.github/workflows/linux_build_main.yml uses statement
with a specific commit SHA. In
`.github/workflows/WriteTextDocument_test_on_push.yml` at line 15, replace the
`@main` reference in the
FrendsPlatform/FrendsTasks/.github/workflows/linux_build_test.yml uses statement
with a specific commit SHA. Apply the same pattern consistently across all
similar workflow files in the ReadTextDocument_*.yml and ReadSpreadsheet_*.yml
workflows.

In `@Frends.Odf.WriteTextDocument/CHANGELOG.md`:
- Around line 3-7: Replace the generic "Initial implementation" entry in the
Added section of version 1.0.0 in CHANGELOG.md with concrete functional
descriptions of what the task actually does. Include specific details about the
task's functional capabilities such as: the ability to generate ODT
(OpenDocument Text) documents, what inputs/outputs the task accepts and
produces, file overwrite behavior, and validation or error handling behavior. If
there are any breaking changes in this initial release, add an additional
"Breaking Changes" section with upgrade notes to guide consumers. Ensure the
changelog follows the Keep a Changelog format with clear, consumer-facing
language that helps users understand exactly what functionality is available.

In
`@Frends.Odf.WriteTextDocument/Frends.Odf.WriteTextDocument/Frends.Odf.WriteTextDocument.cs`:
- Around line 186-188: In the catch block, the code passes `options` directly to
`ex.Handle(options)` without checking if it is null. If `options` is null due to
earlier validation failures, this will cause a NullReferenceException when
Handle tries to access options.ThrowErrorOnFailure, masking the original error.
Add a null check for `options` before calling `ex.Handle(options)`. If `options`
is null, either rethrow the original exception or return an appropriate error
result that does not depend on dereferencing the null options parameter.

In
`@Frends.Odf.WriteTextDocument/Frends.Odf.WriteTextDocument/GlobalSuppressions.cs`:
- Around line 3-10: The assembly-level StyleCop suppressions in
GlobalSuppressions.cs are too broad and lack clear documentation, reducing code
quality visibility. Remove or narrow the style/readability rules (SA1101,
SA1200, SA1503) by eliminating them from assembly-level suppression and applying
them only to specific violations where justified. For the documentation rules
(SA1600, SA1623, SA1629, SA1633, SA1649) that remain at the assembly level, add
explicit inline comments explaining the relationship with FrendsTaskAnalyzers
and why assembly-level suppression is necessary. Where possible, convert
assembly-level suppressions to targeted suppressions on specific methods or
classes that actually need them, rather than suppressing across the entire
codebase.

In `@Frends.Odf.WriteTextDocument/README.md`:
- Line 3: The phrase "user inputted JSON" in the task description uses incorrect
grammar and should be replaced with either "user-input JSON" or "user-provided
JSON" to improve clarity and grammatical correctness in the user-facing
documentation. Choose one of these alternatives and update the sentence
accordingly.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 672282cd-7ed5-49af-87ac-6a6752b19d72

📥 Commits

Reviewing files that changed from the base of the PR and between cb01bbe and aa90fdf.

📒 Files selected for processing (26)
  • .github/workflows/WriteTextDocument_release.yml
  • .github/workflows/WriteTextDocument_test_on_main.yml
  • .github/workflows/WriteTextDocument_test_on_push.yml
  • Frends.Odf.WriteTextDocument/CHANGELOG.md
  • Frends.Odf.WriteTextDocument/Frends.Odf.WriteTextDocument.Tests/ErrorHandlerTest.cs
  • Frends.Odf.WriteTextDocument/Frends.Odf.WriteTextDocument.Tests/Frends.Odf.WriteTextDocument.Tests.csproj
  • Frends.Odf.WriteTextDocument/Frends.Odf.WriteTextDocument.Tests/FunctionalTests.cs
  • Frends.Odf.WriteTextDocument/Frends.Odf.WriteTextDocument.Tests/GlobalSuppressions.cs
  • Frends.Odf.WriteTextDocument/Frends.Odf.WriteTextDocument.Tests/Helpers/TestHelper.cs
  • Frends.Odf.WriteTextDocument/Frends.Odf.WriteTextDocument.Tests/TestBase.cs
  • Frends.Odf.WriteTextDocument/Frends.Odf.WriteTextDocument.sln
  • Frends.Odf.WriteTextDocument/Frends.Odf.WriteTextDocument/Definitions/Enums.cs
  • Frends.Odf.WriteTextDocument/Frends.Odf.WriteTextDocument/Definitions/Error.cs
  • Frends.Odf.WriteTextDocument/Frends.Odf.WriteTextDocument/Definitions/Input.cs
  • Frends.Odf.WriteTextDocument/Frends.Odf.WriteTextDocument/Definitions/Options.cs
  • Frends.Odf.WriteTextDocument/Frends.Odf.WriteTextDocument/Definitions/Result.cs
  • Frends.Odf.WriteTextDocument/Frends.Odf.WriteTextDocument/Frends.Odf.WriteTextDocument.cs
  • Frends.Odf.WriteTextDocument/Frends.Odf.WriteTextDocument/Frends.Odf.WriteTextDocument.csproj
  • Frends.Odf.WriteTextDocument/Frends.Odf.WriteTextDocument/FrendsTaskMetadata.json
  • Frends.Odf.WriteTextDocument/Frends.Odf.WriteTextDocument/GlobalSuppressions.cs
  • Frends.Odf.WriteTextDocument/Frends.Odf.WriteTextDocument/Helpers/ErrorHandler.cs
  • Frends.Odf.WriteTextDocument/Frends.Odf.WriteTextDocument/Helpers/ValidationHandler.cs
  • Frends.Odf.WriteTextDocument/Frends.Odf.WriteTextDocument/Resources/template.odt
  • Frends.Odf.WriteTextDocument/Frends.Odf.WriteTextDocument/migration.json
  • Frends.Odf.WriteTextDocument/README.md
  • README.md


jobs:
build:
uses: FrendsPlatform/FrendsTasks/.github/workflows/release.yml@main

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, let's check if these workflow files exist and examine their content
git ls-files '.github/workflows/' | head -20

Repository: FrendsPlatform/Frends.Odf

Length of output: 522


🏁 Script executed:

# Get the specific lines mentioned in the review
echo "=== WriteTextDocument_release.yml (Line 10) ==="
sed -n '8,12p' .github/workflows/WriteTextDocument_release.yml 2>/dev/null || echo "File not found"

echo "=== WriteTextDocument_test_on_main.yml (Line 15) ==="
sed -n '13,17p' .github/workflows/WriteTextDocument_test_on_main.yml 2>/dev/null || echo "File not found"

echo "=== WriteTextDocument_test_on_push.yml (Line 15) ==="
sed -n '13,17p' .github/workflows/WriteTextDocument_test_on_push.yml 2>/dev/null || echo "File not found"

Repository: FrendsPlatform/Frends.Odf

Length of output: 664


🏁 Script executed:

# Search for all 'uses' directives in workflow files to see if there's a pattern
rg 'uses:' .github/workflows/ -A 1 -B 1

Repository: FrendsPlatform/Frends.Odf

Length of output: 2325


Pin reusable workflow references to immutable commit SHAs.
All three workflows call external reusable workflows using mutable @main refs, which is a supply-chain risk and violates the static policy.

  • .github/workflows/WriteTextDocument_release.yml#L10: replace @main with a pinned commit SHA for FrendsPlatform/FrendsTasks/.github/workflows/release.yml.
  • .github/workflows/WriteTextDocument_test_on_main.yml#L15: replace @main with a pinned commit SHA for FrendsPlatform/FrendsTasks/.github/workflows/linux_build_main.yml.
  • .github/workflows/WriteTextDocument_test_on_push.yml#L15: replace @main with a pinned commit SHA for FrendsPlatform/FrendsTasks/.github/workflows/linux_build_test.yml.

Note: The same pattern exists in .github/workflows/ReadTextDocument_*.yml and .github/workflows/ReadSpreadsheet_*.yml workflows and should be addressed systematically across all similar workflow files.

🧰 Tools
🪛 zizmor (1.25.2)

[error] 10-10: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)

📍 Affects 3 files
  • .github/workflows/WriteTextDocument_release.yml#L10-L10 (this comment)
  • .github/workflows/WriteTextDocument_test_on_main.yml#L15-L15
  • .github/workflows/WriteTextDocument_test_on_push.yml#L15-L15
🤖 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/WriteTextDocument_release.yml at line 10, Replace all
mutable `@main` workflow references with pinned commit SHAs to address
supply-chain security risks. In
`.github/workflows/WriteTextDocument_release.yml` at line 10, replace the
`@main` reference in the
FrendsPlatform/FrendsTasks/.github/workflows/release.yml uses statement with a
specific commit SHA. In `.github/workflows/WriteTextDocument_test_on_main.yml`
at line 15, replace the `@main` reference in the
FrendsPlatform/FrendsTasks/.github/workflows/linux_build_main.yml uses statement
with a specific commit SHA. In
`.github/workflows/WriteTextDocument_test_on_push.yml` at line 15, replace the
`@main` reference in the
FrendsPlatform/FrendsTasks/.github/workflows/linux_build_test.yml uses statement
with a specific commit SHA. Apply the same pattern consistently across all
similar workflow files in the ReadTextDocument_*.yml and ReadSpreadsheet_*.yml
workflows.

Source: Linters/SAST tools

Comment on lines +3 to +7
## [1.0.0] - 2026-05-31

### Added

- Initial implementation

Copy link
Copy Markdown

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

Expand release notes with concrete functional changes.

Line 7 is too generic for the stated changelog policy; consumers can’t tell what was added in 1.0.0. List the actual functional capabilities (e.g., task inputs/outputs, ODT generation behavior, overwrite handling, validation/error behavior), and include upgrade notes if any breaking changes exist.

As per coding guidelines, "Frends.*/CHANGELOG.md: Validate format against Keep a Changelog ... Include all functional changes and indicate breaking changes with upgrade notes."

🤖 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 `@Frends.Odf.WriteTextDocument/CHANGELOG.md` around lines 3 - 7, Replace the
generic "Initial implementation" entry in the Added section of version 1.0.0 in
CHANGELOG.md with concrete functional descriptions of what the task actually
does. Include specific details about the task's functional capabilities such as:
the ability to generate ODT (OpenDocument Text) documents, what inputs/outputs
the task accepts and produces, file overwrite behavior, and validation or error
handling behavior. If there are any breaking changes in this initial release,
add an additional "Breaking Changes" section with upgrade notes to guide
consumers. Ensure the changelog follows the Keep a Changelog format with clear,
consumer-facing language that helps users understand exactly what functionality
is available.

Source: Coding guidelines

Comment on lines +186 to +188
catch (Exception ex)
{
return ex.Handle(options);

Copy link
Copy Markdown

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

Prevent null-options failure masking in the catch path.

Line 188 passes options directly into Handle. When options is null (e.g., validation failure before options is usable), this dereferences options.ThrowErrorOnFailure and throws NullReferenceException, hiding the real error.

Suggested fix
         catch (Exception ex)
         {
-            return ex.Handle(options);
+            if (options is null)
+                throw;
+
+            return ex.Handle(options);
         }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
catch (Exception ex)
{
return ex.Handle(options);
catch (Exception ex)
{
if (options is null)
throw;
return ex.Handle(options);
}
🤖 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
`@Frends.Odf.WriteTextDocument/Frends.Odf.WriteTextDocument/Frends.Odf.WriteTextDocument.cs`
around lines 186 - 188, In the catch block, the code passes `options` directly
to `ex.Handle(options)` without checking if it is null. If `options` is null due
to earlier validation failures, this will cause a NullReferenceException when
Handle tries to access options.ThrowErrorOnFailure, masking the original error.
Add a null check for `options` before calling `ex.Handle(options)`. If `options`
is null, either rethrow the original exception or return an appropriate error
result that does not depend on dereferencing the null options parameter.

Comment on lines +3 to +10
[assembly: SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1101:PrefixLocalCallsWithThis", Justification = "Following Frends documentation guidelines")]
[assembly: SuppressMessage("StyleCop.CSharp.OrderingRules", "SA1200:UsingDirectivesMustBePlacedWithinNamespace", Justification = "Following Frends documentation guidelines")]
[assembly: SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:BracesMustNotBeOmitted", Justification = "Following Frends documentation guidelines")]
[assembly: SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1600:ElementsMustBeDocumented", Justification = "Documentation checked by custom analyzers")]
[assembly: SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1623:PropertySummaryDocumentationMustMatchAccessors", Justification = "Following Frends Tasks guidelines")]
[assembly: SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1629:DocumentationTextMustEndWithAPeriod", Justification = "Following Frends Tasks guidelines")]
[assembly: SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1633:FileMustHaveHeader", Justification = "Following Frends documentation guidelines")]
[assembly: SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1649:FileNameMustMatchTypeName", Justification = "Following Frends Tasks guidelines")]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify analyzer strictness configuration and scope of suppressions (read-only).
fd -i 'Directory.Build.props|Directory.Build.targets|.editorconfig|*.csproj|GlobalSuppressions.cs' .
rg -n --iglob '*.csproj' 'StyleCop\.Analyzers|FrendsTaskAnalyzers|TreatWarningsAsErrors|WarningsAsErrors|NoWarn'
rg -n --iglob '.editorconfig' 'dotnet_diagnostic\.SA|severity|stylecop'
rg -n --iglob 'GlobalSuppressions.cs' 'SuppressMessage\('

Repository: FrendsPlatform/Frends.Odf

Length of output: 13194


🏁 Script executed:

# Read the WriteTextDocument csproj to see what's in the NoWarn tags
cat Frends.Odf.WriteTextDocument/Frends.Odf.WriteTextDocument/Frends.Odf.WriteTextDocument.csproj | sed -n '17,19p'

Repository: FrendsPlatform/Frends.Odf

Length of output: 197


🏁 Script executed:

# Check for Directory.Build.props or Directory.Build.targets files
find . -maxdepth 3 -type f \( -name 'Directory.Build.props' -o -name 'Directory.Build.targets' \)

Repository: FrendsPlatform/Frends.Odf

Length of output: 51


🏁 Script executed:

# Check for .editorconfig files
find . -maxdepth 3 -type f -name '.editorconfig'

Repository: FrendsPlatform/Frends.Odf

Length of output: 51


🏁 Script executed:

# Read the full GlobalSuppressions.cs file from WriteTextDocument
cat -n Frends.Odf.WriteTextDocument/Frends.Odf.WriteTextDocument/GlobalSuppressions.cs

Repository: FrendsPlatform/Frends.Odf

Length of output: 1482


🏁 Script executed:

# Search for documentation or guidelines files in the repository
find . -maxdepth 2 -type f \( -name 'README*' -o -name '*GUIDELINES*' -o -name '*STANDARDS*' \) | head -20

Repository: FrendsPlatform/Frends.Odf

Length of output: 201


🏁 Script executed:

# Check if there's any documentation about FrendsTaskAnalyzers or analyzer config
rg -i 'FrendsTaskAnalyzers|analyzer|stylecop|suppress' --glob '*.md' --glob '*.txt' | head -30

Repository: FrendsPlatform/Frends.Odf

Length of output: 888


🏁 Script executed:

# Look at one of the ReadTextDocument GlobalSuppressions.cs to see if pattern is consistent
cat Frends.Odf.ReadTextDocument/Frends.Odf.ReadTextDocument/GlobalSuppressions.cs

Repository: FrendsPlatform/Frends.Odf

Length of output: 1412


Document and narrow these assembly-level StyleCop suppressions.

These eight suppressions disable convention and documentation checks across the entire assembly, which reduces code quality visibility. While the pattern appears consistent across Frends tasks, the justifications referencing "Frends documentation guidelines" lack clarity or documentation.

Consider:

  • Style/readability rules (SA1101, SA1200, SA1503) should rarely require assembly-level suppression—target specific violations instead
  • Documentation rules (SA1600, SA1623, SA1629, SA1633, SA1649) may be justified if FrendsTaskAnalyzers handles these checks differently, but this should be explicitly documented in code or README

As per coding guidelines, code must follow Microsoft C# coding standards and maintain clean structure.

🤖 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
`@Frends.Odf.WriteTextDocument/Frends.Odf.WriteTextDocument/GlobalSuppressions.cs`
around lines 3 - 10, The assembly-level StyleCop suppressions in
GlobalSuppressions.cs are too broad and lack clear documentation, reducing code
quality visibility. Remove or narrow the style/readability rules (SA1101,
SA1200, SA1503) by eliminating them from assembly-level suppression and applying
them only to specific violations where justified. For the documentation rules
(SA1600, SA1623, SA1629, SA1633, SA1649) that remain at the assembly level, add
explicit inline comments explaining the relationship with FrendsTaskAnalyzers
and why assembly-level suppression is necessary. Where possible, convert
assembly-level suppressions to targeted suppressions on specific methods or
classes that actually need them, rather than suppressing across the entire
codebase.

Source: Coding guidelines

Comment thread Frends.Odf.WriteTextDocument/README.md Outdated
@MichalFrends1 MichalFrends1 merged commit 123a6b8 into main Jun 15, 2026
6 checks passed
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.

2 participants