Cache Key now takes Git's Raw File URL Mask into account

Review Request #7928 — Created Jan. 30, 2016 and submitted — Latest diff uploaded

Information

Review Board
release-2.5.x

Reviewers

After initializing a Git repository and adding a bad Raw File URL Mask, the retrieved file is cached. After the Raw File URL Mask is changed to a valid one, the retrieved file is still from the cache because it does not take into consideration the new Raw File URL.

This was fixed by including the raw_file_url into the cache key for the functions: _make_file_exists_cache_key and _make_file_exists_cache_key. By including the raw_file_url into the cache key, the cache key will change whenever the raw file url is changed, such that it will not retrieve stale files from the cache. This change was included in reviewboard/scmtools/models.py.

Added unit tests to check that the cached copy of the file is grabbed when there are no changes to the raw_file_url and to check that a new file is retrieved when the raw_file_url changes.
Added unit test for get_file_exists() function.

Ran whole test suite- all tests pass.

    Loading...