PPLT-5495: Add file diff data to generate graph#2273
PPLT-5495: Add file diff data to generate graph#2273RaghavsBrowserStack wants to merge 5 commits into
Conversation
Claude Code PR ReviewPR: #2273 • Head: 59b0a66 • Reviewers: stack:code-reviewer SummaryAdds line-level diff ranges to the SmartSnap graph pipeline: a new Review Table
Findings
Verdict: PASS |
bhokaremoin
left a comment
There was a problem hiding this comment.
Remove the claude's unnecessary code comments
| // Parse `git diff --unified=0` hunk headers to find which line ranges are new | ||
| // or changed (on the HEAD side) for each file, then key them by the file's | ||
| // index in the stats `files` array — the same index module/source refs use, so | ||
| // the graph can join them without a path lookup. `--unified=0` drops context | ||
| // lines so every hunk header bounds an actual change; `--no-renames` makes a | ||
| // rename surface as add+delete so the new path is always concrete. | ||
| // | ||
| // Files in the diff that aren't tracked in `files` (e.g. node_modules, | ||
| // .storybook, or anything the stats compactor didn't index) are skipped — the | ||
| // graph can only reason about indexed files. Returns { <fileIndex>: [[start, end], ...] }. |
This PR complies with the new implementation of the smartsnap API contract with backend in which imports and passThroughExports can have a loc array which is an array of tuple of 2, this data is newly added to enriched-stats.json and the generate graph additionally accepts a affected_file_locations which maps files to the index of lines changed.