You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2020/02/14 23:03:22 UTC

[allura] branch db/8348 created (now 90b03f8)

This is an automated email from the ASF dual-hosted git repository.

brondsem pushed a change to branch db/8348
in repository https://gitbox.apache.org/repos/asf/allura.git.


      at 90b03f8  [#8348] update mongo version to latest in docker files

This branch includes the following new commits:

     new 32d7299  [#8348] move aggregate() methods to use a cursor instead of result doc for compatibility with mongo 3.6
     new 90b03f8  [#8348] update mongo version to latest in docker files

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[allura] 01/02: [#8348] move aggregate() methods to use a cursor instead of result doc for compatibility with mongo 3.6

Posted by br...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

brondsem pushed a commit to branch db/8348
in repository https://gitbox.apache.org/repos/asf/allura.git

commit 32d729941e1180bd8a7af5b74b99f32b3cb795a7
Author: Dave Brondsema <da...@brondsema.net>
AuthorDate: Fri Feb 14 17:20:43 2020 -0500

    [#8348] move aggregate() methods to use a cursor instead of result doc for compatibility with mongo 3.6
---
 Allura/allura/ext/admin/admin_main.py                          | 4 ++--
 ForgeDiscussion/forgediscussion/controllers/root.py            | 2 +-
 ForgeDiscussion/forgediscussion/tests/functional/test_forum.py | 4 ++--
 ForgeTracker/forgetracker/tracker_main.py                      | 4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/Allura/allura/ext/admin/admin_main.py b/Allura/allura/ext/admin/admin_main.py
index 883c2ec..8505439 100644
--- a/Allura/allura/ext/admin/admin_main.py
+++ b/Allura/allura/ext/admin/admin_main.py
@@ -673,7 +673,7 @@ class ProjectAdminController(BaseController):
         db = M.session.project_doc_session.db
         files_id = db.attachment.find({"app_config_id": {"$in": apps_id}}).distinct("file_id")
         try:
-            total_size = db.attachment.files.aggregate([
+            total_size = list(db.attachment.files.aggregate([
                 {
                     "$match": {"_id": {"$in": files_id}}
                 },
@@ -683,7 +683,7 @@ class ProjectAdminController(BaseController):
                 {
                     "$project": {"_id": 0, "total_size": {"$divide": ["$total_size", 1000000]}}
                 }
-            ]).get('result')[0].get('total_size')
+            ], cursor={}))[0].get('total_size')
         except IndexError:
             total_size = 0
         return {
diff --git a/ForgeDiscussion/forgediscussion/controllers/root.py b/ForgeDiscussion/forgediscussion/controllers/root.py
index 1e2e6a4..caa7ce7 100644
--- a/ForgeDiscussion/forgediscussion/controllers/root.py
+++ b/ForgeDiscussion/forgediscussion/controllers/root.py
@@ -257,7 +257,7 @@ class RootController(BaseController, DispatchIndex, FeedController):
             {'$sort': {
                 '_id': pymongo.ASCENDING,
             }},
-        ])['result']
+        ], cursor={})
 
         def reformat_data(mongo_data):
             def item(day, val):
diff --git a/ForgeDiscussion/forgediscussion/tests/functional/test_forum.py b/ForgeDiscussion/forgediscussion/tests/functional/test_forum.py
index 865ed4d..8ad92f6 100644
--- a/ForgeDiscussion/forgediscussion/tests/functional/test_forum.py
+++ b/ForgeDiscussion/forgediscussion/tests/functional/test_forum.py
@@ -1024,7 +1024,7 @@ class TestForumStats(TestController):
     @mock.patch('ming.session.Session.aggregate')
     def test_stats_data(self, aggregate):
         # partial data, some days are implicit 0
-        aggregate.return_value = {'result': [
+        aggregate.return_value = iter([
             {
                 "_id": {
                     "year": 2013,
@@ -1046,7 +1046,7 @@ class TestForumStats(TestController):
                     "day": 5},
                 "posts": 2
             },
-        ]}
+        ])
         r = self.app.get(
             '/discussion/stats_data?begin=2013-01-01&end=2013-01-06')
         assert_equal(r.json, {
diff --git a/ForgeTracker/forgetracker/tracker_main.py b/ForgeTracker/forgetracker/tracker_main.py
index e433ec3..06cf18e 100644
--- a/ForgeTracker/forgetracker/tracker_main.py
+++ b/ForgeTracker/forgetracker/tracker_main.py
@@ -702,8 +702,8 @@ class RootController(BaseController, FeedController):
             {'$match': {'labels': {'$regex': '^%s' % term, '$options': 'i'}}},
             {'$group': {'_id': '$labels', 'count': {'$sum': 1}}},
             {'$sort': SON([('count', -1), ('_id', 1)])}
-        ])
-        return json.dumps([tag['_id'] for tag in tags.get('result', [])])
+        ], cursor={})
+        return json.dumps([tag['_id'] for tag in tags])
 
     @with_trailing_slash
     @h.vardec


[allura] 02/02: [#8348] update mongo version to latest in docker files

Posted by br...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

brondsem pushed a commit to branch db/8348
in repository https://gitbox.apache.org/repos/asf/allura.git

commit 90b03f84c03debbb1c461ff6eccdcca101127fbd
Author: Dave Brondsema <da...@brondsema.net>
AuthorDate: Fri Feb 14 17:39:03 2020 -0500

    [#8348] update mongo version to latest in docker files
---
 docker-compose-prod.yml | 2 +-
 docker-compose.yml      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/docker-compose-prod.yml b/docker-compose-prod.yml
index 19bcfaf..58c10fb 100644
--- a/docker-compose-prod.yml
+++ b/docker-compose-prod.yml
@@ -85,7 +85,7 @@ services:
     restart: always
 
   mongo:
-    image: mongo:3.4
+    image: mongo:4.2
     ports:
       - "127.0.0.1:27017:27017"
     volumes:
diff --git a/docker-compose.yml b/docker-compose.yml
index 9741b93..6fbf5d0 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -52,7 +52,7 @@ services:
       - /allura-data/solr:/opt/solr/server/solr/allura/data
 
   mongo:
-    image: mongo:3.4
+    image: mongo:4.2
     ports:
       - "27017:27017"
     volumes: