Skip to content

Introduce ZAPDiff CLI#63

Merged
AryaHassanli merged 10 commits into
project-chip:mainfrom
AryaHassanli:zapdiff-cli
Apr 15, 2026
Merged

Introduce ZAPDiff CLI#63
AryaHassanli merged 10 commits into
project-chip:mainfrom
AryaHassanli:zapdiff-cli

Conversation

@AryaHassanli
Copy link
Copy Markdown
Contributor

This PR introduces the zapdiff CLI tool to compare two sets of ZAP XML files and report mismatches in a CSV format.

Changes:

  • Added zapdiff package with a pipeline for comparing XML files.
  • Implemented element ID generation for ZAP XML elements to identify matching entities across files (essentially an XPath).
  • Added mismatch detection for missing tags, missing attributes, and attribute value differences.
  • Added CLI command zapdiff to run the comparison and output results to mismatches.csv.
  • Implemented sorting of mismatches by Level (Descending), Path, Type, ElementID, and Details for a structured output.

@AryaHassanli AryaHassanli requested a review from a team as a code owner April 15, 2026 13:54
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds a zap-diff command to compare ZAP XML files and export inconsistencies to CSV. The review feedback identifies several critical improvements: ensuring unique element IDs to prevent data loss during comparison, implementing recursive file searching to cover the full SDK structure, handling errors during CSV flushing, and optimizing performance through map pre-allocation.

Comment thread zapdiff/element_id.go
Comment thread zapdiff/element_id.go
Comment thread cmd/cli/zapdiff.go
Comment thread cmd/cli/zapdiff.go Outdated
Comment thread zapdiff/check.go Outdated
Comment thread zapdiff/check.go Outdated
@AryaHassanli AryaHassanli merged commit d1c2404 into project-chip:main Apr 15, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant