allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jetm...@apache.org
Subject [06/16] git commit: [#7510] saved_bins bugfix, fixed milestone detection
Date Fri, 25 Jul 2014 11:09:16 GMT
[#7510] saved_bins bugfix, fixed milestone detection


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

Branch: refs/heads/je/42cc_7524
Commit: 9a1ea57cdf64e34dfc1001d015597fcea195f3b7
Parents: eed1a39
Author: Alexander Luberg <aluberg@slashdotmedia.com>
Authored: Mon Jul 21 19:02:46 2014 +0000
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Tue Jul 22 16:28:08 2014 +0000

----------------------------------------------------------------------
 Allura/allura/tasks/index_tasks.py           | 2 +-
 scripts/prepare-allura-tickets-for-import.py | 9 +++++----
 2 files changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/9a1ea57c/Allura/allura/tasks/index_tasks.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tasks/index_tasks.py b/Allura/allura/tasks/index_tasks.py
index 2248855..3f02cef 100644
--- a/Allura/allura/tasks/index_tasks.py
+++ b/Allura/allura/tasks/index_tasks.py
@@ -73,7 +73,7 @@ def add_artifacts(ref_ids, update_solr=True, update_refs=True, solr_hosts=None):
         for ref in M.ArtifactReference.query.find(dict(_id={'$in': ref_ids})):
             try:
                 artifact = ref.artifact
-                if not artifact:
+                if artifact is None:
                     continue
                 s = artifact.solarize()
                 if s is None:

http://git-wip-us.apache.org/repos/asf/allura/blob/9a1ea57c/scripts/prepare-allura-tickets-for-import.py
----------------------------------------------------------------------
diff --git a/scripts/prepare-allura-tickets-for-import.py b/scripts/prepare-allura-tickets-for-import.py
index f1812ed..16dd662 100644
--- a/scripts/prepare-allura-tickets-for-import.py
+++ b/scripts/prepare-allura-tickets-for-import.py
@@ -3,6 +3,7 @@ from itertools import tee, izip, chain
 import json
 import git
 from collections import Counter
+from random import randint
 
 
 filename = "/var/local/allura/tickets.json"  # Absolute path to exported tickets.json
@@ -13,8 +14,6 @@ gitrepository = "/var/local/allura"  # Path to allura repository
 g = git.Git(gitrepository)
 
 reviews = ['code-review', 'design-review']
-backlog = ['open', 'in-progress', 'validation', 'review', 'blocked']
-released = ['closed', 'wont-fix', 'invalid']
 
 with open(filename, 'r') as json_file:
     data = json.loads(json_file.read())
@@ -53,9 +52,9 @@ for ticket in tickets:
 
         milestone = ticket_tag.get(ticket['ticket_num'], None)
         if not milestone:
-            if ticket['status'] in released:
+            if ticket['status'] == 'closed':
                 milestone = tags[0]
-        ticket['custom_fields']['_milestone'] = milestone if milestone != 'HEAD' else 'unreleased'
+        ticket['custom_fields']['_milestone'] = milestone if milestone and milestone != 'HEAD'
else 'unreleased'
         if '_size' in ticket['custom_fields'].keys():
             size = ticket['custom_fields']['_size']
             if size:
@@ -98,6 +97,8 @@ data['custom_fields'].append({
     "options": "",
     "name": "_reviewer"
 })
+data['milestones'] = milestones
+data['saved_bins'] = []
 
 # Count top used usernames
 


Mime
View raw message