From 53f3407fd52307730fc00c3636a10c9ed0f314aa Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Mon, 17 Feb 2025 11:45:16 +0000 Subject: [PATCH] builds: Add all watchers of a scratch build to the test builds Signed-off-by: Michael Tremer --- src/buildservice/builds.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/buildservice/builds.py b/src/buildservice/builds.py index ab518c35..2f06a3ce 100644 --- a/src/buildservice/builds.py +++ b/src/buildservice/builds.py @@ -1201,6 +1201,9 @@ class Build(database.Base, database.BackendMixin, database.SoftDeleteMixin): if not builds: return + # Fetch all watchers + watchers = await self.get_watchers() + # Create a build group for all tests group = await self.backend.builds.create_group( owner = self.owner, @@ -1212,7 +1215,7 @@ class Build(database.Base, database.BackendMixin, database.SoftDeleteMixin): build = max(builds[name]) # Create a new test build - await self.backend.builds.create( + build = await self.backend.builds.create( # Use the same build repository repo = self.repo, package = build.pkg, @@ -1221,6 +1224,10 @@ class Build(database.Base, database.BackendMixin, database.SoftDeleteMixin): test = True, ) + # Add all watchers of the build to the test builds + for watcher in watchers: + await build.add_watcher(watcher.user) + # Return the group return group -- 2.47.3