Improve fetching of original/patched file content.

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

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.

Summary ID
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
Description From Last Updated

F401 'reviewbot.processing.review.File' imported but unused

reviewbotreviewbot

F811 redefinition of unused 'test_original_file_contents_with_http_404' from line 469

reviewbotreviewbot

F811 redefinition of unused 'test_patched_file_contents_with_http_404' from line 544

reviewbotreviewbot
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

chipx86
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-3.0.x (1f919bf)