#64 Include contributors and groups in the people watching bugs in bugzilla
Merged 6 years ago by pingou. Opened 6 years ago by pingou.

file modified
+34 -1
@@ -68,8 +68,41 @@ 

          namespace, package, admin = entry

          output[namespace][package] = set([admin])

  

-     # Add the explicit watchers

+     # Add the contributors

+     query = session.query(

+         model.Project.namespace, model.Project.name, model.User.user,

+     ).filter(

+         model.Project.id == model.ProjectUser.project_id

+     ).filter(

+         model.ProjectUser.user_id == model.User.id

+     ).filter(

+         model.Project.parent_id == None

+     ).filter(

+         model.Project.is_fork == False

+     )

+ 

+     for entry in query.all():

+         namespace, package, contributor = entry

+         output[namespace][package].add(contributor)

+ 

+     # Add groups

+     query = session.query(

+         model.Project.namespace, model.Project.name, model.PagureGroup.group_name,

+     ).filter(

+         model.Project.id == model.ProjectGroup.project_id

+     ).filter(

+         model.ProjectGroup.group_id == model.PagureGroup.id

+     ).filter(

+         model.Project.parent_id == None

+     ).filter(

+         model.Project.is_fork == False

+     )

+ 

+     for entry in query.all():

+         namespace, package, group = entry

+         output[namespace][package].add('@%s' % group)

  

+     # Add or remove the watchers depending on their settings

      query = session.query(

          model.Project.namespace, model.Project.name, model.User.user,

          model.Watcher.watch_issues,

Basically we were only including the POC and people who set their watch
access correctly, but contributors are supposed to be looking at issues
by default, they can then opt-out using 'unwatch'.
Groups were simply entirely ignored while they are present also in the
list of watchers.

Signed-off-by: Pierre-Yves Chibon pingou@pingoured.fr

Pull-Request has been merged by pingou

6 years ago
Metadata