Improve fetching of original/patched file content.

Review Request #12075 — Created Feb. 23, 2022 and submitted — Latest diff uploaded

Information

ReviewBot
release-3.0.x

Reviewers

We no longer attempt to fetch original content for new files or patched
content for deleted files. Instead, these are immediately returned as
None.

File content fetching is also better protected, handling HTTP 404 and
500 results, which both will return None. Previously, HTTP 404 results
were handled when fetching file paths, but not file content, which was
backwards. HTTP 500 wasn't handled at all, instead causing crashes.

Relevant unit tests pass.

Diff Revision 2 (Latest)

orig
1
2

Commits

First Last Summary ID Author
Improve fetching of original/patched file content.
We no longer attempt to fetch original content for new files or patched content for deleted files. Instead, these are immediately returned as `None`. File content fetching is also better protected, handling HTTP 404 and 500 results, which both will return `None`. Previously, HTTP 404 results were handled when fetching file paths, but not file content, which was backwards. HTTP 500 wasn't handled at all, instead causing crashes.
eaef6efa6c25c66893bbf5e16311f057978c4de5 Christian Hammond
bot/reviewbot/processing/review.py
bot/reviewbot/processing/tests/test_file.py
bot/reviewbot/testing/testcases.py
Loading...