From a7d7763d996e299344500106167e73235449b53c Mon Sep 17 00:00:00 2001 From: Camila Moura Date: Mon, 4 Mar 2019 17:06:41 +0100 Subject: [PATCH] Creates the tag with project name and priority This patch adds to the migration script the feature to use the priority field from "Launchpad task" to create a tag to the "Storyboard's Story". So, this tag will be prefixed with the project and followed by the task priority. Ex: project_name-priority, manila-high Change-Id: I6664a9ca0cdb9fbe265e0f18ab3ae8f879475466 Task: 28146 --- storyboard/migrate/launchpad/writer.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/storyboard/migrate/launchpad/writer.py b/storyboard/migrate/launchpad/writer.py index a6eafc91..74960170 100644 --- a/storyboard/migrate/launchpad/writer.py +++ b/storyboard/migrate/launchpad/writer.py @@ -66,6 +66,11 @@ class LaunchpadWriter(object): one first." % (project_name)) sys.exit(1) + def build_priority_tag(self, priority): + """Writes in the tag, the project name, and your priority.""" + priority_tag = '{}-{}'.format(self.project.name, priority) + return self.build_tag(priority_tag) + def write_tags(self, bug): """Extracts the tags from a launchpad bug, seeds/loads them in the StoryBoard database, and returns a list of the corresponding entities. @@ -227,6 +232,9 @@ class LaunchpadWriter(object): title = title[:97] + '...' description = bug.title + '\n\n' + description + # Create priority tag + tags.append(self.build_priority_tag(priority)) + # Sanity check. story = { 'id': launchpad_id,