You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by jo...@apache.org on 2013/11/26 21:37:05 UTC

[1/3] git commit: [#6828] Changes related to activitystream refactor

Updated Branches:
  refs/heads/master b170f8fc7 -> ef071f2cb


[#6828] Changes related to activitystream refactor

- Activities are proper objects now, not dicts
- Specify Ming as default storage driver in setup.py
- Configure activitystream for tests

Signed-off-by: Tim Van Steenburgh <tv...@gmail.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/f2ba6d53
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/f2ba6d53
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/f2ba6d53

Branch: refs/heads/master
Commit: f2ba6d53104ef50d102cf65d429c407d9268dc56
Parents: b170f8f
Author: Tim Van Steenburgh <tv...@gmail.com>
Authored: Tue Nov 19 22:15:05 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Tue Nov 26 20:36:32 2013 +0000

----------------------------------------------------------------------
 Allura/allura/model/timeline.py                  | 2 +-
 Allura/allura/websetup/schema.py                 | 3 +++
 Allura/setup.py                                  | 2 ++
 Allura/test.ini                                  | 1 +
 ForgeActivity/forgeactivity/templates/index.html | 6 +++---
 5 files changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/f2ba6d53/Allura/allura/model/timeline.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/timeline.py b/Allura/allura/model/timeline.py
index 90c918d..38550b8 100644
--- a/Allura/allura/model/timeline.py
+++ b/Allura/allura/model/timeline.py
@@ -63,7 +63,7 @@ def perm_check(user):
         """Return True if c.user has 'read' access to this activity,
         otherwise return False.
         """
-        extras_dict = activity['obj'].get('activity_extras')
+        extras_dict = activity.obj.activity_extras
         if not extras_dict: return True
         allura_id = extras_dict.get('allura_id')
         if not allura_id: return True

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/f2ba6d53/Allura/allura/websetup/schema.py
----------------------------------------------------------------------
diff --git a/Allura/allura/websetup/schema.py b/Allura/allura/websetup/schema.py
index 320c454..0198f8a 100644
--- a/Allura/allura/websetup/schema.py
+++ b/Allura/allura/websetup/schema.py
@@ -20,6 +20,8 @@
 """Setup the allura application"""
 
 import logging
+
+import activitystream
 from tg import config
 import pylons
 from paste.registry import Registry
@@ -37,6 +39,7 @@ def setup_schema(command, conf, vars):
     REGISTRY.register(pylons.app_globals, config['pylons.app_globals'])
     REGISTRY.register(allura.credentials, allura.lib.security.Credentials())
     ming.configure(**conf)
+    activitystream.configure(**conf)
     # Nothing to do
     log.info('setup_schema called')
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/f2ba6d53/Allura/setup.py
----------------------------------------------------------------------
diff --git a/Allura/setup.py b/Allura/setup.py
index 32e6eb4..bc829ce 100644
--- a/Allura/setup.py
+++ b/Allura/setup.py
@@ -146,5 +146,7 @@ setup(
     [easy_widgets.engines]
     jinja = allura.config.app_cfg:JinjaEngine
 
+    [activitystream.storage]
+    driver = activitystream.storage.mingstorage:MingStorage
     """,
 )

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/f2ba6d53/Allura/test.ini
----------------------------------------------------------------------
diff --git a/Allura/test.ini b/Allura/test.ini
index 8747433..99ca324 100644
--- a/Allura/test.ini
+++ b/Allura/test.ini
@@ -52,6 +52,7 @@ activitystream.database = activitystream
 activitystream.activity_collection = activities
 activitystream.node_collection = nodes
 activitystream.timeline_collection = timelines
+activitystream.recording.enabled = true
 activitystream.enabled = true
 
 solr.mock = true

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/f2ba6d53/ForgeActivity/forgeactivity/templates/index.html
----------------------------------------------------------------------
diff --git a/ForgeActivity/forgeactivity/templates/index.html b/ForgeActivity/forgeactivity/templates/index.html
index e4ad26a..6189688 100644
--- a/ForgeActivity/forgeactivity/templates/index.html
+++ b/ForgeActivity/forgeactivity/templates/index.html
@@ -37,7 +37,7 @@
 {% endblock %}
 
 {% macro activity_obj(o) %}
-  <a href="{{o['activity_url']}}">{{o['activity_name']}}</a>
+  <a href="{{o.activity_url}}">{{o.activity_name}}</a>
 {% endmacro %}
 
 {% block content %}
@@ -47,8 +47,8 @@
   {% else %}
     <ul>
         {% for a in timeline %}
-        <li>{{activity_obj(a['actor'])}} {{a['verb']}} {{activity_obj(a['obj'])}} {% if a.get('target') %}on {{activity_obj(a['target'])}}{% endif %} {{h.ago(a['published'])}}</li>
-        <!-- Score: {{ a.get('score') }} -->
+        <li>{{activity_obj(a.actor)}} {{a.verb}} {{activity_obj(a.obj)}} {% if a.target.activity_name %}on {{activity_obj(a.target)}}{% endif %} {{h.ago(a.published)}}</li>
+        <!-- Score: {{ a.score }} -->
         {% endfor %}
     </ul>
   {% endif %}


[3/3] git commit: [#4452] Bumped ActivityStream version and fixed HTML5 validation error

Posted by jo...@apache.org.
[#4452] Bumped ActivityStream version and fixed HTML5 validation error

Signed-off-by: Cory Johns <cj...@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/ef071f2c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/ef071f2c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/ef071f2c

Branch: refs/heads/master
Commit: ef071f2cb804e1e4321f3f0cddcdbe6bea57b7f5
Parents: 13ebca1
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Tue Nov 26 20:36:07 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Tue Nov 26 20:36:33 2013 +0000

----------------------------------------------------------------------
 AlluraTest/alluratest/validation.py | 2 +-
 requirements-common.txt             | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/ef071f2c/AlluraTest/alluratest/validation.py
----------------------------------------------------------------------
diff --git a/AlluraTest/alluratest/validation.py b/AlluraTest/alluratest/validation.py
index 39f73c3..d6723e5 100644
--- a/AlluraTest/alluratest/validation.py
+++ b/AlluraTest/alluratest/validation.py
@@ -190,7 +190,7 @@ def validate_html5_chunk(html):
 
     html = '''<!DOCTYPE html>
     <html>
-    <head><title></title></head>
+    <head><title>Not empty</title></head>
     <body>
     %s
     </body></html>''' % html

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/ef071f2c/requirements-common.txt
----------------------------------------------------------------------
diff --git a/requirements-common.txt b/requirements-common.txt
index a8747b4..5184ad4 100644
--- a/requirements-common.txt
+++ b/requirements-common.txt
@@ -1,7 +1,7 @@
 # requirements for all deployment environments
 
 pytz==2012j
-ActivityStream==0.1.4
+ActivityStream==0.1.6
 BeautifulSoup==3.2.0
 chardet==1.0.1
 colander==0.9.3


[2/3] git commit: [#4452] Add activitystream to ensure_index command

Posted by jo...@apache.org.
[#4452] Add activitystream to ensure_index command

Signed-off-by: Tim Van Steenburgh <tv...@gmail.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/13ebca1d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/13ebca1d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/13ebca1d

Branch: refs/heads/master
Commit: 13ebca1d55bd42ed6baabc5baac627ccf64f3b4a
Parents: f2ba6d5
Author: Tim Van Steenburgh <tv...@gmail.com>
Authored: Wed Nov 20 05:19:34 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Tue Nov 26 20:36:33 2013 +0000

----------------------------------------------------------------------
 Allura/allura/command/show_models.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/13ebca1d/Allura/allura/command/show_models.py
----------------------------------------------------------------------
diff --git a/Allura/allura/command/show_models.py b/Allura/allura/command/show_models.py
index 9872c23..22ca68f 100644
--- a/Allura/allura/command/show_models.py
+++ b/Allura/allura/command/show_models.py
@@ -200,6 +200,7 @@ class EnsureIndexCommand(base.Command):
 
     def command(self):
         from allura import model as M
+        from activitystream.storage.mingstorage import activity_orm_session
         self.basic_setup()
         main_indexes = defaultdict(lambda: defaultdict(list))  # by db, then collection name
         project_indexes = defaultdict(list)  # by collection name
@@ -212,8 +213,8 @@ class EnsureIndexCommand(base.Command):
                 base.log.info('... skipping abstract class %s', cls)
                 continue
             base.log.info('... for class %s', cls)
-            if session(cls) in (
-                M.main_orm_session, M.repository_orm_session, M.task_orm_session):
+            if session(cls) in (M.main_orm_session, M.repository_orm_session,
+                    M.task_orm_session, activity_orm_session):
                 idx = main_indexes[session(cls)][cname]
             else:
                 idx = project_indexes[cname]