Compare commits

...

2 Commits

Author SHA1 Message Date
Marvin Pohl
de9d594758 Check if we are actually the repo for the specified build when PR info is in the request 2021-07-05 13:17:29 +02:00
Marvin Pohl
8decb35652 Use the HEAD sha, when reporting a PR issue 2021-07-05 13:16:15 +02:00
2 changed files with 3 additions and 2 deletions

View File

@ -168,6 +168,7 @@ class GiteaStatusPush(http.ReporterBase):
if 'pr_id' in props: if 'pr_id' in props:
repository_name = props['head_reponame'] repository_name = props['head_reponame']
repository_owner = props['head_owner'] repository_owner = props['head_owner']
sha = props['head_sha']
elif 'repository_name' in props: elif 'repository_name' in props:
repository_name = props['repository_name'] repository_name = props['repository_name']
else: else:

View File

@ -17,7 +17,7 @@ class Gitea(Git):
@defer.inlineCallbacks @defer.inlineCallbacks
def _fetch(self, arg): def _fetch(self, arg):
res = yield super(Gitea, self)._fetch(arg) res = yield super(Gitea, self)._fetch(arg)
if self.build.hasProperty("pr_id"): if self.build.hasProperty("pr_id") and self.repourl == self.build.getProperty("base_git_ssh_url", None):
remote = yield self._dovccmd( remote = yield self._dovccmd(
['config', 'remote.pr_source.url'], collectStdout=True, abandonOnFailure=False) ['config', 'remote.pr_source.url'], collectStdout=True, abandonOnFailure=False)
if remote is None or remote.strip() is '': if remote is None or remote.strip() is '':