aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Granberg <zorry@gentoo.org>2024-03-03 08:53:29 +0100
committerMagnus Granberg <zorry@gentoo.org>2024-03-03 08:53:29 +0100
commitd8186f7796fbd57c68beafeb53978d3a2d20fc23 (patch)
tree001bcc8c71dabf187dfa8f2b8082ae902b0b5a87 /buildbot_gentoo_ci/db/projects.py
parentMake emails dict for bugreports (diff)
downloadtinderbox-cluster-d8186f7796fbd57c68beafeb53978d3a2d20fc23.tar.gz
tinderbox-cluster-d8186f7796fbd57c68beafeb53978d3a2d20fc23.tar.bz2
tinderbox-cluster-d8186f7796fbd57c68beafeb53978d3a2d20fc23.zip
Add bugsettings to project
Signed-off-by: Magnus Granberg <zorry@gentoo.org>
Diffstat (limited to 'buildbot_gentoo_ci/db/projects.py')
-rw-r--r--buildbot_gentoo_ci/db/projects.py41
1 files changed, 40 insertions, 1 deletions
diff --git a/buildbot_gentoo_ci/db/projects.py b/buildbot_gentoo_ci/db/projects.py
index 7ffac97..23cabde 100644
--- a/buildbot_gentoo_ci/db/projects.py
+++ b/buildbot_gentoo_ci/db/projects.py
@@ -80,6 +80,21 @@ class ProjectsConnectorComponent(base.DBConnectorComponent):
return res
@defer.inlineCallbacks
+ def getRepositorySettingByProjUuidAndRepoUuid(self, project_uuid, repository_uuid):
+ def thd(conn):
+ tbl = self.db.model.projects_repositorys
+ q = tbl.select()
+ q = q.where(tbl.c.project_uuid == project_uuid)
+ q = q.where(tbl.c.repository_uuid == repository_uuid)
+ res = conn.execute(q)
+ row = res.fetchone()
+ if not row:
+ return None
+ return self._row2dict_projects_repositorys(conn, row)
+ res = yield self.db.pool.do(thd)
+ return res
+
+ @defer.inlineCallbacks
def getRepositorysByProjectUuid(self, uuid, auto=True):
def thd(conn):
tbl = self.db.model.projects_repositorys
@@ -212,6 +227,20 @@ class ProjectsConnectorComponent(base.DBConnectorComponent):
res = yield self.db.pool.do(thd)
return res
+ @defer.inlineCallbacks
+ def getBugsSettingsByProjectUuid(self, uuid):
+ def thd(conn):
+ tbl = self.db.model.projects_bugs
+ q = tbl.select()
+ q = q.where(tbl.c.project_uuid == uuid)
+ res = conn.execute(q)
+ row = res.fetchone()
+ if not row:
+ return None
+ return self._row2dict_projects_bugs(conn, row)
+ res = yield self.db.pool.do(thd)
+ return res
+
def _row2dict(self, conn, row):
return dict(
uuid=row.uuid,
@@ -243,7 +272,8 @@ class ProjectsConnectorComponent(base.DBConnectorComponent):
pkgcheck=pkgcheck,
build=row.build,
test=row.test,
- test_mr=row.test_mr
+ test_mr=row.test_mr,
+ bug=row.bug
)
def _row2dict_projects_workers(self, conn, row):
@@ -312,3 +342,12 @@ class ProjectsConnectorComponent(base.DBConnectorComponent):
status=row.status,
type=row.type
)
+
+ def _row2dict_projects_bugs(self, conn, row):
+ return dict(
+ id=row.id,
+ project_uuid=row.project_uuid,
+ enabled=row.enabled,
+ auto_assigne=row.auto_assigne,
+ extra_summery=row.extra_summery
+ )