Merge "Make gitea description update failures nonfatal"

This commit is contained in:
Zuul 2020-10-05 17:58:13 +00:00 committed by Gerrit Code Review
commit 30cd357408

View File

@ -210,12 +210,19 @@ class Gitea(object):
description_update = { description_update = {
'description': description, 'description': description,
} }
try:
resp = self.patch( resp = self.patch(
'/api/v1/repos/{org}/{repo}'.format(org=org, repo=repo), '/api/v1/repos/{org}/{repo}'.format(org=org, repo=repo),
json=description_update) json=description_update)
# Commented out as there is no good way to log only those projects # Commented out as there is no good way to log only those
# which have an updated description and as a result this is noisy. # projects which have an updated description and as a result
# this is noisy.
#self.log("Set description for:", project['project']) #self.log("Set description for:", project['project'])
except Exception as e:
# Updating descriptions is best effort as we may fail due to
# gitea bugs, but such a failure isn't critical.
self.log("Failed to set desciption for:",
project['project'], str(e))
def make_projects(self, projects, gitea_repos, csrf_token, def make_projects(self, projects, gitea_repos, csrf_token,
settings_thread_pool, branches_thread_pool, futures): settings_thread_pool, branches_thread_pool, futures):