From: Michael Tremer Date: Mon, 17 Feb 2025 11:45:16 +0000 (+0000) Subject: builds: Add all watchers of a scratch build to the test builds X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=53f3407fd52307730fc00c3636a10c9ed0f314aa;p=pbs.git builds: Add all watchers of a scratch build to the test builds Signed-off-by: Michael Tremer --- 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