Fix bugs found during formal code review of all 43 review-sets#177
Fix bugs found during formal code review of all 43 review-sets#177Malcolmnixon merged 7 commits intomainfrom
Conversation
Agent-Logs-Url: https://github.com/demaconsulting/SpdxTool/sessions/9d438e0a-a2cc-4d33-a78a-29085504e34b Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Agent-Logs-Url: https://github.com/demaconsulting/SpdxTool/sessions/b56cf001-b225-4370-abc6-f7af0ca00fd6 Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
|
@copilot The code doesn't compile. |
There was a problem hiding this comment.
Pull request overview
This PR addresses bugs and documentation inaccuracies found during a formal review of the repo’s 43 review-sets, primarily improving correctness of self-tests, workflow commands, and user-facing documentation.
Changes:
- Fixes incorrect assertions in
ToMarkdownTeststhat were allowing missing sections to pass. - Updates self-test naming/traceability (
ValidateBasic) and strengthens rename-id self-test verification. - Aligns command behavior/docs: literal variable key handling, safer stdout/stderr joining for
query, and updated usage/docs text.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| test/DemaConsulting.SpdxTool.Tests/Commands/ToMarkdownTests.cs | Fixes reversed assertions so the test fails when required markdown sections are missing. |
| src/DemaConsulting.SpdxTool/SelfTest/ValidateRenameId.cs | Expands validation pattern to check relationship references post-rename. |
| src/DemaConsulting.SpdxTool/SelfTest/ValidateBasic.cs | Renames reported self-test from SpdxTool_Validate to SpdxTool_Basic for traceability alignment. |
| src/DemaConsulting.SpdxTool/Program.cs | Updates usage text to include -? help alias and --depth option. |
| src/DemaConsulting.SpdxTool/Commands/SetVariable.cs | Adjusts output handling to treat it as a literal variable key (no expansion). |
| src/DemaConsulting.SpdxTool/Commands/Query.cs | Inserts a newline between stdout/stderr before matching to avoid merged lines. |
| src/DemaConsulting.SpdxTool/Commands/CopyPackage.cs | Updates command summary to reflect CLI support (not “workflow only”). |
| docs/user_guide/introduction.md | Updates diagram synopsis to include optional [tools]. |
| docs/reqstream/spdx-tool/self-test/validate-basic.yaml | Updates requirement wording to reflect actual ValidateBasic behavior. |
| docs/design/spdx-tool/self-test/validate-run-nuget-workflow.md | Aligns design description with current implementation behavior. |
| docs/design/spdx-tool-targets/spdx-tool-targets.md | Updates target naming/config table to match current MSBuild targets implementation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…operty name Agent-Logs-Url: https://github.com/demaconsulting/SpdxTool/sessions/09666075-afad-4f30-95df-01a2b0e57182 Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Fixed in commit 969143d. Two compile errors:
|
|
@copilot The tests are failing. |
…update IntegrationTests for SpdxTool_Basic Agent-Logs-Url: https://github.com/demaconsulting/SpdxTool/sessions/c4974926-ea59-4124-bae0-bc85abc197cc Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Fixed in commit 7e4245b. Two issues were addressed:
All 127 |
|
@copilot I'm seeing the following build failure: Additionally "-Plt-" looks like an unnecessary contraction - please remove contractions like this from all requirement IDs. |
…te SpdxTool_Validate test references to SpdxTool_Basic Agent-Logs-Url: https://github.com/demaconsulting/SpdxTool/sessions/43a3ff04-14f9-47dd-87d1-8e1d8cb2a603 Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
... Fixed in commit 61f504b:
|
|
@copilot I asked you to fix ALL contractions in requirement IDs. I'm seeing "-Tgt-" and "-ST-" and there are numerous others. |
…elationship, Xfm→Transform, Hsh→Hash, Cmd→Command, Wkf→Workflow, Man→Manage, Val→Validate, ST→SelfTest, Util→Utility Agent-Logs-Url: https://github.com/demaconsulting/SpdxTool/sessions/7e6f93ba-ebc3-4f9f-b706-e64561963b29 Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Fixed in commit 0045e30. All 11 contractions across the 36 reqstream YAML files have been expanded:
Both the |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 48 out of 48 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Agent-Logs-Url: https://github.com/demaconsulting/SpdxTool/sessions/93a88842-8ff0-4d84-ae81-740abf3b38d3 Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 48 out of 48 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Formal code review was performed across all 43 review-sets defined in
.reviewmark.yaml. Several real bugs, documentation inaccuracies, and requirement ID naming issues were identified and fixed.Description
Critical Fixes
ValidateBasic.cs— Self-test reported results under name"SpdxTool_Validate"but requirements, design doc, and unit test all expect"SpdxTool_Basic", breaking traceability.IntegrationTests.cs— Updated both TRX and JUnit integration test assertions fromSpdxTool_ValidatetoSpdxTool_Basicto match the renamed self-test.Bug Fixes
SetVariable.cs— Output variable name was being expanded throughvariablesbefore use as a dict key. Design requires it to be used literally. Fixed by passing an empty dictionary[]toGetMapStringto suppress variable expansion on the output key name.Query.cs— stdout and stderr were concatenated without a separator (trimA + trimB), risking merged lines corrupting regex matching. Fixed with"\n"join before trim.ValidateRenameId.cs— Post-rename verification only checked the packageId; relationship references weren't verified. AddedRelationships: [{ RelatedSpdxElement: "SPDXRef-Package-2", RelationshipType: "DESCRIBES" }]to the pattern match.Requirements Fixes
platform-requirements.yaml— Test references pointed toSpdxTool_Validate(no longer emitted after theValidateBasicrename); updated all six toSpdxTool_Basicso the requirements traceability check passes.Plt→PlatformTgt→TargetPkg→PackageRel→RelationshipXfm→TransformHsh→HashCmd→CommandWkf→WorkflowMan→ManageVal→ValidateST→SelfTestUtil→UtilityDocumentation / UI Fixes
Program.cs— Usage message omitted-?(implemented, required by spec) and--depth(fully implemented and tested).CopyPackage.cs—CommandEntrydescription said"(workflow only)"despite full CLI support being implemented and tested.docs/design/spdx-tool-targets/spdx-tool-targets.md— Target name corrected fromDecorateNuGetSbom→DecorateSbomTarget; missingSpdxToolCommandproperty added to config table;SpdxWorkflowFiledefault corrected from—tospdx-workflow.yaml; data-flow section updated to show$(SpdxToolCommand) run-workflow ...(defaulting todotnet spdx-tool).docs/user_guide/introduction.md—diagramcommand synopsis was missing the optional[tools]argument;copy-packageentry no longer labelled "(workflow only)";SpdxTool_Validatesample output and description updated toSpdxTool_Basic.README.md—SpdxTool_Validatesample output and description updated toSpdxTool_Basic.validate-run-nuget-workflow.md— Design described writing and verifying an SPDX document; implementation simply runsGetDotNetVersionand checks exit code. Updated design to match reality.validate-basic.yaml— Requirement title said "exercise the basic commands (version, help, silent, log)" but the self-test runsvalidatewith--silent/--logflags. Updated to accurately describe what is tested.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.SpdxTool --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
Review reports for all 43 review-sets are in
.agent-logs/(gitignored). Additional lower-priority findings (missing error-condition test coverage, misleading test names in FindPackage/GetVersion/CopyPackage, incomplete purl verification in ValidateAddPackage) were captured in those reports but not addressed here.