# Add it to the next repository
await next_repo.add_build(build=self, user=user)
- ## Bugs
-
- @lazy_property
- async def bug_ids(self):
- rows = await self.db.query("""
- SELECT
- bug_id
- FROM
- build_bugs
- WHERE
- build_id = %s
- AND
- removed_at IS NULL
- ORDER BY
- bug_id
- """, self.id,
- )
-
- return set([row.bug_id for row in rows])
+ # Bugs
async def _find_bug(self, bug_id):
"""
"""
Fetch all bugs from Bugzilla
"""
- return await self.backend.bugzilla.get_bugs(self.bug_ids)
+ stmt = (
+ sqlalchemy
+ .select(
+ BuildBug.bug_id,
+ )
+ .where(
+ BuildBug.build == self,
+ BuildBug.removed_at == None,
+ )
+ )
+
+ # Fetch all bug IDs
+ bug_ids = [b.bug_id async for b in self.db.select(stmt)]
+
+ # Fetch the bugs from Bugzilla
+ return await self.backend.bugzilla.get_bugs(bug_ids)
# Monitoring Release
if not build:
raise tornado.web.HTTPError(404, "Could not find build %s" % uuid)
- # Fetch any fixed Bugs
- bugs = [] # XXX await build.get_bugs()
-
- await self.render("builds/show.html", build=build, pkg=build.pkg,
- distro=build.distro, bugs=bugs)
+ await self.render("builds/show.html", build=build,
+ pkg=build.pkg, distro=build.distro)
class ApproveHandler(base.BaseHandler):