Formatting and linting fixes
This commit is contained in:
parent
0a1454d250
commit
d6bce1b39d
32 changed files with 675 additions and 268 deletions
|
@ -31,7 +31,9 @@ def setup_service(devops_env_id: str):
|
|||
|
||||
if gitea_api_token:
|
||||
log.msg("Found Gitea API token, enabling status push")
|
||||
return gitea.reporter.GiteaStatusService11(gitea_url, gitea_api_token, verbose=False)
|
||||
return gitea.reporter.GiteaStatusService11(
|
||||
gitea_url, gitea_api_token, verbose=False
|
||||
)
|
||||
else:
|
||||
log.msg("No Gitea API token found, status push disabled")
|
||||
return None
|
||||
|
|
|
@ -81,7 +81,9 @@ class GiteaStatusService11(http.ReporterBase):
|
|||
yield super().reconfigService(generators=generators, **kwargs)
|
||||
|
||||
self.context = context or Interpolate("buildbot/%(prop:buildername)s")
|
||||
self.context_pr = context_pr or Interpolate("buildbot/pull_request/%(prop:buildername)s")
|
||||
self.context_pr = context_pr or Interpolate(
|
||||
"buildbot/pull_request/%(prop:buildername)s"
|
||||
)
|
||||
if baseURL.endswith("/"):
|
||||
baseURL = baseURL[:-1]
|
||||
self.baseURL = baseURL
|
||||
|
@ -107,7 +109,14 @@ class GiteaStatusService11(http.ReporterBase):
|
|||
]
|
||||
|
||||
def createStatus(
|
||||
self, project_owner, repo_name, sha, state, target_url=None, description=None, context=None
|
||||
self,
|
||||
project_owner,
|
||||
repo_name,
|
||||
sha,
|
||||
state,
|
||||
target_url=None,
|
||||
description=None,
|
||||
context=None,
|
||||
):
|
||||
"""
|
||||
:param project_owner: username of the owning user or organization
|
||||
|
@ -164,19 +173,25 @@ class GiteaStatusService11(http.ReporterBase):
|
|||
log.msg(
|
||||
'Could not send status "{state}" for '
|
||||
"{repo} at {sha}: {code} : {message}".format(
|
||||
state=state, repo=repository_name, sha=sha, code=res.code, message=message
|
||||
state=state,
|
||||
repo=repository_name,
|
||||
sha=sha,
|
||||
code=res.code,
|
||||
message=message,
|
||||
)
|
||||
)
|
||||
elif self.verbose:
|
||||
log.msg(
|
||||
'Status "{state}" sent for '
|
||||
"{repo} at {sha}.".format(state=state, repo=repository_name, sha=sha)
|
||||
'Status "{state}" sent for ' "{repo} at {sha}.".format(
|
||||
state=state, repo=repository_name, sha=sha
|
||||
)
|
||||
)
|
||||
except Exception as e:
|
||||
log.err(
|
||||
e,
|
||||
'Failed to send status "{state}" for '
|
||||
"{repo} at {sha}".format(state=state, repo=repository_name, sha=sha),
|
||||
'Failed to send status "{state}" for ' "{repo} at {sha}".format(
|
||||
state=state, repo=repository_name, sha=sha
|
||||
),
|
||||
)
|
||||
|
||||
@defer.inlineCallbacks
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue