incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [04/20] git commit: [#6541] Added import_id for GC tracker importer
Date Tue, 10 Sep 2013 15:11:05 GMT
[#6541] Added import_id for GC tracker importer

Signed-off-by: Cory Johns <cjohns@slashdotmedia.com>


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/c3d8491e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/c3d8491e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/c3d8491e

Branch: refs/heads/cj/6540
Commit: c3d8491eaca5562414ae42a4fd2819b671920b6d
Parents: f190769
Author: Cory Johns <cjohns@slashdotmedia.com>
Authored: Mon Aug 26 21:48:36 2013 +0000
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Mon Sep 9 20:27:29 2013 +0000

----------------------------------------------------------------------
 ForgeImporters/forgeimporters/google/tracker.py                | 4 +++-
 .../forgeimporters/tests/google/functional/test_tracker.py     | 6 ++++++
 ForgeImporters/forgeimporters/tests/google/test_tracker.py     | 1 +
 3 files changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c3d8491e/ForgeImporters/forgeimporters/google/tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/google/tracker.py b/ForgeImporters/forgeimporters/google/tracker.py
index 40dd939..eebdae0 100644
--- a/ForgeImporters/forgeimporters/google/tracker.py
+++ b/ForgeImporters/forgeimporters/google/tracker.py
@@ -116,6 +116,7 @@ class GoogleCodeTrackerImporter(ToolImporter):
                 EnableVoting=True,
                 open_status_names='New Accepted Started',
                 closed_status_names='Fixed Verified Invalid Duplicate WontFix Done',
+                import_id='%s/%s/issues' % (self.source, project_name),
             )
         ThreadLocalORMSession.flush_all()
         try:
@@ -126,7 +127,8 @@ class GoogleCodeTrackerImporter(ToolImporter):
                     ticket = TM.Ticket(
                         app_config_id=app.config._id,
                         custom_fields=dict(),
-                        ticket_num=ticket_num)
+                        ticket_num=ticket_num,
+                        import_id='%s/%s' % (app.config.options.import_id, ticket_num))
                     self.process_fields(ticket, issue)
                     self.process_labels(ticket, issue)
                     self.process_comments(ticket, issue)

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c3d8491e/ForgeImporters/forgeimporters/tests/google/functional/test_tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/tests/google/functional/test_tracker.py b/ForgeImporters/forgeimporters/tests/google/functional/test_tracker.py
index 24081d9..0bd97ab 100644
--- a/ForgeImporters/forgeimporters/tests/google/functional/test_tracker.py
+++ b/ForgeImporters/forgeimporters/tests/google/functional/test_tracker.py
@@ -140,6 +140,12 @@ class TestGCTrackerImporter(TestCase):
         self.assertEqual(ticket.votes_up, 1)
         self.assertEqual(ticket.votes, 1)
 
+    def test_import_id(self):
+        ticket = self._make_ticket(self.test_issue, issue_id=6)
+        self.assertEqual(ticket.app.config.options.import_id, 'Google Code/test-issue-project/issues')
+        self.assertEqual(ticket.ticket_num, 6)
+        self.assertEqual(ticket.import_id, 'Google Code/test-issue-project/issues/6')
+
     @skipif(module_not_available('html2text'))
     def test_html2text_escaping(self):
         ticket = self._make_ticket(self.test_issue)

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c3d8491e/ForgeImporters/forgeimporters/tests/google/test_tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/tests/google/test_tracker.py b/ForgeImporters/forgeimporters/tests/google/test_tracker.py
index 5bbf836..d2cedc6 100644
--- a/ForgeImporters/forgeimporters/tests/google/test_tracker.py
+++ b/ForgeImporters/forgeimporters/tests/google/test_tracker.py
@@ -52,6 +52,7 @@ class TestTrackerImporter(TestCase):
                 EnableVoting=True,
                 open_status_names='New Accepted Started',
                 closed_status_names='Fixed Verified Invalid Duplicate WontFix Done',
+                import_id='Google Code/project_name/issues',
             )
         gpe.iter_issues.assert_called_once_with('project_name')
         self.assertEqual(importer.process_fields.call_args_list, [


Mime
View raw message