diff --git a/apis/taskcluster.py b/apis/taskcluster.py index 2eabc5d..eb2ac8c 100644 --- a/apis/taskcluster.py +++ b/apis/taskcluster.py @@ -323,6 +323,7 @@ def _get_job_details_url(self, push_id): return self.url_treeherder + "api/jobs/?push_id=%s" % push_id @logEntryExit + @retry def get_job_details(self, revision): push_list_url = self._get_push_list_url(revision) self.logger.log("Requesting revision %s from %s" % (revision, push_list_url), level=LogLevel.Info) @@ -379,6 +380,7 @@ def _get_push_health_url(self, revision): return self.url_treeherder + "api/%spush/health/?revision=%s" % (self.url_project_path, revision) @logEntryExit + @retry def get_push_health(self, revision): push_health_url = self._get_push_health_url(revision) self.logger.log("Requesting push health for revision %s from %s" % (revision, push_health_url), level=LogLevel.Info) diff --git a/components/mach_vendor.py b/components/mach_vendor.py index b1c9df3..88493dd 100644 --- a/components/mach_vendor.py +++ b/components/mach_vendor.py @@ -20,8 +20,8 @@ class VendorProvider(BaseProvider, INeedsCommandProvider, INeedsLoggingProvider) def __init__(self, config): pass - @retry @logEntryExit + @retry def check_for_update(self, library): result = self.run(["./mach", "vendor", "--check-for-update", library.yaml_path]).stdout.decode().strip() diff --git a/format.sh b/format.sh index 7c483b7..daf4f4d 100755 --- a/format.sh +++ b/format.sh @@ -2,3 +2,20 @@ poetry run autopep8 . poetry run flake8 . + +output=$(find . -type f -name '*.py' -exec awk ' + /^[ \t]*@retry[ \t]*$/ { + getline a + if (a ~ /^[ \t]*@logEntryExit[ \t]*$/) { + getline b + print FILENAME ":" + print $0 "\n" a "\n" b "\n" + } + } +' {} +) + +# Check if there was any output +if [[ -n "$output" ]]; then + echo "@retry must always be the decorator right before a function. Please fix these:" + echo "$output" +fi \ No newline at end of file