Skip to content

Commit 47d703d

Browse files
committed
Fix several firefox bugs
- Prevent negative availability caching for unreleased executables. - Prevent additional caching of PublicBrowserStateCache results. - Fix firefox public cache URL.
1 parent c824959 commit 47d703d

3 files changed

Lines changed: 12 additions & 10 deletions

File tree

bughog/subject/web_browser/chromium/state_oracle.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ def find_commit_id(self, commit_nb: int) -> str:
3737
assert re.match(r'[a-z0-9]{40}', rev_id)
3838
return rev_id
3939

40-
@Cache.cache_in_db('web_browser', 'chromium')
40+
# @Cache.cache_in_db('web_browser', 'chromium')
4141
def find_commit_nb_of_release(self, release_version: int) -> int:
4242
return PublicBrowserStateCache.get_release_commit_nb('chromium', release_version)
4343

44-
@Cache.cache_in_db('web_browser', 'chromium')
44+
# @Cache.cache_in_db('web_browser', 'chromium')
4545
def find_commit_id_of_release(self, release_version: int) -> str:
4646
return PublicBrowserStateCache.get_release_commit_id('chromium', release_version)
4747

@@ -50,13 +50,13 @@ def get_most_recent_major_release_version(self) -> int:
5050

5151
# Release state functions
5252

53-
@Cache.cache_in_db('web_browser', 'chromium')
53+
# @Cache.cache_in_db('web_browser', 'chromium')
5454
def has_public_release_executable(self, major_version: int) -> bool:
5555
# TODO: check cache at factory
5656
commit_nb = PublicBrowserStateCache.get_release_commit_nb('chromium', major_version)
5757
return self.has_public_commit_executable(commit_nb)
5858

59-
@Cache.cache_in_db('web_browser', 'chromium')
59+
# @Cache.cache_in_db('web_browser', 'chromium')
6060
def get_release_executable_download_urls(self, major_version: int) -> list[str]:
6161
commit_nb = PublicBrowserStateCache.get_release_commit_nb('chromium', major_version)
6262
return self.get_commit_executable_download_urls(commit_nb)

bughog/subject/web_browser/firefox/state_oracle.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@
44

55

66
class FirefoxStateOracle(StateOracle):
7-
@Cache.cache_in_db('web_browser', 'firefox')
7+
# @Cache.cache_in_db('web_browser', 'firefox')
88
def find_commit_nb(self, commit_id: str) -> int:
99
return PublicBrowserStateCache.firefox_get_commit_nb(commit_id)
1010

11-
@Cache.cache_in_db('web_browser', 'firefox')
11+
# @Cache.cache_in_db('web_browser', 'firefox')
1212
def find_commit_id(self, commit_nb: int) -> str:
1313
return PublicBrowserStateCache.firefox_get_commit_id(commit_nb)
1414

15-
@Cache.cache_in_db('web_browser', 'firefox')
15+
# @Cache.cache_in_db('web_browser', 'firefox')
1616
def find_commit_nb_of_release(self, release_version: int) -> int:
1717
return PublicBrowserStateCache.get_release_commit_nb('firefox', release_version)
1818

19-
@Cache.cache_in_db('web_browser', 'firefox')
19+
# @Cache.cache_in_db('web_browser', 'firefox')
2020
def find_commit_id_of_release(self, release_version: int) -> str:
2121
return PublicBrowserStateCache.get_release_commit_id('firefox', release_version)
2222

@@ -36,7 +36,9 @@ def get_release_executable_download_urls(self, major_version: int) -> list[str]:
3636
def get_commit_url(self, commit_nb: int, commit_id: str) -> str:
3737
return f'https://hg.mozilla.org/releases/mozilla-release/rev/{commit_id}'
3838

39-
@Cache.cache_in_db('web_browser', 'firefox')
39+
# We don't cache this for firefox, since it is implicitly caches by PublicBrowserStateCache.
40+
# If we would, negative results for future executables remain stored even after the executable becomes available.
41+
# @Cache.cache_in_db('web_browser', 'firefox')
4042
def has_public_commit_executable(self, commit_nb: int) -> bool:
4143
return PublicBrowserStateCache.firefox_has_executable_for(commit_nb=commit_nb)
4244

bughog/subject/web_browser/state_cache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def safe_request_json_and_update(collection_name: str, transform=lambda x: x):
2727
logger.error(f"Could not update commit cache for {collection_name}", exc_info=True)
2828

2929
executor = ThreadPoolExecutor()
30-
executor.submit(safe_request_json_and_update, "firefox_executable_availability", transform=lambda x: list(x.values()))
30+
executor.submit(safe_request_json_and_update, "firefox_binary_availability", transform=lambda x: list(x.values()))
3131
executor.submit(safe_request_json_and_update, "firefox_release_base_revs")
3232
executor.submit(safe_request_json_and_update, "chromium_release_base_revs")
3333
executor.shutdown(wait=False)

0 commit comments

Comments
 (0)