Introduce ZAPDiff Action and Refactor ZAPDiff CLI#64
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new ZAPDiff action and CLI command to compare ZAP XML files, generating reports in CSV and HTML formats. It includes logic to extract specific XML elements for visual diffing in the HTML report and refactors element identification to use a more descriptive 'Entity Unique Identifier.' Feedback focuses on several issues in the XML parsing and diffing logic, such as a regex that fails to handle text() functions, fragile string-based matching for child elements, and incorrect handling of multi-line self-closing tags. Additionally, the HTML report generation contains a performance bottleneck due to redundant file I/O and an incorrect calculation for unified diff hunk headers. The priority level for missing files was also noted as being incorrectly set to the lowest severity.
This PR introduces the ZAPDiff action to compare ZAP XML configuration files using ZAPDiff CLI and generate reports (CSV and rich HTML). The CLI part was already merged previously.
Changes
Core Logic (zapdiff package)
UI/Report
Action