]> git.ipfire.org Git - pbs.git/commitdiff
builds: Add dummy function to add watchers
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 13 Oct 2022 09:31:01 +0000 (09:31 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 13 Oct 2022 09:31:01 +0000 (09:31 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/buildservice/builds.py

index d5bfde28750668c1c5d67edc2968fb84d04fcd0e..7a0c45503cc5a484d1ad7e08b9025094b1e95eb5 100644 (file)
@@ -183,6 +183,9 @@ class Builds(base.Object):
 
                # XXX obsolete other builds
 
+               # Add watchers
+               build._add_watchers()
+
                return build
 
        async def create_from_source_package(self, filename, distro, commit=None, type="release",
@@ -615,6 +618,18 @@ class Build(base.DataObject):
                # Remove from cache
                self.watchers.remove(user)
 
+       def _add_watchers(self):
+               """
+                       Called when a new build is created and automatically adds any watchers
+               """
+               # Add the owner of the build (if any)
+               if self.owner:
+                       self.add_watcher(self.owner)
+
+               # XXX extract any watchers from the commit message (if any)
+
+               # XXX add any permanent watchers
+
        @property
        def message_recipients(self):
                ret = []