MergeCommand: add options to --validate-output(-relaxed) … - #335
MergeCommand: add options to --validate-output(-relaxed) …#335jimklimov wants to merge 3 commits into
Conversation
…ly avoid writing an invalid document Signed-off-by: Jim Klimov <jimklimov@gmail.com>
…do write the file for troubleshooting Signed-off-by: Jim Klimov <jimklimov@gmail.com>
Signed-off-by: Jim Klimov <jimklimov@gmail.com>
|
FYI: This PR is part of a series I've opened 3 years ago, and stalled in review for whatever reasons including the under-the-hood use of reflection to implement inspection of arbitrary BOM entities to merge them, including the ones still open at this time:
I (and my dayjob's budget) have recently employed Claude AI to pick up where I left long ago, and rewrite those changes in idiomatic C#, rebased over current upstream achievements. After some internal dev-testing shows that this rewrite is successful, I hope these old PRs will be supplanted by a new series with new technological base and same or better feature set as what I was stuck with using (slowly bit-rotting over the years). Hopefully the new set of PRs would be less questionable for an upstream merge :) I'll add this note to all impacted PRs listed above. |
…and optionally avoid writing an invalid document
Came up while testing CycloneDX/cyclonedx-dotnet-library#245 but is a relatively independent feature, given that we juggle several versions of faulty merge generator and JSON validator (in-tree and after respective PR merges).
This little change compiles independently and can also be used to check the original bug for that PR in one command, not two (merge+validate) and even allows to protect the output file from changes ;)
In-tree code sees no evil, hears no evil, does not complain.
Library with validate-json-bomref branch does complain for the same inputs:
Writing output file...;)FWIW, with the full stack of relevant PRs in discussion applied locally, it is much faster and does dedup well (definition of "well" may vary though, see CycloneDX/cyclonedx-dotnet-library#245):