Addons-server: Review Tools showing files as blank

Created on 10 Nov 2020  路  6Comments  路  Source: mozilla/addons-server

I have noticed a number of files that show up as blank in comparison.

image

Downloading the add-on, shows that the files were not blank.

Example:
Add-on:
https://addons.mozilla.org/en-US/firefox/addon/pepega-catch/
Compare:
https://code.addons.mozilla.org/en-US/compare/2592637/versions/5004720...5104530/?path=src%2Fcontent%2Fcontent.js

Other files showing as blank in above add-on:

battleBreakdown.html
fusionRecipes.html
popup.html

code manager git p1 pull request ready verified fixed prod_bug

Most helpful comment

The situation is not limited to one add-on. Most files in the following also show as blank.

https://code.addons.mozilla.org/en-US/compare/2666547/versions/5129470...5131839/?path=src%2Fjs%2Fbackground.js

All 6 comments

The issue here is that the API is returning an empty array for hunks, which is why addons-code-manager is displaying an empty diff. It's not happening for all files, but seems to be happening for a lot of files for this add-on. An example of a file that does have content is https://code.addons-dev.allizom.org/en-US/compare/620286/versions/1692283...1692284/?path=src%2Fpepega%2Fpepega.css.

Transferring this to addons-server as it seems to be an API issue, or possibly an extraction issue.

The problem comes from whitespace changes. Looks like the file is only reformatted and we ignore whitespace changes sometimes. We aren't able to reconstruct the entire file because the status of the delta is not marked as unmodified (it is actually modified).

The good news is that we should be able to write a test case for that. The bad news is that I am not sure how to fix the issue.

Looks like the change related to whitespaces has been introduced in https://github.com/mozilla/addons-server/commit/4f7a5f7e2c174463f6cb585cb206c48d5dbdb782. This is a generalization of https://github.com/mozilla/addons-server/pull/13680, we hide whitespace changes but if the entire diff contains such changes, we get no visible changes at all (and still a delta marked as modified)

The situation is not limited to one add-on. Most files in the following also show as blank.

https://code.addons.mozilla.org/en-US/compare/2666547/versions/5129470...5131839/?path=src%2Fjs%2Fbackground.js

Was this page helpful?
0 / 5 - 0 ratings