def extract(self, url, revision): logger.info("extracting missing resultsets: {0}".format(url)) response = requests.get(url, timeout=settings.TREEHERDER_REQUESTS_TIMEOUT) if response.status_code == 404: # we will sometimes get here because builds4hr/pending/running have a # job with a resultset that json-pushes doesn't know about. So far # I have only found this to be the case when it uses a revision from # the wrong repo. For example: mozilla-central, but l10n. The l10n # is a separate repo, but buildbot shows it as the same. So we # create this dummy resultset with ``active_status`` of ``onhold``. # # The effect of this is that we won't keep trying to re-fetch # the bogus pushlog, but the jobs are (correctly) not shown in the # UI, since they're bad data. logger.warn(("no pushlog in json-pushes. generating a dummy" " onhold placeholder: {0}").format(url)) # we want to make a "dummy" resultset that is "onhold", # because json-pushes doesn't know about it. # This is, in effect, what TBPL does. # These won't show in the UI, because they only fetch "active" # resultsets return get_not_found_onhold_push(url, revision) else: try: response.raise_for_status() except requests.exceptions.HTTPError: logger.warning("HTTPError %s fetching: %s", response.status_code, url) raise return response.json()
def extract(self, url, revision): logger.info("extracting missing resultsets: {0}".format(url)) response = requests.get(url, timeout=settings.TREEHERDER_REQUESTS_TIMEOUT) if response.status_code == 404: # we will sometimes get here because builds4hr/pending/running have a # job with a resultset that json-pushes doesn't know about. So far # I have only found this to be the case when it uses a revision from # the wrong repo. For example: mozilla-central, but l10n. The l10n # is a separate repo, but buildbot shows it as the same. So we # create this dummy resultset with ``active_status`` of ``onhold``. # # The effect of this is that we won't keep trying to re-fetch # the bogus pushlog, but the jobs are (correctly) not shown in the # UI, since they're bad data. logger.warn(("no pushlog in json-pushes. generating a dummy" " onhold placeholder: {0}").format(url)) # we want to make a "dummy" resultset that is "onhold", # because json-pushes doesn't know about it. # This is, in effect, what TBPL does. # These won't show in the UI, because they only fetch "active" # resultsets return get_not_found_onhold_push(url, revision) else: response.raise_for_status() return response.json()