From 3f1611f6c3e499051d28378d2cbc8ec56ae6a1b9 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Sun, 14 Jun 2020 17:48:42 +0200 Subject: [PATCH] Add the possibility to ignore some users These users, who should only ever be CC'ed to a project, will not be synced to bugzilla. In other words, they are allowed to not have a bugzilla account and that should not impact the syncing of the default assignee and CC list from dist-git to bugzilla. Signed-off-by: Pierre-Yves Chibon --- .../default-config-files/configuration.toml | 3 +++ distgit_bugzilla_sync/script.py | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/distgit_bugzilla_sync/default-config-files/configuration.toml b/distgit_bugzilla_sync/default-config-files/configuration.toml index 4c3fb12..b2aa46e 100644 --- a/distgit_bugzilla_sync/default-config-files/configuration.toml +++ b/distgit_bugzilla_sync/default-config-files/configuration.toml @@ -6,6 +6,9 @@ This package has changed maintainer in the Fedora. Reassigning to the new maintainer of this component. """ +# List of accounts that should not be synced to bugzilla +ignorable_accounts = ["packagerbot", "zuul"] + [products] [products.Fedora] namespace = "rpms" diff --git a/distgit_bugzilla_sync/script.py b/distgit_bugzilla_sync/script.py index 3e5d5f6..887e9c2 100644 --- a/distgit_bugzilla_sync/script.py +++ b/distgit_bugzilla_sync/script.py @@ -987,6 +987,13 @@ class DistgitBugzillaSync: project["products_poc"] = products_poc project["products_retired"] = products_retired + # Clean up the watchers we never want to sync to bugzilla + # If these users are POC for a project, things will not work, which + # is expected/desired. + for user in (self.config.get("ignorable_accounts") or []): + if user in (project.get("watchers") or []): + project["watchers"].remove(user) + self.pagure_projects[idx] = project @classmethod