SemanticDiff icon indicating copy to clipboard operation
SemanticDiff copied to clipboard

Code moved between files not working as expected

Open Kangaroux opened this issue 2 years ago • 1 comments
trafficstars

Describe the Bug When moving code from one file to another, I'm expecting to see it moved in the viewer, but it's not.

To Reproduce

  1. Create a file with some code and commit to master
  2. Create a PR that moves the code into a new file

Expected Behavior I see that code was moved from original.py to one.py, two.py, three.py

Actual Behavior No moved code is detected

Links I created a simple repo to test: https://github.com/Kangaroux/semanticdiff-moved-code

This PR moves the code and deletes the original file: https://app.semanticdiff.com/Kangaroux/semanticdiff-moved-code/pull/1/#one.py

This PR moves the code and deletes all the content, but keeps the file intact: https://app.semanticdiff.com/Kangaroux/semanticdiff-moved-code/pull/2/#one.py

Kangaroux avatar Nov 06 '23 21:11 Kangaroux

Thanks for your bug report.

TLDR: Unfortunately, we do not support cross-file moves yet, but we're planning to implement this in the future.

We support viewing any public pull request with SemanticDiff, whether they have our GitHub App installed or not. This means we can't precompute any data and have to generate the diff on the fly when a user clicks on a file. Transferring and analyzing all the files in a pull request at once could result in long wait times for large pull requests. As a result, the diff generation only takes the file currently displayed by the user into account.

We plan to change this for repos that have our GitHub App installed. In this case, we will use webhooks to determine when a pull request has been opened or updated and perform more sophisticated analysis. This would also make cross file movement detection feasible. However, this is still a work in progress.

mmueller2012 avatar Nov 06 '23 23:11 mmueller2012