feat: Update folder structure and namespaces to match design documentation#12
Conversation
- Move source files into Cli/, Configuration/, Modeling/, Utilities/, SelfTest/ subsystems
- Update namespaces to match folder hierarchy (DemaConsulting.FileAssert.{Subsystem})
- Mirror test structure in test project with matching namespaces
- Add using directives for cross-namespace references
- Add system.md, subsystem and unit design docs (cli, configuration, modeling, utilities, selftest, program, context, file-assert-data, path-helpers, validation)
- Update docs/design/definition.yaml to include all new docs
- Add subsystem requirements YAML files (cli, configuration, modeling, utilities, selftest)
- Update requirements.yaml to include subsystem requirements
- Add subsystem integration test classes for each subsystem
- Add selftest to cspell dictionary
Agent-Logs-Url: https://github.com/demaconsulting/FileAssert/sessions/fa91af23-9344-4182-aa65-6d8b99d0db2e
Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
|
@copilot This is looking good, with a few caveats:
|
- Add docs/reqstream/fileassert-system.yaml with system-level requirements - Add two new integration tests for end-to-end config execution (pass/fail) - Update requirements.yaml to include system requirements at top - Update .reviewmark.yaml with complete review-set structure: - FileAssert-System (system requirements, design intro/system, integration tests) - FileAssert-Cli/Configuration/Modeling/Utilities/SelfTest subsystem reviews - Updated unit reviews with new design docs and corrected file groupings - FileAssert-FileAssertData review for the new data design doc - Moved ContextNewPropertiesTests.cs from FileAssert-FileAssertConfig to FileAssert-Context - Moved IntegrationTests.cs from FileAssert-Program to FileAssert-System Agent-Logs-Url: https://github.com/demaconsulting/FileAssert/sessions/09aae50d-3d67-4a2c-84ef-dfe80449ee7b Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Added in commit 5d0107c:
|
There was a problem hiding this comment.
Pull request overview
This PR restructures the source and test projects into subsystem-aligned folders/namespaces (per the design hierarchy), adds missing design documentation and requirement streams at system/subsystem level, and updates ReviewMark review-sets to match the new documentation and layout.
Changes:
- Reorganized C# source/test code into subsystem directories with updated namespaces and corresponding
usingupdates. - Added system + subsystem requirements (ReqStream YAML) and new subsystem/system integration tests to provide evidence.
- Added/updated design documentation files and updated
.reviewmark.yamlanddocs/design/definition.yamlto reflect the hierarchy.
Reviewed changes
Copilot reviewed 45 out of 45 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/DemaConsulting.FileAssert/Cli/Context.cs |
Moves Context into DemaConsulting.FileAssert.Cli namespace. |
src/DemaConsulting.FileAssert/Configuration/FileAssertConfig.cs |
Moves config loader into ...Configuration and updates imports. |
src/DemaConsulting.FileAssert/Configuration/FileAssertData.cs |
Moves DTOs into ...Configuration namespace. |
src/DemaConsulting.FileAssert/Modeling/FileAssertFile.cs |
Moves modeling type into ...Modeling and updates imports. |
src/DemaConsulting.FileAssert/Modeling/FileAssertRule.cs |
Moves rule hierarchy into ...Modeling and updates imports. |
src/DemaConsulting.FileAssert/Modeling/FileAssertTest.cs |
Moves test model into ...Modeling and updates imports. |
src/DemaConsulting.FileAssert/Program.cs |
Updates imports to reference new subsystem namespaces. |
src/DemaConsulting.FileAssert/SelfTest/Validation.cs |
Moves Validation into ...SelfTest and updates imports. |
src/DemaConsulting.FileAssert/Utilities/PathHelpers.cs |
Moves utilities into ...Utilities namespace. |
test/DemaConsulting.FileAssert.Tests/Cli/ContextTests.cs |
Aligns test namespace with Cli subsystem. |
test/DemaConsulting.FileAssert.Tests/Cli/ContextNewPropertiesTests.cs |
Aligns test namespace with Cli subsystem. |
test/DemaConsulting.FileAssert.Tests/Cli/CliSubsystemTests.cs |
Adds subsystem-level integration tests for CLI behavior. |
test/DemaConsulting.FileAssert.Tests/Configuration/FileAssertConfigTests.cs |
Aligns test namespace with Configuration subsystem. |
test/DemaConsulting.FileAssert.Tests/Configuration/ConfigurationSubsystemTests.cs |
Adds subsystem-level integration tests for config load/filter behavior. |
test/DemaConsulting.FileAssert.Tests/IntegrationTests.cs |
Adds system-level pass/fail config execution tests; updates imports. |
test/DemaConsulting.FileAssert.Tests/Modeling/FileAssertFileTests.cs |
Aligns test namespace with Modeling subsystem. |
test/DemaConsulting.FileAssert.Tests/Modeling/FileAssertRuleTests.cs |
Aligns test namespace with Modeling subsystem. |
test/DemaConsulting.FileAssert.Tests/Modeling/FileAssertTestTests.cs |
Aligns test namespace with Modeling subsystem. |
test/DemaConsulting.FileAssert.Tests/Modeling/ModelingSubsystemTests.cs |
Adds subsystem-level integration tests for modeling execution chain. |
test/DemaConsulting.FileAssert.Tests/ProgramTests.cs |
Updates imports to new namespaces. |
test/DemaConsulting.FileAssert.Tests/SelfTest/SelfTestSubsystemTests.cs |
Adds subsystem-level integration test for self-validation pipeline. |
test/DemaConsulting.FileAssert.Tests/SelfTest/ValidationTests.cs |
Aligns test namespace with SelfTest subsystem. |
test/DemaConsulting.FileAssert.Tests/Utilities/PathHelpersTests.cs |
Aligns test namespace/imports with Utilities subsystem. |
test/DemaConsulting.FileAssert.Tests/Utilities/UtilitiesSubsystemTests.cs |
Adds subsystem-level integration test for safe path handling. |
docs/design/cli.md |
Adds CLI subsystem design doc. |
docs/design/configuration.md |
Adds Configuration subsystem design doc. |
docs/design/context.md |
Adds Context unit design doc. |
docs/design/definition.yaml |
Updates design doc build order to include new hierarchy. |
docs/design/file-assert-data.md |
Adds DTO unit design doc. |
docs/design/modeling.md |
Adds Modeling subsystem design doc. |
docs/design/path-helpers.md |
Adds PathHelpers unit design doc. |
docs/design/program.md |
Adds Program unit design doc. |
docs/design/selftest.md |
Adds SelfTest subsystem design doc. |
docs/design/system.md |
Adds system-level design/flow doc. |
docs/design/utilities.md |
Adds Utilities subsystem design doc. |
docs/design/validation.md |
Adds Validation unit design doc. |
docs/reqstream/fileassert-system.yaml |
Adds system-level requirements and maps to integration tests. |
docs/reqstream/subsystem-cli.yaml |
Adds CLI subsystem requirements and maps to subsystem tests. |
docs/reqstream/subsystem-configuration.yaml |
Adds Configuration subsystem requirements and maps to subsystem tests. |
docs/reqstream/subsystem-modeling.yaml |
Adds Modeling subsystem requirements and maps to subsystem tests. |
docs/reqstream/subsystem-selftest.yaml |
Adds SelfTest subsystem requirements and maps to subsystem tests. |
docs/reqstream/subsystem-utilities.yaml |
Adds Utilities subsystem requirements and maps to subsystem tests. |
requirements.yaml |
Includes system + subsystem requirement streams ahead of unit streams. |
.reviewmark.yaml |
Updates review-sets to match new requirements/design/test grouping. |
.cspell.yaml |
Adds selftest dictionary word for spelling checks. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
test/DemaConsulting.FileAssert.Tests/Utilities/UtilitiesSubsystemTests.cs
Show resolved
Hide resolved
|
@copilot SelfTestSubsystem_Run_ExecutesBuiltInTestsAndProducesSummary failed on Windows because a file was in use. Can you check for proper disposal of resources. |
Use explicit `using (var context = ...) { }` braces in SelfTestSubsystemTests
and CliSubsystemTests so the log file handle is fully released before:
- File.ReadAllText reads the log content
- tempDir.Delete(recursive: true) deletes the temp directory
Prevents 'file in use' errors on Windows where handles are not immediately
released after IDisposable.Dispose() if the file is still referenced.
Agent-Logs-Url: https://github.com/demaconsulting/FileAssert/sessions/ad3cb669-ac43-4111-be69-5b914dde7fc7
Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Fixed in commit 83f06f4. Both |
Pull Request
Description
Restructures source and test code to match the subsystem hierarchy defined in
docs/design/introduction.md, adds missing design documentation for all system/subsystem/unit levels, introduces subsystem-level requirements with corresponding integration tests, adds system-level requirements, updates review-sets to follow the reviewmark-usage standard, and fixes resource disposal in subsystem tests to prevent Windows file-locking failures.Source & Test Restructuring
Files moved from flat directories into subsystem subdirectories with updated namespaces:
Cli/Context.csDemaConsulting.FileAssert.CliConfiguration/FileAssertConfig.cs,FileAssertData.csDemaConsulting.FileAssert.ConfigurationModeling/FileAssertTest.cs,FileAssertFile.cs,FileAssertRule.csDemaConsulting.FileAssert.ModelingUtilities/PathHelpers.csDemaConsulting.FileAssert.UtilitiesSelfTest/Validation.csDemaConsulting.FileAssert.SelfTestProgram.csstays at root inDemaConsulting.FileAssert. Test project mirrors the same layout with matching namespace changes. Appropriateusingdirectives added throughout.Design Documentation
Added 11 new Markdown files covering the full documentation hierarchy:
system.md— system-level design and execution flowcli.md,configuration.md,modeling.md,utilities.md,selftest.md— subsystem docsprogram.md,context.md,file-assert-data.md,path-helpers.md,validation.md— unit docsUpdated
docs/design/definition.yamlto include all new docs in hierarchical order.Subsystem Requirements & Tests
Added 5 subsystem requirement files (
docs/reqstream/subsystem-{cli,configuration,modeling,utilities,selftest}.yaml) with corresponding subsystem integration test classes that verify inter-unit integration within each subsystem.requirements.yamlupdated to include subsystem requirements above unit requirements.System-Level Requirements & Tests
Added
docs/reqstream/fileassert-system.yamlwith system-level requirements covering end-to-end config execution, failure detection, silent output, and log file output. Two new end-to-end integration tests added (IntegrationTest_ValidConfig_PassingAssertions_ReturnsZeroandIntegrationTest_ValidConfig_FailingAssertions_ReturnsNonZero) to cover the core assertion pass/fail scenarios.requirements.yamlupdated to include system requirements at the top.Review-Sets Update
Updated
.reviewmark.yamlto follow the reviewmark-usage standard with a complete review-set structure:FileAssert-System— system requirements, design intro and system docs, integration testsFileAssert-Cli,FileAssert-Configuration,FileAssert-Modeling,FileAssert-Utilities,FileAssert-SelfTest— subsystem reviewsFileAssert-FileAssertDatareview added for the DTO design docContextNewPropertiesTests.csmoved toFileAssert-Context;IntegrationTests.csmoved toFileAssert-SystemResource Disposal Fix
Switched from
using var context(C# 8 declaration-style) to explicitusing (var context = ...) { }braces inSelfTestSubsystemTestsandCliSubsystemTests. This ensures theContext'sStreamWriterlog file handle is fully released beforeFile.ReadAllTextreads the log content and beforetempDir.Delete(recursive: true)removes the temporary directory — preventing "file in use" failures on Windows.Type of Change
Related Issues
Pre-Submission Checklist
Before submitting this pull request, ensure you have completed the following:
Build and Test
dotnet build --configuration Releasedotnet test --configuration Releasedotnet run --project src/DemaConsulting.FileAssert --configuration Release --framework net10.0--no-build -- --validateCode Quality
dotnet format --verify-no-changesQuality Checks
Please run the following checks before submitting:
./lint.sh(Unix/macOS) orcmd /c lint.bat/./lint.bat(Windows)Testing
Documentation
Additional Notes
94 tests pass across net8.0, net9.0, and net10.0 (up from 84 — 10 new tests: 8 subsystem integration tests + 2 system-level end-to-end tests). CodeQL found 0 alerts.