[Add] CSV requirements input and VCD report output via Sep#12
Draft
fabiantax wants to merge 1 commit intoSTARIONGROUP:developmentfrom
Draft
[Add] CSV requirements input and VCD report output via Sep#12fabiantax wants to merge 1 commit intoSTARIONGROUP:developmentfrom
fabiantax wants to merge 1 commit intoSTARIONGROUP:developmentfrom
Conversation
samatstariongroup
requested changes
Apr 24, 2026
| // ------------------------------------------------------------------------------------------------- | ||
| // <copyright file="CsvReportGeneratorTestFixture.cs" company="Starion Group S.A."> | ||
| // | ||
| // Copyright 2022-2024 Starion Group S.A. |
| <PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" /> | ||
| <PackageReference Include="Spectre.Console" Version="0.49.1" /> | ||
| <PackageReference Include="ClosedXML" Version="0.105.0" /> | ||
| <PackageReference Include="Sep" Version="0.12.5" /> |
Member
There was a problem hiding this comment.
we typically use CsvHelper, my preference is there. please change
| /// <summary> | ||
| /// The (injected) <see cref="RequirementsReader"/> used for spreadsheet (xlsx) input | ||
| /// </summary> | ||
| private readonly RequirementsReader xlsxReader; |
Member
There was a problem hiding this comment.
i propose we rename this class to XlsxRequirementsReader
| /// <exception cref="ArgumentNullException"> | ||
| /// Thrown when <paramref name="xlsxReader"/> or <paramref name="csvReader"/> is <c>null</c>. | ||
| /// </exception> | ||
| public RequirementsReaderDispatcher(RequirementsReader xlsxReader, CsvRequirementsReader csvReader, ILoggerFactory loggerFactory = null) |
Member
There was a problem hiding this comment.
inject interfaces perhaps?
| /// The purpose of the <see cref="ReportGenerator"/> is to generate a verification control document | ||
| /// report | ||
| /// </summary> | ||
| public class ReportGenerator : IReportGenerator |
Member
There was a problem hiding this comment.
i think a bigger refactor is required. This report generator is now only realy doing excel report, so, please rename to excel report, introduce a dedicated html report generator and keep the csv report generator.
Then a "master" report generator that dispatches to the specific generator based on the requested report
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Right now the generator only eats
.xlsx. That's fine when your requirements live in a shared drive — but the moment you want to check them into the same repo as your code, xlsx stops being your friend:CSV fixes all three. It's plain text, diffs beautifully, and a requirements edit becomes a proper one-line change in a PR.
So this PR teaches the tool to read and write CSV alongside xlsx. No flags, no flags to remember — it just looks at the file extension:
--requirements-file requirements.csv→ reads CSV--output-report VCD.csv→ writes CSVHow
CsvRequirementsReader+CsvReportGeneratorusing Sep (MIT, AOT-friendly, explicitly targets net10)RequirementsReaderDispatcherpicks the right reader based on the input extensionReportGeneratorgrew aReportKind.Csvbranch that delegates to the CSV writerGenerateCommandderives theReportKindfrom the output extension--requirements-sheet-nameis silently ignored when the input is CSV (sheets don't exist in CSV land)Why Sep and not CsvHelper
CsvHelper is the obvious default — it's the most-starred CSV library in the .NET world. But looking at its current csproj it still targets
net9.0; net8.0; netstandard2.1; netstandard2.0; net48; net47; net462and has nonet10.0target yet. .NET 10 is an LTS release and this project just migrated to it (PR #9) — a library that hasn't updated for the new LTS within this window is a yellow flag for long-term maintenance, especially in security-sensitive contexts where stale dependencies accumulate CVE exposure.Sep, by contrast, explicitly targets
net10.0; net9.0; net8.0today, is AOT/trim-compatible, and its maintainer tracks runtime releases aggressively. Same MIT license, comparable community footprint (1.4k stars, actively pushed). Switching back to CsvHelper later is trivial if that trade-off calculus ever flips.What's in the diff
New files
VCD-Generator/Services/CsvRequirementsReader.csVCD-Generator/Services/CsvReportGenerator.csVCD-Generator/Services/RequirementsReaderDispatcher.csVCD-Generator.Tests/Services/CsvRequirementsReaderTestFixture.cs(8 tests)VCD-Generator.Tests/Services/CsvReportGeneratorTestFixture.cs(3 tests)VCD-Generator.Tests/Services/RequirementsReaderDispatcherTestFixture.cs(3 tests)VCD-Generator.Tests/Data/requirements.csv(covers trim, empty-id skip, and embedded-newline quoting)Touched files
ReportKind.cs— addedCsvenum valueReportGenerator.cs— new ctor dep + Csv case in the switchProgram.cs— DI wiring for the three new servicesGenerateCommand.cs— extension-basedReportKindselectionVCD-Generator.csproj—<PackageReference Include="Sep" Version="0.12.5" />Test plan
dotnet build— clean on net10.0dotnet test— 29/29 passing (14 new, 15 pre-existing).xlsxin →.csvout.csvin →.xlsxout--formatflag — I went with extensions to avoid adding CLI surface, happy to change if you'd rather be explicitOpen questions for reviewers