From c73470d7dfb5bbb7acf72566b9e260447d8e6bd0 Mon Sep 17 00:00:00 2001 From: Quan Zhou Date: Fri, 24 Jun 2022 18:32:15 +0200 Subject: [PATCH] [task_enrich] Fix git pair-programming activation This fixes when the name of the data source to enable pair-programming contains a tag like `[git:pair]`. The current behavior only works if the data source is `[git]`. Signed-off-by: Quan Zhou --- .../[git]-pair-programming-activation-fixed.yml | 8 ++++++++ sirmordred/task_enrich.py | 5 +++-- 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 releases/unreleased/[git]-pair-programming-activation-fixed.yml diff --git a/releases/unreleased/[git]-pair-programming-activation-fixed.yml b/releases/unreleased/[git]-pair-programming-activation-fixed.yml new file mode 100644 index 00000000..fe4e3912 --- /dev/null +++ b/releases/unreleased/[git]-pair-programming-activation-fixed.yml @@ -0,0 +1,8 @@ +--- +title: '[git] pair-programming activation fixed' +category: fixed +author: Quan Zhou +issue: null +notes: > + Git pair-programming can be activated if the data source + contains a tag like `[git:pair]` diff --git a/sirmordred/task_enrich.py b/sirmordred/task_enrich.py index 79c26806..7efce53c 100644 --- a/sirmordred/task_enrich.py +++ b/sirmordred/task_enrich.py @@ -129,8 +129,9 @@ def __enrich_items(self): github_token = None pair_programming = False node_regex = None - if 'git' in cfg and 'pair-programming' in cfg['git']: - pair_programming = cfg['git']['pair-programming'] + + if self.backend_section in cfg and 'pair-programming' in cfg[self.backend_section]: + pair_programming = cfg[self.backend_section]['pair-programming'] if 'jenkins' in cfg and 'node_regex' in cfg['jenkins']: node_regex = cfg['jenkins']['node_regex'] only_studies = False