Closed Bug 1827632 Opened 3 years ago Closed 3 years ago

Lando uplifts don't handle copies correctly

Categories

(Conduit :: Lando, defect)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: sheehan, Assigned: sheehan)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Lando uplifts are incorrectly marking file copies as file renames.

I jumped into an ipython REPL to try and reproduce the problem. I pulled the diff of the original patch down from Phabricator using the differential.getrawdiff API endpoint. Then I passed it into rs_parsepatch.get_diffs(diff, hunks=True) in the same way Lando does. I noticed the returned diffs from rs_parsepatch have the filename: 'toolkit/content/tests/widgets/test_videocontrols_scrubber_position_nopreload.html' entry having 'copied_from': None and 'renamed_from': 'toolkit/content/tests/widgets/test_videocontrols_scrubber_position.html'.

I believe this issue originates in rs_parsepatch's handling of file copies.

I think the problem is because of:
https://github.com/mozilla/rust-parsepatch/blob/b3dbb48ecc73de3fecea20c7e8848a3fc2239772/src/parser.rs#L441
where the passed operation is FileOp::Renamed but in considering the if before:
https://github.com/mozilla/rust-parsepatch/blob/b3dbb48ecc73de3fecea20c7e8848a3fc2239772/src/parser.rs#L417
we should likely pass op instead.

This will be deployed tomorrow.

Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: