Closed bobsilverberg closed 5 years ago
@EnTeQuAk the API response below for an unmodified file is still returning diff: null
. That should be a diff with the fake hunk you added, right? I'm re-opening this just so we don't lose track of it but let me know if I should open a separate issue.
https://addons-dev.allizom.org/api/v5/reviewers/addon/502868/versions/1541685/compare_to/1688187/?file=Grammarly.html&lang=en-US
Yeah, I'll look into this and see if this needs a separate issue or not.
@EnTeQuAk the API response below for an unmodified file is still returning diff: null
The problem was a cache-layer I had to put into the API that cached multiple calls to generating diffs (which we are to fetch all the information in various places). This got fixed and should be heading to dev any minute now.
@EnTeQuAk My test results:
diff
is displayed for each line with the type:" "
which means unmodified (at least for the files I checked on -dev and -stage).Samples I tested with https://code.addons-dev.allizom.org/en-US/browse/390151/versions/1688302/ https://code.addons.allizom.org/en-US/compare/1002795/versions/2474830...2474841/
An example
diff
for cose.sig and mozilla.rsa binary files from META-INF don't return a 500 right now but the binary file is not displayed in code manager for the compare view (the browse view shows them). Looks like this
and the diff
is
@EnTeQuAk As discussed , the diff for cose.sig and mozilla.rsa looks as expected.
@bobsilverberg @kumar303
So, we're now returning the full data of unchanged lines for unchanged files, except for binary files where we don't render any hunk information. That safes me from issues like mozilla/addons#6757 but I figured, while we're only interested in "this binary file has changed", we might be more interested in the future about changes to images. Currently the download_url
only contains the new-versions file download-url and there's no easy way to retrieve the parent-versions file download-url.
Would that be something worth adding? (I'd assume not too high priority though)
Would that be something worth adding? (I'd assume not too high priority though)
Since we have quite a queue of feature requests I think we can wait until a reviewer requests it. I expect that we'll get some good feature requests once we are able to ship v1 and get reviewers using it daily.
Currently the Compare API returns an empty file for the file contents when there are no changes. Instead of that could it please return the full contents of the file, with all lines showing as unchanged?
This will fix https://github.com/mozilla/addons-code-manager/issues/831 and should also help with the work on https://github.com/mozilla/addons-code-manager/issues/672.