From d3c0b324b3087f7e8433610d51c3fce9c69519b2 Mon Sep 17 00:00:00 2001 From: Vivek Anand Date: Sep 27 2016 17:25:59 +0000 Subject: [PATCH 1/2] update model to include milestone in issues --- diff --git a/pagure_importer/utils/models.py b/pagure_importer/utils/models.py index 1e18710..77f9add 100644 --- a/pagure_importer/utils/models.py +++ b/pagure_importer/utils/models.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -import json import uuid @@ -9,7 +8,7 @@ class Issue(): def __init__( self, id, title, content, status, date_created, user, private, attachment, tags, - depends, blocks, assignee, comments=None): + depends, blocks, assignee, comments=None, milestone=None): self.id = id self.title = title @@ -25,6 +24,7 @@ class Issue(): self.assignee = assignee self.comments = comments self.uid = uuid.uuid4().hex + self.milestone = milestone def to_json(self): ''' Returns a dictionary representation of the issue. @@ -42,7 +42,8 @@ class Issue(): 'depends': self.depends, 'blocks': self.blocks, 'assignee': self.assignee, - 'comments': self.comments + 'comments': self.comments, + 'milestone': self.milestone } return output From da68db10414ea4bb6aa70e43d39d3b0cc264fde8 Mon Sep 17 00:00:00 2001 From: Vivek Anand Date: Sep 27 2016 18:52:42 +0000 Subject: [PATCH 2/2] Add milestone support in github importer --- diff --git a/pagure_importer/utils/importer_github.py b/pagure_importer/utils/importer_github.py index d699166..e4fe435 100644 --- a/pagure_importer/utils/importer_github.py +++ b/pagure_importer/utils/importer_github.py @@ -57,6 +57,9 @@ class GithubImporter(): else: pagure_issue_tags = [] + pagure_issue_milestone = github_issue.milestone.title \ + if github_issue.milestone else None + # few things not supported by github pagure_issue_depends = [] pagure_issue_blocks = [] @@ -80,7 +83,8 @@ class GithubImporter(): tags=pagure_issue_tags, depends=pagure_issue_depends, blocks=pagure_issue_blocks, - assignee=pagure_issue_assignee) + assignee=pagure_issue_assignee, + milestone=pagure_issue_milestone) # comments on the issue comments = []