diff options
author | Magnus Granberg <zorry@gentoo.org> | 2024-01-06 23:27:24 +0100 |
---|---|---|
committer | Magnus Granberg <zorry@gentoo.org> | 2024-01-06 23:27:24 +0100 |
commit | eb2f05efcf0392a17894233de29b5c3ede8e1b43 (patch) | |
tree | 844dad5f3285a0e2de8083d3bae14a385662f134 | |
parent | Clean build and changes in db (diff) | |
download | tinderbox-cluster-eb2f05efcf0392a17894233de29b5c3ede8e1b43.tar.gz tinderbox-cluster-eb2f05efcf0392a17894233de29b5c3ede8e1b43.tar.bz2 tinderbox-cluster-eb2f05efcf0392a17894233de29b5c3ede8e1b43.zip |
Add getGitlabContext to Gitlab status
Signed-off-by: Magnus Granberg <zorry@gentoo.org>
-rw-r--r-- | buildbot_gentoo_ci/config/reporters.py | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/buildbot_gentoo_ci/config/reporters.py b/buildbot_gentoo_ci/config/reporters.py index 54472b0..ede9178 100644 --- a/buildbot_gentoo_ci/config/reporters.py +++ b/buildbot_gentoo_ci/config/reporters.py @@ -1,6 +1,8 @@ # Copyright 2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 +from twisted.internet import defer + from buildbot.plugins import util from buildbot.reporters.gitlab import GitLabStatusPush from buildbot.reporters.generators.build import BuildStatusGenerator, BuildStartEndStatusGenerator @@ -42,9 +44,24 @@ irc_reporter = irc.IRCStatusPush("irc.libera.chat", "gci_test", noticeOnChannel=True ) #gitlab +@util.renderer +@defer.inlineCallbacks +def getGitlabContext(props): + context = None + gentooci = props.master.namedServices['services'].namedServices['gentooci'] + if props.getProperty('buildername') == 'update_v_data': + context = 'Update database and check ebuild' + if props.getProperty('buildername') == 'run_build_request': + project_data = yield gentooci.db.projects.getProjectByUuid(props.getProperty('project_uuid')) + context = f"Project/{project_data['description']}/Build" + if props.getProperty('buildername') == 'parse_build_log': + project_data = yield gentooci.db.projects.getProjectByUuid(props.getProperty('project_build_data')['project_uuid']) + context = f"Project/{project_data['description']}/Check Log" + return context def gitlabGenerators(): builders = [ - #'run_build_request', + 'update_v_data', + 'run_build_request', 'parse_build_log' ] return [ @@ -53,7 +70,7 @@ def gitlabGenerators(): ) ] gitlab_gentoo_org = GitLabStatusPush(token=util.Secret("gitlabToken"), - #context= util.Interpolate('Buildbot %(prop:buildername)s'), + context= getGitlabContext, baseURL='https://gitlab.gentoo.org', generators=gitlabGenerators(), #debug=True, |