Fix duplicate link references and address all reviewmark review-set findings#76
Fix duplicate link references and address all reviewmark review-set findings#76Malcolmnixon merged 13 commits intomainfrom
Conversation
Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
|
@copilot Please use the Code Review agent to run all .reviewmark.yaml review-sets; then fix all findings. |
Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Done in 7d9e6cb. All 11 review-sets ran; 5 findings were fixed:
|
Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR cleans up documentation link references and tightens self-validation/test infrastructure so that the validate/version behaviors are asserted meaningfully and the validation helper code is de-duplicated.
Changes:
- Consolidates duplicate reference-style links in
docs/design/introduction.md. - Strengthens test assertions for
--versionand--validatebehavior in unit/integration tests. - Refactors self-validation helper logic in
Validation.cs(removes duplicated enforcement test infrastructure) and updates related docs/comments.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/DemaConsulting.SarifMark.Tests/ProgramTests.cs | Uses a source-generated semver regex to assert --version output is only a version string. |
| test/DemaConsulting.SarifMark.Tests/IntegrationTests.cs | Makes --validate integration test assert a successful (0) exit code. |
| src/DemaConsulting.SarifMark/Validation.cs | Refactors enforcement validation to reuse RunValidationTest; expands helper to accept extra args and pass exit code to validators. |
| src/DemaConsulting.SarifMark/SarifResults.cs | Corrects XML doc to reflect the purpose of the internal constructor. |
| src/DemaConsulting.SarifMark/SarifResult.cs | Corrects XML doc to reflect the purpose of the internal constructor. |
| docs/design/validation.md | Updates design documentation to match the refactored validation helper/validator signature. |
| docs/design/introduction.md | Collapses duplicate link references into a single repository reference. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
|
@copilot Please use the code-review agent to run the .reviewmark.yaml reviews one at a time (so there's no context pollution between reviews) and then gather up all the results. |
There was a problem hiding this comment.
Pull request overview
This PR updates SarifMark’s design/requirements documentation and tightens the self-validation + test suite to address findings from running each .reviewmark.yaml review-set independently, while removing redundant design documentation.
Changes:
- Strengthen unit/integration tests (version output validation, help output flag coverage, exit code assertions, log-file behaviors, argument exception param name checks).
- Refactor self-validation infrastructure in
Validation.csto reduce duplication and improve failure reporting. - Update design + reqstream docs, adjust ReviewMark review-set paths, and remove the redundant
docs/design/utilities.md.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/DemaConsulting.SarifMark.Tests/ValidationTests.cs | Extends validation header assertions to cover additional fields. |
| test/DemaConsulting.SarifMark.Tests/ProgramTests.cs | Improves version output assertion via source-generated regex; expands help output assertions. |
| test/DemaConsulting.SarifMark.Tests/PathHelpersTests.cs | Adds ParamName assertions for argument exceptions. |
| test/DemaConsulting.SarifMark.Tests/IntegrationTests.cs | Makes validate integration test assert a successful exit code. |
| test/DemaConsulting.SarifMark.Tests/ContextTests.cs | Fixes console redirection target; adds log-file write coverage for WriteLine/WriteError. |
| test/DemaConsulting.SarifMark.Tests/AssemblyInfo.cs | Documents why tests are non-parallel (console redirection). |
| src/DemaConsulting.SarifMark/Validation.cs | Refactors enforcement validation to reuse shared validation helper; enriches validator inputs. |
| src/DemaConsulting.SarifMark/SarifResults.cs | Adjusts SARIF runs enumeration to avoid LINQ over JsonElement enumerators. |
| src/DemaConsulting.SarifMark/SarifResult.cs | Corrects XML doc wording for internal constructor intent. |
| docs/reqstream/sarif-results.yaml | Adds traceability links for additional SarifResults tests. |
| docs/reqstream/program.yaml | Adds integration tests to Program SARIF-analysis requirement links. |
| docs/reqstream/platform.yaml | Updates .NET 10 justification wording. |
| docs/reqstream/context.yaml | Adds traceability links for new log-file-related Context tests. |
| docs/design/validation.md | Updates design notes to reflect null-check and refactored validation helper signature/behavior. |
| docs/design/utilities.md | Removes redundant utilities design doc (covered elsewhere). |
| docs/design/sarif-results.md | Documents required markdown hard line breaks in issue output formatting. |
| docs/design/program.md | Fixes punctuation in version property description. |
| docs/design/introduction.md | Removes duplicate link references; updates layer count after utilities doc removal. |
| docs/design/definition.yaml | Removes deleted utilities.md from design input set. |
| .reviewmark.yaml | Updates review-set paths to include relevant design docs and remove deleted utilities doc. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
…eter order Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
|
@copilot Please use the code-review agent to run the .reviewmark.yaml reviews one at a time (so there's no context pollution between reviews) and then gather up all the results - specifically report the actual issues and observations so they can be addressed rather than keeping on popping up. My goal is to try and make the reviews clean. |
There was a problem hiding this comment.
Pull request overview
This PR updates SarifMark’s tests and documentation to address ReviewMark findings, tighten CLI output assertions (especially around --report/--report-depth), and reduce duplication in the design docs set.
Changes:
- Strengthen MSTest assertions (regex for
--report, semver output, and additional help/header coverage) and add newContextlog-file output tests. - Refactor
Validation.RunEnforcementTestto delegate to the sharedRunValidationTesthelper, and enhance validation callbacks to include the program exit code. - Remove redundant
docs/design/utilities.md, update design/reqstream docs accordingly, and adjust.reviewmark.yamlreview-set inputs.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/DemaConsulting.SarifMark.Tests/ValidationTests.cs | Adds assertions for additional validation header rows (OS/runtime/timestamp). |
| test/DemaConsulting.SarifMark.Tests/ProgramTests.cs | Replaces substring assertions with regex; strengthens version-only output check and expands help option coverage. |
| test/DemaConsulting.SarifMark.Tests/PathHelpersTests.cs | Adds ParamName assertions on thrown ArgumentException for invalid relative paths. |
| test/DemaConsulting.SarifMark.Tests/IntegrationTests.cs | Uses regex for --report to avoid --report-depth false positives; makes validate exit code expectation strict. |
| test/DemaConsulting.SarifMark.Tests/ContextTests.cs | Fixes console stream capture in exit-code test; adds new log-file write coverage for WriteLine/WriteError. |
| test/DemaConsulting.SarifMark.Tests/AssemblyInfo.cs | Disables parallel test execution to avoid Console.Out/Console.Error redirection conflicts. |
| src/DemaConsulting.SarifMark/Validation.cs | Refactors enforcement validation to use shared helper; passes exit code into validators; adds extraArgs support. |
| src/DemaConsulting.SarifMark/SarifResults.cs | Avoids multiple enumeration of runs by using the array enumerator directly. |
| src/DemaConsulting.SarifMark/SarifResult.cs | Updates constructor comment to reflect intent of validated creation pipeline. |
| docs/reqstream/sarif-results.yaml | Adds traceability entries for additional SarifResults tests. |
| docs/reqstream/program.yaml | Adds traceability entries for integration tests covering valid SARIF/report/enforce flows. |
| docs/reqstream/platform.yaml | Edits justification wording for .NET 10 support requirement (formatting/clarity). |
| docs/reqstream/context.yaml | Adds traceability entries for new Context log-file write tests. |
| docs/design/validation.md | Updates design description to match null-check behavior and refactored validation helper signature/flow. |
| docs/design/utilities.md | Removes redundant document (superseded by path-helpers.md). |
| docs/design/sarif-results.md | Clarifies markdown hard line break behavior in generated report output. |
| docs/design/program.md | Minor grammar fix. |
| docs/design/introduction.md | Removes utilities-layer mention and simplifies external doc references. |
| docs/design/definition.yaml | Removes utilities.md from the design document build definition. |
| .reviewmark.yaml | Updates review-set inputs to reflect doc changes and include missing design docs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
All 11 review-sets ran one at a time (commit e1eda9e). All 11 PASS — no failures.
The only actionable observation across all 11 reviews is OBS-01 in |
Agent-Logs-Url: https://github.com/demaconsulting/SarifMark/sessions/8d9bc3e5-e4ae-45e3-b4f6-8f1e5919cf0b Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
…#83) * Initial plan * chore: align with TemplateDotNetTool template (PRs #66, #72-#76, #80) Agent-Logs-Url: https://github.com/demaconsulting/SarifMark/sessions/8d9bc3e5-e4ae-45e3-b4f6-8f1e5919cf0b Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com> * Update .github/workflows/build.yaml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update .github/agents/code-review.agent.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * docs: rename docs/guide to docs/user_guide and guide.md to introduction.md Agent-Logs-Url: https://github.com/demaconsulting/SarifMark/sessions/2fcc24c8-25e2-4d47-91b3-318e14ffb6d1 Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com> * chore: remove legacy agents removed from TemplateDotNetTool template Agent-Logs-Url: https://github.com/demaconsulting/SarifMark/sessions/0162c9bb-1dbc-457e-b5ce-b1b2600688e3 Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com> * chore: align AGENTS.md structure with TemplateDotNetTool template Agent-Logs-Url: https://github.com/demaconsulting/SarifMark/sessions/510afeec-654d-468a-9da0-532e2bdfbb21 Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com> * chore: revert code-review.agent.md step 4 to exact template wording Agent-Logs-Url: https://github.com/demaconsulting/SarifMark/sessions/3f6495f1-09cd-4ab3-9809-0fba0a28ef78 Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com> Co-authored-by: Malcolm Nixon <Malcolm.nixon@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Fixes duplicate link references in
docs/design/introduction.md, strengthens test assertions usingAssert.MatchesRegex, refactors self-validation infrastructure, addresses all findings and observations surfaced by running all 11.reviewmark.yamlreview-sets individually, and removes the redundantdocs/design/utilities.md.Description
docs/design/introduction.md: Collapsed duplicate link references ([user-guide]and[requirements-doc]) into a single[sarifmark-repo]reference; updated prose to "Those topics are addressed in other [SarifMark repository][sarifmark-repo] documentation." Removed the utilities-layer bullet and corrected "four" to "three" primary functional layers following the removal ofutilities.md.docs/design/utilities.md: Removed — the file was redundant withdocs/design/path-helpers.md, which already covers thePathHelpersclass in full detail.docs/design/definition.yaml: Removedutilities.mdfrominput-files..reviewmark.yaml: Addeddocs/design/program.mdanddocs/design/context.mdtoSarifMark-CommandLine-Subsystem-Reviewpaths; addeddocs/design/sarif-results.mdtoSarifMark-Report-Subsystem-Reviewpaths; removeddocs/design/utilities.mdfromSarifMark-PathHelpers-SoftwareUnit-Reviewpaths.ProgramTests.cs: ReplacedAssert.IsTrue(SemanticVersionRegex().IsMatch(...), ...)withAssert.MatchesRegex(@"^\d+\.\d+\.\d+(?:-[\w.-]+)?(?:\+[\w.-]+)?$", output)inProgram_Main_VersionFlag_DisplaysVersionOnly, removing the now-unneeded[GeneratedRegex]method andusing System.Text.RegularExpressions. ReplacedAssert.Contains("--report", output)withAssert.MatchesRegex(@"--report(?!-)", output)inProgram_Main_HelpFlag_DisplaysHelpto prevent a false-positive substring match against--report-depth. ExtendedProgram_Main_HelpFlag_DisplaysHelpto assert all 11 supported flags appear in the help output.IntegrationTests.cs: Replaced vacuousAssert.IsTrue(exitCode is 0 or 1)withAssert.AreEqual(0, exitCode)inIntegrationTest_ValidateFlag_RunsSelfValidation. ReplacedAssert.Contains("--report", output)withAssert.MatchesRegex(@"--report(?!-)", output)inIntegrationTest_HelpFlag_DisplaysHelpfor the same substring-ambiguity fix.SarifResult.cs/SarifResults.cs: Fixed misleading"Internal constructor for testing purposes"XML doc. Replaced non-idiomatic.Any()+.First()onJsonElement.ArrayEnumeratorwith directMoveNext()+Currentenumeration to avoid unnecessary allocation.Validation.cs: RefactoredRunEnforcementTestto delegate toRunValidationTest(removes ~65 lines of duplicated infrastructure). ExtendedRunValidationTestwith an optionalextraArgsparameter and updated validator signature toFunc<int, string, string?, string?>.ContextTests.cs: FixedContext_ExitCode_StartsAtZero_ChangesToOneAfterErrorto redirectConsole.Errorinstead of the unusedConsole.Out. Added three distinct log-file tests:Context_WriteLine_WithLogFile_WritesToLog(non-silent case),Context_WriteLine_SilentModeWithLogFile_WritesToLog(silent case), andContext_WriteError_WithLogFile_WritesToLog.ValidationTests.cs: ExtendedValidation_Run_ValidContext_PrintsValidationHeaderto assert all five header fields (OS Version, DotNet Runtime, and Time Stamp, in addition to the existing two).PathHelpersTests.cs: AddedParamNameassertions toPathWithDoubleDots,FilenameWithEmbeddedDots, andAbsolutePathtests for consistency with the other argument-exception tests.AssemblyInfo.cs: Added explanatory comment for[assembly: DoNotParallelize]describing why Console redirection requires serial test execution.docs/design/program.md: Fixed missing comma after "absent" in the Version Property section.docs/design/sarif-results.md: Documented the trailing two-space markdown hard line break () appended to each result line inAppendIssuesSection, satisfying requirementSarifMark-Report-LineBreaks.docs/design/validation.md: Added null-guard sentence documentingArgumentNullException.ThrowIfNull(context)to satisfySarifMark-Validation-NullCheck. Updated to match the refactoredRunValidationTestsignature andRunEnforcementTestdelegation pattern.docs/reqstream/context.yaml: AddedContext_WriteLine_WithLogFile_WritesToLog,Context_WriteLine_SilentModeWithLogFile_WritesToLog, andContext_WriteError_WithLogFile_WritesToLogto the traceability links forSarifMark-Context-WriteLineandSarifMark-Context-WriteError.docs/reqstream/platform.yaml: ChangedSarifMark-Plt-Net10justification from "future .NET versions" to "as adoption grows".docs/reqstream/program.yaml: Added three integration tests to theSarifMark-Program-SarifAnalysisrequirement to close the traceability gap.docs/reqstream/sarif-results.yaml: AddedSarifResults_ToMarkdown_Depth1_ProducesCorrectOutputas a test link forSarifMark-SarifResults-FormatCountto cover the plural case; addedSarifResults_InternalConstructor_CreatesValidInstancetoSarifMark-SarifResults-Properties.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.SarifMark --configuration Release --framework net10.0--no-build -- --validateCode Quality
dotnet format --verify-no-changesQuality Checks
Please run the following checks before submitting:
cspell "**/*.{md,cs}"markdownlint "**/*.md"yamllint .dotnet run --project src/DemaConsulting.SarifMark --configuration Release --framework net10.0 --no-build -- --validateTesting
Documentation
Additional Notes
All 11
.reviewmark.yamlreview-sets were run individually (no context cross-pollution). All 11 reviews now PASS. Build is zero-warning. All 101 tests pass across .NET 8, 9, and 10.💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.