From patchwork Thu Nov 23 17:07:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Bader X-Patchwork-Id: 840842 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 3yjQk64bv0z9s5L; Fri, 24 Nov 2017 04:07:42 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1eHuyN-0006Yx-Eq; Thu, 23 Nov 2017 17:07:35 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1eHuyM-0006Xr-7I for kernel-team@lists.ubuntu.com; Thu, 23 Nov 2017 17:07:34 +0000 Received: from 1.general.smb.uk.vpn ([10.172.193.28] helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1eHuyL-0004ow-UV for kernel-team@lists.ubuntu.com; Thu, 23 Nov 2017 17:07:34 +0000 From: Stefan Bader To: kernel-team@lists.ubuntu.com Subject: [kteam-tools] stable/create-sru-cards: Use kernel info for crank list Date: Thu, 23 Nov 2017 18:07:33 +0100 Message-Id: <1511456853-18403-1-git-send-email-stefan.bader@canonical.com> X-Mailer: git-send-email 2.7.4 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" Switches from a separate config list to the common kernel info file for obtaining a list of kernels to crank. Drops the old list and the additional special card for Euclid. Also adds a --dry-run option for testing. Signed-off-by: Stefan Bader Acked-by: Andy Whitcroft --- stable/create-sru-cards.py | 72 ++++++++++++++++++++++++++++++++++++++------ stable/create-sru-cards.yaml | 20 ------------ 2 files changed, 63 insertions(+), 29 deletions(-) diff --git a/stable/create-sru-cards.py b/stable/create-sru-cards.py index 02962cb..7c0ffde 100755 --- a/stable/create-sru-cards.py +++ b/stable/create-sru-cards.py @@ -4,8 +4,8 @@ import argparse import os # the so-trello root dir needs to be on PYTHONPATH -from trellotool.trellotool import TrelloTool - +from trellotool.trellotool import TrelloTool +from ktl.ubuntu import Ubuntu class TrelloError(Exception): pass @@ -112,19 +112,65 @@ class SRUCardsCreator: with open(self.config_file, 'r') as cfd: self.config = yaml.safe_load(cfd) - def create(self): + def get_crankturn_cards(self): + cardlist = [] + ubuntu = Ubuntu() + + esm_desc = 'No rebase to be done. Only needed if there are high and critical CVEs to be fixed.' + + for series in sorted(ubuntu.index_by_series_name, reverse=True): + record = ubuntu.index_by_series_name[series] + if record['supported']: + desc = None + if ('esm' in record) and record['esm']: + desc = 'ESM mode: Note different git location and build PPA' + cardlist.append(('%s/linux' % (series), desc)) + + if 'derivative-packages' in record: + for package in record['derivative-packages']: + for derivative in record['derivative-packages'][package]: + if derivative == 'linux-euclid': + cardlist.append(('%s/%s' % (series, derivative), esm_desc)) + else: + cardlist.append(('%s/%s' % (series, derivative), desc)) + + for entry in ubuntu.db.values(): + if 'backport-packages' in entry: + for bp in entry['backport-packages']: + if record['series_version'] == entry['backport-packages'][bp][1]: + desc = '' + if ('esm' in entry['name']) and entry['name']['esm']: + desc = 'ESM mode: Note different git location and build PPA' + cardlist.append(('%s/%s' % (entry['name'], bp), desc)) + + return cardlist + + def create(self, dryrun): """ Create the board, the lists and the cards form the config file :return: None """ # create the board with the lists on the organization - board = SRUBoard(self.tt, self.config['board']['prefix_name'] + self.cycle) - board.create(self.config['board']['trello_organization']) - board.add_lists(self.config['board']['lists'], self.config['board']['default_list']) + if dryrun: + print('Create board: %s' % (self.config['board']['prefix_name'] + self.cycle)) + else: + board = SRUBoard(self.tt, self.config['board']['prefix_name'] + self.cycle) + board.create(self.config['board']['trello_organization']) + board.add_lists(self.config['board']['lists'], self.config['board']['default_list']) # add the cards to the board, under the default list for card in self.config['cards']: + if card['name'] == 'Turn the crank': + for (card_name, card_desc) in self.get_crankturn_cards(): + if dryrun: + print('Adding card: %s' % (card_name)) + if card_desc: + print(' %s' % (card_desc)) + else: + board.add_card(card_name, card_desc) + continue + card_names = [] if 'suffixes' in card: for suffix in card['suffixes']: @@ -137,15 +183,23 @@ class SRUCardsCreator: card_desc = card['description'] for card_name in card_names: - board.add_card(card_name, card_desc) + if dryrun: + print('Adding card: %s' % (card_name)) + if card_desc: + print(' %s' % (card_desc)) + else: + board.add_card(card_name, card_desc) - print("Board '%s' created: %s" % (board.name, board.url)) + if not dryrun: + print("Board '%s' created: %s" % (board.name, board.url)) if __name__ == '__main__': parser = argparse.ArgumentParser(description='cli tool to create trello cards for SRU cycles') parser.add_argument('cycle', metavar='CYCLE', help='cycle tag', action='store') parser.add_argument('--config', metavar='CONFIG', help='config yaml file', required=False, action='store', default='%s/create-sru-cards.yaml' % os.path.dirname(__file__)) + parser.add_argument('--dry-run', help='only print steps, no action done', required=False, + action='store_true', default=False) args = parser.parse_args() - SRUCardsCreator(args.config, args.cycle).create() + SRUCardsCreator(args.config, args.cycle).create(args.dry_run) diff --git a/stable/create-sru-cards.yaml b/stable/create-sru-cards.yaml index 9cade7d..09d1260 100644 --- a/stable/create-sru-cards.yaml +++ b/stable/create-sru-cards.yaml @@ -13,26 +13,6 @@ - name: 'Apply patches from the ML' - name: 'Create tracking bugs' - name: 'Turn the crank' - suffixes: - - 'precise/lts-trusty' - - 'trusty' - - 'trusty/aws' - - 'trusty/lts-xenial' - - 'xenial' - - 'xenial/raspi2' - - 'xenial/snapdragon' - - 'xenial/hwe' - - 'xenial/hwe-edge' - - 'xenial/aws' - - 'xenial/gke' - - 'xenial/gcp' - - 'xenial/azure' - - 'xenial/kvm' - - 'zesty' - - 'zesty/raspi2' - - 'artful' - - name: 'Turn the crank - Intel Euclid' - description: 'No rebase to be done. Only needed if there are high and critical CVEs to be fixed.' - name: 'SRU -proposed announcement' description: 'Send the SRU announcement to the ML' - name: 'SRU bug spamming'