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 2015/07/08 00:11:18 UTC

[01/16] allura git commit: [#7803] ticket:810 Updated documentation to specify the correct pkill command for stopping taskd

Repository: allura
Updated Branches:
  refs/heads/db/6373 8d77af178 -> 4cd8fc312 (forced update)


[#7803] ticket:810 Updated documentation to specify the correct pkill command for stopping taskd


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

Branch: refs/heads/db/6373
Commit: 446a39d10dbdc8ff19d85befc35981ebced62b89
Parents: 6b7a5fd
Author: Aleksey 'LXj' Alekseyev <go...@gmail.com>
Authored: Sun Jun 28 13:46:15 2015 +0300
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Mon Jun 29 20:26:56 2015 +0000

----------------------------------------------------------------------
 Allura/docs/development/contributing.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/446a39d1/Allura/docs/development/contributing.rst
----------------------------------------------------------------------
diff --git a/Allura/docs/development/contributing.rst b/Allura/docs/development/contributing.rst
index 8a8cfdb..3e6c8d9 100644
--- a/Allura/docs/development/contributing.rst
+++ b/Allura/docs/development/contributing.rst
@@ -175,7 +175,7 @@ foreground::
     # web
     pkill "paster serve" && paster serve --reload ../development.ini
     # taskd
-    pkill "paster taskd" && paster taskd ../development.ini --nocapture
+    pkill "^taskd" && paster taskd ../development.ini --nocapture
 
 Make a request to the web app, and when your line of code is hit, a debug
 session will start on the console where the process is running.


[16/16] allura git commit: [#6373] use sphinxcontrib.programoutput to document paster commands. Improve some usage help text

Posted by br...@apache.org.
[#6373] use sphinxcontrib.programoutput to document paster commands.  Improve some usage help text


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

Branch: refs/heads/db/6373
Commit: 4cd8fc31223b95489446c305a68ade0b4d49cc6f
Parents: c133e23
Author: Dave Brondsema <da...@brondsema.net>
Authored: Tue Jul 7 18:10:13 2015 -0400
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Tue Jul 7 18:10:58 2015 -0400

----------------------------------------------------------------------
 Allura/allura/command/show_models.py           |  4 +-
 Allura/allura/command/taskd_cleanup.py         |  2 +-
 Allura/docs/conf.py                            |  1 +
 Allura/docs/getting_started/administration.rst | 73 ++++++++++++++++++++-
 ForgeBlog/forgeblog/command/rssfeeds.py        |  2 +-
 ForgeChat/forgechat/command.py                 |  2 +-
 requirements.txt                               |  1 +
 scripts/create-allura-sitemap.py               |  2 +-
 8 files changed, 80 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/4cd8fc31/Allura/allura/command/show_models.py
----------------------------------------------------------------------
diff --git a/Allura/allura/command/show_models.py b/Allura/allura/command/show_models.py
index d941e9e..89a2a88 100644
--- a/Allura/allura/command/show_models.py
+++ b/Allura/allura/command/show_models.py
@@ -53,7 +53,7 @@ class ReindexCommand(base.Command):
     min_args = 1
     max_args = 1
     usage = '<ini file>'
-    summary = 'Reindex and re-shortlink all artifacts'
+    summary = 'Reindex into solr and re-shortlink all artifacts'
     parser = base.Command.standard_parser(verbose=True)
     parser.add_option('-p', '--project', dest='project',  default=None,
                       help='project to reindex')
@@ -203,7 +203,7 @@ class EnsureIndexCommand(base.Command):
     min_args = 1
     max_args = 1
     usage = '[<ini file>]'
-    summary = 'Run ensure_index on all mongo objects'
+    summary = 'Create all the Mongo indexes specified by Ming models, drop any unspecified indexes.'
     parser = base.Command.standard_parser(verbose=True)
 
     def command(self):

http://git-wip-us.apache.org/repos/asf/allura/blob/4cd8fc31/Allura/allura/command/taskd_cleanup.py
----------------------------------------------------------------------
diff --git a/Allura/allura/command/taskd_cleanup.py b/Allura/allura/command/taskd_cleanup.py
index 47d09bf..a796e6c 100644
--- a/Allura/allura/command/taskd_cleanup.py
+++ b/Allura/allura/command/taskd_cleanup.py
@@ -27,7 +27,7 @@ import base
 
 
 class TaskdCleanupCommand(base.Command):
-    summary = 'Tasks cleanup command'
+    summary = 'Tasks cleanup command.  Determines which taskd processes are handling tasks, and what has been dropped or got hung.'
     parser = base.Command.standard_parser(verbose=True)
     parser.add_option('-k', '--kill-stuck-taskd',
                       dest='kill', action='store_true',

http://git-wip-us.apache.org/repos/asf/allura/blob/4cd8fc31/Allura/docs/conf.py
----------------------------------------------------------------------
diff --git a/Allura/docs/conf.py b/Allura/docs/conf.py
index 4c55afa..aa69905 100644
--- a/Allura/docs/conf.py
+++ b/Allura/docs/conf.py
@@ -42,6 +42,7 @@ import os
 extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx',
               'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.ifconfig']
 extensions += ['sphinxarg.ext']
+extensions += ['sphinxcontrib.programoutput']
 
 # Add any paths that contain templates here, relative to this directory.
 templates_path = ['_templates']

http://git-wip-us.apache.org/repos/asf/allura/blob/4cd8fc31/Allura/docs/getting_started/administration.rst
----------------------------------------------------------------------
diff --git a/Allura/docs/getting_started/administration.rst b/Allura/docs/getting_started/administration.rst
index e8952b9..b199277 100644
--- a/Allura/docs/getting_started/administration.rst
+++ b/Allura/docs/getting_started/administration.rst
@@ -70,7 +70,71 @@ running a script via this interface, the `args/kwargs` JSON should be like::
 
 See the listing of :mod:`some available tasks <allura.tasks.admin_tasks>`.
 
-Available scripts and tasks are:
+
+Available scripts and commands are:
+
+
+create-neighborhood
+-------------------
+
+.. program-output:: paster create-neighborhood development.ini --help
+
+
+ensure_index
+------------
+
+.. program-output:: paster ensure_index development.ini --help
+
+
+ircbot
+------
+
+.. program-output:: paster ircbot development.ini --help
+
+
+reindex
+-------
+
+.. program-output:: paster reindex development.ini --help
+
+
+set-neighborhood-features
+-------------------------
+
+.. program-output:: paster set-neighborhood-features development.ini --help
+
+
+set-tool-access
+---------------
+
+.. program-output:: paster set-tool-access development.ini --help
+
+
+taskd
+-----
+
+.. program-output:: paster taskd development.ini --help
+
+
+taskd_cleanup
+-------------
+
+.. program-output:: paster taskd_cleanup development.ini --help
+
+
+pull-rss-feeds
+--------------
+
+Blog tools may optionally be configured to fetch external RSS feeds.  If that is in place, this command should
+be used to fetch all those rss feeds and convert new entries into blog posts.
+
+Requires `html2text`, a GPL library.
+
+::
+
+    cd ../ForgeBlog
+    paster pull-rss-feeds development.ini --help
+
 
 disable_users.py
 ----------------
@@ -82,6 +146,7 @@ disable_users.py
     :func: get_parser
     :prog: paster script development.ini allura/scripts/disable_users.py --
 
+
 refreshrepo.py
 --------------
 
@@ -92,6 +157,7 @@ refreshrepo.py
     :func: get_parser
     :prog: paster script development.ini allura/scripts/refreshrepo.py --
 
+
 reindex_projects.py
 -------------------
 
@@ -102,6 +168,7 @@ reindex_projects.py
     :func: get_parser
     :prog: paster script development.ini allura/scripts/reindex_projects.py --
 
+
 reindex_users.py
 ----------------
 
@@ -112,6 +179,7 @@ reindex_users.py
     :func: get_parser
     :prog: paster script development.ini allura/scripts/reindex_users.py --
 
+
 create-allura-sitemap.py
 ------------------------
 
@@ -122,6 +190,7 @@ create-allura-sitemap.py
     :func: parser
     :prog: paster script development.ini ../scripts/create-allura-sitemap.py --
 
+
 publicize-neighborhood.py
 -------------------------
 
@@ -132,6 +201,7 @@ publicize-neighborhood.py
     :func: parser
     :prog: paster script development.ini ../scripts/publicize-neighborhood.py --
 
+
 scrub-allura-data.py
 --------------------
 
@@ -142,6 +212,7 @@ scrub-allura-data.py
     :func: parser
     :prog: paster script development.ini ../scripts/scrub-allura-data.py --
 
+
 teamforge-import.py
 -------------------
 

http://git-wip-us.apache.org/repos/asf/allura/blob/4cd8fc31/ForgeBlog/forgeblog/command/rssfeeds.py
----------------------------------------------------------------------
diff --git a/ForgeBlog/forgeblog/command/rssfeeds.py b/ForgeBlog/forgeblog/command/rssfeeds.py
index 7771a5c..42b5edd 100644
--- a/ForgeBlog/forgeblog/command/rssfeeds.py
+++ b/ForgeBlog/forgeblog/command/rssfeeds.py
@@ -46,7 +46,7 @@ html2text.BODY_WIDTH = 0
 
 
 class RssFeedsCommand(base.BlogCommand):
-    summary = 'Rss feed client'
+    summary = 'Fetch external rss feeds for all Blog tools, and convert new feed entries into blog posts'
     parser = base.BlogCommand.standard_parser(verbose=True)
     parser.add_option('-a', '--appid', dest='appid', default='',
                       help='application id')

http://git-wip-us.apache.org/repos/asf/allura/blob/4cd8fc31/ForgeChat/forgechat/command.py
----------------------------------------------------------------------
diff --git a/ForgeChat/forgechat/command.py b/ForgeChat/forgechat/command.py
index 6af2eaa..da2faf8 100644
--- a/ForgeChat/forgechat/command.py
+++ b/ForgeChat/forgechat/command.py
@@ -43,7 +43,7 @@ class IRCBotCommand(allura.command.Command):
     min_args = 1
     max_args = 1
     usage = '<ini file>'
-    summary = 'Connect to all configured IRC servers and relay messages'
+    summary = 'For the ForgeChat tool.  Connect to all configured IRC servers and relay messages'
     parser = command.Command.standard_parser(verbose=True)
     parser.add_option('-c', '--context', dest='context',
                       help=('The context of the message (path to the project'

http://git-wip-us.apache.org/repos/asf/allura/blob/4cd8fc31/requirements.txt
----------------------------------------------------------------------
diff --git a/requirements.txt b/requirements.txt
index eab35eb..93ef43d 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -81,3 +81,4 @@ q==2.3
 WebError==0.10.3
 sphinx-argparse==0.1.15
 sphinx-rtd-theme==0.1.6
+sphinxcontrib-programoutput==0.8
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/allura/blob/4cd8fc31/scripts/create-allura-sitemap.py
----------------------------------------------------------------------
diff --git a/scripts/create-allura-sitemap.py b/scripts/create-allura-sitemap.py
index 29220d1..9ab8f38 100644
--- a/scripts/create-allura-sitemap.py
+++ b/scripts/create-allura-sitemap.py
@@ -16,7 +16,7 @@
 #       under the License.
 
 """
-Generate Allura sitemap xml files.
+Generate Allura sitemap xml files.  You will need to configure your webserver to serve the files.
 
 This takes a while to run on a prod-sized data set. There are a couple of
 things that would make it faster, if we need/want to.


[11/16] allura git commit: [#7899] ticket:808 Fixed downloading repo files with spaces

Posted by br...@apache.org.
[#7899] ticket:808 Fixed downloading repo files with spaces


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

Branch: refs/heads/db/6373
Commit: fdefe42fb654ca105d05c302a351edf0a49f9d4d
Parents: 6991e51
Author: Aleksey 'LXj' Alekseyev <go...@gmail.com>
Authored: Sun Jun 28 13:18:02 2015 +0300
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Mon Jul 6 15:12:34 2015 +0300

----------------------------------------------------------------------
 Allura/allura/controllers/repository.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/fdefe42f/Allura/allura/controllers/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/repository.py b/Allura/allura/controllers/repository.py
index 4c9cb83..e9f051d 100644
--- a/Allura/allura/controllers/repository.py
+++ b/Allura/allura/controllers/repository.py
@@ -738,7 +738,8 @@ class FileBrowser(BaseController):
             response.headers['Content-Encoding'] = ''
             response.content_encoding = content_encoding
         response.headers.add(
-            'Content-Disposition', 'attachment;filename=' + filename)
+            'Content-Disposition',
+            'attachment;filename="%s"' % filename.encode('utf-8'))
         return iter(self._blob)
 
     def diff(self, commit, fmt=None, **kw):


[05/16] allura git commit: Lower default repo_refs_cache_threshold value more

Posted by br...@apache.org.
Lower default repo_refs_cache_threshold value more


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

Branch: refs/heads/db/6373
Commit: 14edf90fdee4b2e985af9120016cd720a8b1bcfb
Parents: 276671b
Author: Dave Brondsema <da...@brondsema.net>
Authored: Wed Jul 1 17:15:13 2015 -0400
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Wed Jul 1 17:15:13 2015 -0400

----------------------------------------------------------------------
 Allura/development.ini | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/14edf90f/Allura/development.ini
----------------------------------------------------------------------
diff --git a/Allura/development.ini b/Allura/development.ini
index bb2ccab..c3325ed 100644
--- a/Allura/development.ini
+++ b/Allura/development.ini
@@ -301,7 +301,7 @@ scm.import.retry_sleep_secs = 5
 ; the results in mongo based on a threshold. Set `repo_refs_cache_threshold` (in seconds) and the resulting
 ; lists will be cached and served from cache on subsequent requests until reset by `repo_refresh`.
 ; Set to 0 to cache all references. Remove entirely to cache nothing.
-repo_refs_cache_threshold = .5
+repo_refs_cache_threshold = .01
 
 ; One-click merge is enabled by default, but can be turned off on for each type of repo
 scm.merge.git.disabled = false


[09/16] allura git commit: [#7894] Fix issue where can_merge updated mod_date

Posted by br...@apache.org.
[#7894] Fix issue where can_merge updated mod_date


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

Branch: refs/heads/db/6373
Commit: 664bd19f481cf11e34ddb667b509115e3504ea5e
Parents: 6e8e6f3
Author: Heith Seewald <hs...@slashdotmedia.com>
Authored: Mon Jun 29 16:07:56 2015 -0400
Committer: Heith Seewald <hs...@slashdotmedia.com>
Committed: Thu Jul 2 11:08:58 2015 -0400

----------------------------------------------------------------------
 Allura/allura/lib/utils.py             | 16 ++++++++++++++++
 Allura/allura/model/repository.py      |  8 ++++----
 Allura/allura/tasks/repo_tasks.py      |  1 +
 Allura/allura/tests/model/test_repo.py |  3 ++-
 4 files changed, 23 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/664bd19f/Allura/allura/lib/utils.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/utils.py b/Allura/allura/lib/utils.py
index f812e2e..b00d7c1 100644
--- a/Allura/allura/lib/utils.py
+++ b/Allura/allura/lib/utils.py
@@ -620,6 +620,22 @@ def phone_number_hash(number):
 
 @contextmanager
 def skip_mod_date(model_cls):
+    """ Avoids updating 'mod_date'
+
+    Useful for saving cache on a model and things like that.
+
+    .. note:: This only works when the changes made to the model are flushed.
+
+    :Example:
+
+    from allura import model as M
+    key = self.can_merge_cache_key()
+    with utils.skip_mod_date(M.MergeRequest):
+        self.can_merge_cache[key] = val
+        session(self).flush(self)
+
+    :param model_cls: The model *class* being updated.
+    """
     skip_mod_date = getattr(session(model_cls)._get(), 'skip_mod_date', False)
     session(model_cls)._get().skip_mod_date = True
     try:

http://git-wip-us.apache.org/repos/asf/allura/blob/664bd19f/Allura/allura/model/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repository.py b/Allura/allura/model/repository.py
index 3f4799a..b3c60b7 100644
--- a/Allura/allura/model/repository.py
+++ b/Allura/allura/model/repository.py
@@ -832,9 +832,6 @@ class MergeRequest(VersionedArtifact, ActivityObject):
             return False
         if self.app.config.options.get('merge_disabled'):
             return False
-
-        _session = artifact_orm_session._get()
-        _session.skip_mod_date = True
         return True
 
     def can_merge_cache_key(self):
@@ -853,8 +850,11 @@ class MergeRequest(VersionedArtifact, ActivityObject):
         return self.can_merge_cache.get(key)
 
     def set_can_merge_cache(self, val):
+        from allura import model as M
         key = self.can_merge_cache_key()
-        self.can_merge_cache[key] = val
+        with utils.skip_mod_date(M.MergeRequest):
+            self.can_merge_cache[key] = val
+            session(self).flush(self)
 
     def can_merge(self):
         """

http://git-wip-us.apache.org/repos/asf/allura/blob/664bd19f/Allura/allura/tasks/repo_tasks.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tasks/repo_tasks.py b/Allura/allura/tasks/repo_tasks.py
index e44ea94..9ea9fd0 100644
--- a/Allura/allura/tasks/repo_tasks.py
+++ b/Allura/allura/tasks/repo_tasks.py
@@ -24,6 +24,7 @@ from ming.odm import session
 
 from allura.lib.decorators import task
 from allura.lib.repository import RepositoryApp
+from allura.lib.utils import skip_mod_date
 
 
 @task

http://git-wip-us.apache.org/repos/asf/allura/blob/664bd19f/Allura/allura/tests/model/test_repo.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/model/test_repo.py b/Allura/allura/tests/model/test_repo.py
index f71ad71..1f6ec3c 100644
--- a/Allura/allura/tests/model/test_repo.py
+++ b/Allura/allura/tests/model/test_repo.py
@@ -808,5 +808,6 @@ class TestMergeRequest(object):
         assert_equal(self.mr.can_merge_task_status(), None)
         repo_tasks.can_merge.post(self.mr._id)
         assert_equal(self.mr.can_merge_task_status(), 'ready')
-        M.MonQTask.run_ready()
+        with mock.patch('allura.model.repository.MergeRequest.set_can_merge_cache'):
+            M.MonQTask.run_ready()
         assert_equal(self.mr.can_merge_task_status(), 'complete')


[02/16] allura git commit: [#7803] ticket:810 Updated taskd_cleanup to search for right process name

Posted by br...@apache.org.
[#7803] ticket:810 Updated taskd_cleanup to search for right process name


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

Branch: refs/heads/db/6373
Commit: 6b7a5fdedf5dc2379c6de09180830887ec7e23c3
Parents: 6ba4a43
Author: Aleksey 'LXj' Alekseyev <go...@gmail.com>
Authored: Sun Jun 28 13:44:59 2015 +0300
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Mon Jun 29 20:26:56 2015 +0000

----------------------------------------------------------------------
 Allura/allura/command/taskd_cleanup.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/6b7a5fde/Allura/allura/command/taskd_cleanup.py
----------------------------------------------------------------------
diff --git a/Allura/allura/command/taskd_cleanup.py b/Allura/allura/command/taskd_cleanup.py
index 517917f..99caa80 100644
--- a/Allura/allura/command/taskd_cleanup.py
+++ b/Allura/allura/command/taskd_cleanup.py
@@ -129,7 +129,7 @@ class TaskdCleanupCommand(base.Command):
 
     def _taskd_pids(self):
         # space after "taskd" to ensure no match on taskd_cleanup (ourself)
-        p = subprocess.Popen(['pgrep', '-f', '/paster taskd '],
+        p = subprocess.Popen(['pgrep', '-f', '^taskd '],
                              stdout=subprocess.PIPE,
                              stderr=subprocess.PIPE)
         stdout, stderr = p.communicate()


[14/16] allura git commit: [#6373] document common admin scripts

Posted by br...@apache.org.
[#6373] document common admin scripts


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

Branch: refs/heads/db/6373
Commit: 053627a6060193fc4f7080494a82faa1cc3805e5
Parents: 93a1ecc
Author: Dave Brondsema <da...@brondsema.net>
Authored: Wed Jul 1 12:49:45 2015 -0400
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Tue Jul 7 18:10:57 2015 -0400

----------------------------------------------------------------------
 Allura/allura/scripts/disable_users.py         |   3 +
 Allura/allura/scripts/refreshrepo.py           |   4 +
 Allura/allura/scripts/reindex_projects.py      |   6 +-
 Allura/allura/scripts/reindex_users.py         |   6 +-
 Allura/docs/conf.py                            |   3 +-
 Allura/docs/getting_started/administration.rst | 126 +++++++++++++++++---
 requirements.txt                               |   1 +
 scripts/create-allura-sitemap.py               |   7 +-
 scripts/publicize-neighborhood.py              |   9 +-
 scripts/scrub-allura-data.py                   |  13 +-
 10 files changed, 151 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/053627a6/Allura/allura/scripts/disable_users.py
----------------------------------------------------------------------
diff --git a/Allura/allura/scripts/disable_users.py b/Allura/allura/scripts/disable_users.py
index 7eeef33..ed93833 100644
--- a/Allura/allura/scripts/disable_users.py
+++ b/Allura/allura/scripts/disable_users.py
@@ -66,5 +66,8 @@ class DisableUsers(ScriptTask):
         return parser
 
 
+def get_parser():
+    return DisableUsers.parser()
+
 if __name__ == '__main__':
     DisableUsers.main()

http://git-wip-us.apache.org/repos/asf/allura/blob/053627a6/Allura/allura/scripts/refreshrepo.py
----------------------------------------------------------------------
diff --git a/Allura/allura/scripts/refreshrepo.py b/Allura/allura/scripts/refreshrepo.py
index a336b0d..fbec016 100644
--- a/Allura/allura/scripts/refreshrepo.py
+++ b/Allura/allura/scripts/refreshrepo.py
@@ -194,6 +194,10 @@ class RefreshRepo(ScriptTask):
         return parser
 
 
+def get_parser():
+    return RefreshRepo.parser()
+
+
 if __name__ == '__main__':
     faulthandler.enable()
     RefreshRepo.main()

http://git-wip-us.apache.org/repos/asf/allura/blob/053627a6/Allura/allura/scripts/reindex_projects.py
----------------------------------------------------------------------
diff --git a/Allura/allura/scripts/reindex_projects.py b/Allura/allura/scripts/reindex_projects.py
index 89c447e..0f8f3be 100644
--- a/Allura/allura/scripts/reindex_projects.py
+++ b/Allura/allura/scripts/reindex_projects.py
@@ -87,7 +87,7 @@ class ReindexProjects(ScriptTask):
 
     @classmethod
     def parser(cls):
-        parser = argparse.ArgumentParser(description='Reindex all projects')
+        parser = argparse.ArgumentParser(description='Reindex all project records into Solr (for searching)')
         parser.add_argument('-n', '--nbhd', action='store', default='', dest='nbhd',
                             help='Restrict reindex to a particular neighborhood, e.g. /p/.')
         parser.add_argument(
@@ -109,5 +109,9 @@ class ReindexProjects(ScriptTask):
         return parser
 
 
+def get_parser():
+    return ReindexProjects.parser()
+
+
 if __name__ == '__main__':
     ReindexProjects.main()

http://git-wip-us.apache.org/repos/asf/allura/blob/053627a6/Allura/allura/scripts/reindex_users.py
----------------------------------------------------------------------
diff --git a/Allura/allura/scripts/reindex_users.py b/Allura/allura/scripts/reindex_users.py
index 8a0762b..e2acd3b 100644
--- a/Allura/allura/scripts/reindex_users.py
+++ b/Allura/allura/scripts/reindex_users.py
@@ -73,7 +73,7 @@ class ReindexUsers(ScriptTask):
 
     @classmethod
     def parser(cls):
-        parser = argparse.ArgumentParser(description='Reindex all users')
+        parser = argparse.ArgumentParser(description='Reindex all users into Solr (for searching)')
         parser.add_argument('--dry-run', action='store_true', dest='dry_run',
                             default=False, help='Log names of projects that would be reindexed, '
                             'but do not perform the actual reindex.')
@@ -85,5 +85,9 @@ class ReindexUsers(ScriptTask):
         return parser
 
 
+def get_parser():
+    return ReindexUsers.parser()
+
+
 if __name__ == '__main__':
     ReindexUsers.main()

http://git-wip-us.apache.org/repos/asf/allura/blob/053627a6/Allura/docs/conf.py
----------------------------------------------------------------------
diff --git a/Allura/docs/conf.py b/Allura/docs/conf.py
index c201b9c..4c55afa 100644
--- a/Allura/docs/conf.py
+++ b/Allura/docs/conf.py
@@ -41,6 +41,7 @@ import os
 
 extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx',
               'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.ifconfig']
+extensions += ['sphinxarg.ext']
 
 # Add any paths that contain templates here, relative to this directory.
 templates_path = ['_templates']
@@ -56,7 +57,7 @@ master_doc = 'index'
 
 # General information about the project.
 project = 'Apache Allura'
-copyright = '2012-2014 The Apache Software Foundation'
+copyright = '2012-2015 The Apache Software Foundation'
 
 # The version info for the project you're documenting, acts as replacement for
 # |version| and |release|, also used in various other places throughout the

http://git-wip-us.apache.org/repos/asf/allura/blob/053627a6/Allura/docs/getting_started/administration.rst
----------------------------------------------------------------------
diff --git a/Allura/docs/getting_started/administration.rst b/Allura/docs/getting_started/administration.rst
index 4410f55..0b03728 100644
--- a/Allura/docs/getting_started/administration.rst
+++ b/Allura/docs/getting_started/administration.rst
@@ -19,13 +19,19 @@
 Administration
 **************
 
+.. contents::
+   :local:
+
 Commands, Scripts, and Tasks
-----------------------------
+============================
+
+Overview
+--------
 
-Allura has many `paster` commands and `paster` scripts that can be run from the
-server commandline to administrate Allura.  There are also tasks that can be
-run through the `taskd` system.  New tasks can be submitted via the web at
-/nf/admin/task_manager  Some paster commands and scripts have been set up
+Allura has many commands and scripts that can be run from the server commandline to
+administrate Allura.  There are also tasks that can be run through the `taskd` system
+in the background.  These tasks can be submitted via the web at
+http://MYSITE/nf/admin/task_manager  Some paster scripts have been set up
 so that they are runnable as tasks too, giving you the convenience of starting
 them through the web and letting `taskd` execute them, rather than from a server
 shell.
@@ -42,30 +48,116 @@ Commands can be discovered and run via the `paster` command when you are in the
      paster create-neighborhood development.ini myneighborhood myuser ...
 
 
-Scripts are in the `scripts/` directory and run via `paster script`.  An extra
-`--` is required to separate script arguments from paster arguments.  Example::
+Scripts are in the `scripts/` directory and run slightly differently, via `paster script`.  An extra
+:kbd:`--` is required to separate script arguments from paster arguments.  Example::
 
      paster script development.ini ../scripts/create-allura-sitemap.py -- --help
     ... help output ...
 
      paster script development.ini ../scripts/create-allura-sitemap.py -- -u 100
 
-TODO:   explain important scripts, commands
-
-Tasks can be run via the web interface at /nf/admin/task_manager  You must know
-the full task name, e.g. `allura.tasks.admin_tasks.install_app`  You can
+Tasks can be run via the web interface at http://MYSITE/nf/admin/task_manager  You must know
+the full task name, e.g. :code:`allura.tasks.admin_tasks.install_app`  You can
 optionally provide a username and project and app which will get set on the
 current context (`c`).  You should specify what args and kwargs will be passed
-as parameters to the task.  They are specified in JSON format on the form.
+as parameters to the task.  They are specified in JSON format on the form.  If you are
+running a script via this interface, the `args/kwargs` JSON should be like::
+
+    {
+        "args": ["--foo --bar baz"],
+        "kwargs": {}
+    }
 
 See the listing of :mod:`some available tasks <allura.tasks.admin_tasks>`.
 
-TODO: explain how to run scripttasks and commandtasks
+Available scripts and tasks are:
 
+disable_users.py
+----------------
 
-Client Scripts
+*Can be run as a background task using task name:* :code:`allura.scripts.disable_users.DisableUsers`
+
+.. argparse::
+    :module: allura.scripts.disable_users
+    :func: get_parser
+    :prog: paster script development.ini allura/scripts/disable_users.py --
+
+refreshrepo.py
 --------------
 
+*Can be run as a background task using task name:* :code:`allura.scripts.refreshrepo.RefreshRepo`
+
+.. argparse::
+    :module: allura.scripts.refreshrepo
+    :func: get_parser
+    :prog: paster script development.ini allura/scripts/refreshrepo.py --
+
+reindex_projects.py
+-------------------
+
+*Can be run as a background task using task name:* :code:`allura.scripts.reindex_projects.ReindexProjects`
+
+.. argparse::
+    :module: allura.scripts.reindex_projects
+    :func: get_parser
+    :prog: paster script development.ini allura/scripts/reindex_projects.py --
+
+reindex_users.py
+----------------
+
+*Can be run as a background task using task name:* :code:`allura.scripts.reindex_users.ReindexUsers`
+
+.. argparse::
+    :module: allura.scripts.reindex_users
+    :func: get_parser
+    :prog: paster script development.ini allura/scripts/reindex_users.py --
+
+create-allura-sitemap.py
+------------------------
+
+*Cannot currently be run as a background task.*
+
+.. argparse::
+    :file: ../../scripts/create-allura-sitemap.py
+    :func: parser
+    :prog: paster script development.ini ../scripts/create-allura-sitemap.py --
+
+publicize-neighborhood.py
+-------------------------
+
+*Cannot currently be run as a background task.*
+
+.. argparse::
+    :file: ../../scripts/publicize-neighborhood.py
+    :func: parser
+    :prog: paster script development.ini ../scripts/publicize-neighborhood.py --
+
+scrub-allura-data.py
+--------------------
+
+*Cannot currently be run as a background task.*
+
+.. argparse::
+    :file: ../../scripts/scrub-allura-data.py
+    :func: parser
+    :prog: paster script development.ini ../scripts/scrub-allura-data.py --
+
+teamforge-import.py
+-------------------
+
+*Cannot currently be run as a background task.*
+
+Extract data from a TeamForge site (via its web API), and import directly into Allura.  There are some hard-coded
+and extra functions in this script, which should be removed or updated before being used again.
+Requires running: :command:`pip install suds` first. ::
+
+    usage: paster script development.ini ../scripts/teamforge-import.py -- --help
+
+
+
+Client Scripts
+==============
+
 Allura includes some client scripts that use Allura APIs and do not have to be run
 from an Allura server.  They do require various python packages to be installed
 and possibly a local Allura codebase set up.
@@ -79,7 +171,7 @@ instance and uploads them to another Allura wiki instance.  It can be run as:
 
 
 Site Notifications
-------------------
+==================
 
 Allura has support for site-wide notifications that appear below the site header,
 but there is currently no UI for managing them.  They can easily be inserted via
@@ -101,7 +193,7 @@ no notification will be shown.
 
 
 Using Projects and Tools
-------------------------
+========================
 
 We currently don't have any further documentation for basic operations of managing
 users, projects, and tools on Allura.  However, SourceForge has help docs that cover
@@ -110,6 +202,6 @@ that this documentation also covers some SourceForge features that are not part
 
 
 Public API Documentation
-------------------------
+========================
 
 Allura's web api is currently documented at https://sourceforge.net/p/forge/documentation/Allura%20API/

http://git-wip-us.apache.org/repos/asf/allura/blob/053627a6/requirements.txt
----------------------------------------------------------------------
diff --git a/requirements.txt b/requirements.txt
index fffb91d..eab35eb 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -79,4 +79,5 @@ WebTest==1.4.0
 testfixtures==3.0.0
 q==2.3
 WebError==0.10.3
+sphinx-argparse==0.1.15
 sphinx-rtd-theme==0.1.6

http://git-wip-us.apache.org/repos/asf/allura/blob/053627a6/scripts/create-allura-sitemap.py
----------------------------------------------------------------------
diff --git a/scripts/create-allura-sitemap.py b/scripts/create-allura-sitemap.py
index f39b2a6..29220d1 100644
--- a/scripts/create-allura-sitemap.py
+++ b/scripts/create-allura-sitemap.py
@@ -142,7 +142,7 @@ def main(options):
             f.write(sitemap_index_content)
 
 
-def parse_options():
+def parser():
     import argparse
     class Validate(argparse.Action):
         def __call__(self, parser, namespace, value, option_string=None):
@@ -165,8 +165,11 @@ def parse_options():
     parser.add_argument('-n', '--neighborhood', dest='neighborhood',
                          help="URL prefix of excluded neighborhood(s)",
                          default=None, nargs='*')
+    return parser
+
+def parse_options():
+    return parser().parse_args()
 
-    return parser.parse_args()
 
 if __name__ == '__main__':
     sys.exit(main(parse_options()))

http://git-wip-us.apache.org/repos/asf/allura/blob/053627a6/scripts/publicize-neighborhood.py
----------------------------------------------------------------------
diff --git a/scripts/publicize-neighborhood.py b/scripts/publicize-neighborhood.py
index c32d384..9cc6494 100644
--- a/scripts/publicize-neighborhood.py
+++ b/scripts/publicize-neighborhood.py
@@ -70,7 +70,7 @@ def main(options):
     return 0
 
 
-def parse_options():
+def parser():
     import argparse
     parser = argparse.ArgumentParser(
         description='Make all projects in a neighborhood public.')
@@ -81,7 +81,12 @@ def parse_options():
                         help='Run in test mode (no updates will be applied).')
     parser.add_argument('--log', dest='log_level', default='INFO',
                         help='Log level (DEBUG, INFO, WARNING, ERROR, CRITICAL).')
-    return parser.parse_args()
+    return parser
+
+
+def parse_options():
+    return parser().parse_args()
+
 
 if __name__ == '__main__':
     sys.exit(main(parse_options()))

http://git-wip-us.apache.org/repos/asf/allura/blob/053627a6/scripts/scrub-allura-data.py
----------------------------------------------------------------------
diff --git a/scripts/scrub-allura-data.py b/scripts/scrub-allura-data.py
index c0e0828..211cfdc 100644
--- a/scripts/scrub-allura-data.py
+++ b/scripts/scrub-allura-data.py
@@ -134,16 +134,23 @@ def main(options):
     return 0
 
 
-def parse_options():
+def parser():
     import argparse
     parser = argparse.ArgumentParser(
-        description='Removes private data from the Allura MongoDB.')
+        description='Removes private data from the Allura MongoDB.  DO NOT RUN THIS on your main database.  '
+                    'This is intended to be used on a copy of your database, to prepare it for sharing with others.'
+    )
     parser.add_argument('--dry-run', dest='dry_run', default=False,
                         action='store_true',
                         help='Run in test mode (no updates will be applied).')
     parser.add_argument('--log', dest='log_level', default='INFO',
                         help='Log level (DEBUG, INFO, WARNING, ERROR, CRITICAL).')
-    return parser.parse_args()
+    return parser
+
+
+def parse_options():
+    return parser().parse_args()
+
 
 if __name__ == '__main__':
     sys.exit(main(parse_options()))


[13/16] allura git commit: Let `paster shell` work, avoiding https redirect

Posted by br...@apache.org.
Let `paster shell` work, avoiding https redirect


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

Branch: refs/heads/db/6373
Commit: 93a1ecc1fae394f3350b5eefc957c9ab4976b996
Parents: ffba721
Author: Dave Brondsema <da...@brondsema.net>
Authored: Tue Jul 7 17:58:50 2015 -0400
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Tue Jul 7 17:58:50 2015 -0400

----------------------------------------------------------------------
 Allura/development.ini | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/93a1ecc1/Allura/development.ini
----------------------------------------------------------------------
diff --git a/Allura/development.ini b/Allura/development.ini
index c3325ed..02d3e9f 100644
--- a/Allura/development.ini
+++ b/Allura/development.ini
@@ -233,7 +233,8 @@ webhook.repo_push.max_hooks = {"git": 3, "hg": 3, "svn": 3}
 ; If you set force_ssl.logged_in, you probably want some URLs to be ssl when logged out:
 ;force_ssl.pattern = ^/auth|^/[a-z0-9-]+/import_project/  ; import_project uses a login overlay
 ; And to permit some URLs to be accessed over http anyway:
-;no_redirect.pattern = ^/nf/\d+/_(ew|static)_/|^/rest/|^/nf/tool_icon_css|^/auth/refresh_repo
+;    /_test_vars is used when running `paster shell`
+;no_redirect.pattern = ^/nf/\d+/_(ew|static)_/|^/rest/|^/nf/tool_icon_css|^/auth/refresh_repo|^/_test_vars
 
 
 ; Set the locations of some static resources.  ("ew" stands for EasyWidgets library)


[10/16] allura git commit: [#4020] set compress=False on jquery ui css files that have relative image references in them

Posted by br...@apache.org.
[#4020] set compress=False on jquery ui css files that have relative image references in them


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

Branch: refs/heads/db/6373
Commit: 6991e5103b56a443c2bc7abf9a8205323e607aac
Parents: 664bd19
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Wed Jul 1 21:57:17 2015 +0000
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Fri Jul 3 14:10:19 2015 +0300

----------------------------------------------------------------------
 Allura/allura/ext/admin/widgets.py       | 2 +-
 Allura/allura/lib/widgets/form_fields.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/6991e510/Allura/allura/ext/admin/widgets.py
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/widgets.py b/Allura/allura/ext/admin/widgets.py
index 0f7d33d..de8046f 100644
--- a/Allura/allura/ext/admin/widgets.py
+++ b/Allura/allura/ext/admin/widgets.py
@@ -167,7 +167,7 @@ class FeaturesField(ew.CompoundField):
     fields = [ew.TextField(name='feature', attrs={'style': 'width:89%'})]
 
     def resources(self):
-        yield ew.CSSLink('allura/css/smoothness/jquery-ui-1.8.4.custom.css')
+        yield ew.CSSLink('allura/css/smoothness/jquery-ui-1.8.4.custom.css', compress=False)  # compress will also serve from a different location, breaking image refs
 
 
 class MetadataAdmin(ff.AdminForm):

http://git-wip-us.apache.org/repos/asf/allura/blob/6991e510/Allura/allura/lib/widgets/form_fields.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/widgets/form_fields.py b/Allura/allura/lib/widgets/form_fields.py
index 77665f9..da4d98a 100644
--- a/Allura/allura/lib/widgets/form_fields.py
+++ b/Allura/allura/lib/widgets/form_fields.py
@@ -483,7 +483,7 @@ class DateField(JQueryMixin, ew.TextField):
     def resources(self):
         for r in super(DateField, self).resources():
             yield r
-        yield ew.CSSLink('css/jquery.ui.datepicker.css')
+        yield ew.CSSLink('css/jquery.ui.datepicker.css', compress=False)  # compress will also serve from a different location, breaking image refs
 
 
 class FieldCluster(ew.CompoundField):


[15/16] allura git commit: [#6373] cross link our different APIs

Posted by br...@apache.org.
[#6373] cross link our different APIs


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

Branch: refs/heads/db/6373
Commit: c133e23a48c9d904e6be7634c7a88ca8b4f0cd02
Parents: 053627a
Author: Dave Brondsema <da...@brondsema.net>
Authored: Tue Jul 7 16:34:18 2015 -0400
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Tue Jul 7 18:10:57 2015 -0400

----------------------------------------------------------------------
 Allura/docs/api/index.rst                      | 4 ++++
 Allura/docs/getting_started/administration.rst | 1 +
 2 files changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/c133e23a/Allura/docs/api/index.rst
----------------------------------------------------------------------
diff --git a/Allura/docs/api/index.rst b/Allura/docs/api/index.rst
index 2103410..451972a 100644
--- a/Allura/docs/api/index.rst
+++ b/Allura/docs/api/index.rst
@@ -19,6 +19,10 @@
 Allura API
 **********
 
+This documents the python classes available to Allura tools and extensions.
+
+If you are looking for the web REST API, see :ref:`public_api`
+
 
 .. toctree::
     :maxdepth: 3

http://git-wip-us.apache.org/repos/asf/allura/blob/c133e23a/Allura/docs/getting_started/administration.rst
----------------------------------------------------------------------
diff --git a/Allura/docs/getting_started/administration.rst b/Allura/docs/getting_started/administration.rst
index 0b03728..e8952b9 100644
--- a/Allura/docs/getting_started/administration.rst
+++ b/Allura/docs/getting_started/administration.rst
@@ -200,6 +200,7 @@ users, projects, and tools on Allura.  However, SourceForge has help docs that c
 these functions https://sourceforge.net/p/forge/documentation/Docs%20Home/  Note
 that this documentation also covers some SourceForge features that are not part of Allura.
 
+.. _public_api:
 
 Public API Documentation
 ========================


[03/16] allura git commit: [#7803] tweak regex to match taskd procs currently handling a task

Posted by br...@apache.org.
[#7803] tweak regex to match taskd procs currently handling a task


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

Branch: refs/heads/db/6373
Commit: 661c8d0f2296269e6a9929d3640f161622fd1d78
Parents: 446a39d
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Mon Jun 29 20:26:39 2015 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Mon Jun 29 20:27:02 2015 +0000

----------------------------------------------------------------------
 Allura/allura/command/taskd_cleanup.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/661c8d0f/Allura/allura/command/taskd_cleanup.py
----------------------------------------------------------------------
diff --git a/Allura/allura/command/taskd_cleanup.py b/Allura/allura/command/taskd_cleanup.py
index 99caa80..47d09bf 100644
--- a/Allura/allura/command/taskd_cleanup.py
+++ b/Allura/allura/command/taskd_cleanup.py
@@ -128,8 +128,8 @@ class TaskdCleanupCommand(base.Command):
         })
 
     def _taskd_pids(self):
-        # space after "taskd" to ensure no match on taskd_cleanup (ourself)
-        p = subprocess.Popen(['pgrep', '-f', '^taskd '],
+        # space or colon after "taskd" to ensure no match on taskd_cleanup (ourself)
+        p = subprocess.Popen(['pgrep', '-f', '^taskd[ :]'],
                              stdout=subprocess.PIPE,
                              stderr=subprocess.PIPE)
         stdout, stderr = p.communicate()


[07/16] allura git commit: [#7894] Move skip_mod_date into Allura

Posted by br...@apache.org.
[#7894] Move skip_mod_date into Allura


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

Branch: refs/heads/db/6373
Commit: 6e8e6f33f5501290cbea052e99044a15a54beeeb
Parents: 23bcdc9
Author: Heith Seewald <hs...@slashdotmedia.com>
Authored: Mon Jun 29 14:36:55 2015 -0400
Committer: Heith Seewald <hs...@slashdotmedia.com>
Committed: Thu Jul 2 11:08:58 2015 -0400

----------------------------------------------------------------------
 Allura/allura/lib/utils.py        | 12 ++++++++++++
 Allura/allura/tests/test_utils.py |  8 ++++++++
 2 files changed, 20 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/6e8e6f33/Allura/allura/lib/utils.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/utils.py b/Allura/allura/lib/utils.py
index 143868e..f812e2e 100644
--- a/Allura/allura/lib/utils.py
+++ b/Allura/allura/lib/utils.py
@@ -14,6 +14,7 @@
 #       KIND, either express or implied.  See the License for the
 #       specific language governing permissions and limitations
 #       under the License.
+from contextlib import contextmanager
 
 import time
 import string
@@ -21,6 +22,7 @@ import hashlib
 import binascii
 import logging.handlers
 import codecs
+from ming.odm import session
 import os.path
 import datetime
 import random
@@ -614,3 +616,13 @@ def clean_phone_number(number):
 def phone_number_hash(number):
     number = clean_phone_number(number)
     return hashlib.sha1(number).hexdigest()
+
+
+@contextmanager
+def skip_mod_date(model_cls):
+    skip_mod_date = getattr(session(model_cls)._get(), 'skip_mod_date', False)
+    session(model_cls)._get().skip_mod_date = True
+    try:
+        yield
+    finally:
+        session(model_cls)._get().skip_mod_date = skip_mod_date
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/allura/blob/6e8e6f33/Allura/allura/tests/test_utils.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/test_utils.py b/Allura/allura/tests/test_utils.py
index 5043e3d..39d61b3 100644
--- a/Allura/allura/tests/test_utils.py
+++ b/Allura/allura/tests/test_utils.py
@@ -21,6 +21,8 @@ import json
 import time
 import unittest
 import datetime as dt
+from ming.odm import session
+import model as M
 from os import path
 
 from webob import Request
@@ -323,3 +325,9 @@ def test_phone_number_hash():
     hash = utils.phone_number_hash
     assert_equal(hash('1234567890'), hash('+123 456:7890'))
     assert_not_equal(hash('1234567890'), hash('1234567891'))
+
+
+def test_skip_mod_date():
+    with utils.skip_mod_date(M.Artifact):
+        assert getattr(session(M.Artifact)._get(), 'skip_mod_date', None) == True
+    assert getattr(session(M.Artifact)._get(), 'skip_mod_date', None) == False
\ No newline at end of file


[06/16] allura git commit: Mock the __ming__ (Mock doesn't do this automatically) so that if we try to cache the tags/branches, it doesn't error out

Posted by br...@apache.org.
Mock the __ming__ (Mock doesn't do this automatically) so that if we try to cache the tags/branches, it doesn't error out


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

Branch: refs/heads/db/6373
Commit: 0fd24ba4cc7f1d4d49a774cdabf3fe650478737e
Parents: 14edf90
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Thu Jul 2 14:38:33 2015 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu Jul 2 14:38:33 2015 +0000

----------------------------------------------------------------------
 ForgeGit/forgegit/tests/model/test_repository.py | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/0fd24ba4/ForgeGit/forgegit/tests/model/test_repository.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/model/test_repository.py b/ForgeGit/forgegit/tests/model/test_repository.py
index c28daf1..4cfd2ef 100644
--- a/ForgeGit/forgegit/tests/model/test_repository.py
+++ b/ForgeGit/forgegit/tests/model/test_repository.py
@@ -746,6 +746,7 @@ class TestGitImplementation(unittest.TestCase):
         repo_dir = pkg_resources.resource_filename(
             'forgegit', 'tests/data/testgit.git')
         repo = mock.Mock(full_fs_path=repo_dir)
+        repo.__ming__ = mock.Mock()
         repo.cached_branches = []
         impl = GM.git_repo.GitImplementation(repo)
         self.assertEqual(impl.branches, [
@@ -759,6 +760,7 @@ class TestGitImplementation(unittest.TestCase):
         repo_dir = pkg_resources.resource_filename(
             'forgegit', 'tests/data/testgit.git')
         repo = mock.Mock(full_fs_path=repo_dir)
+        repo.__ming__ = mock.Mock()
         repo.cached_tags = []
         impl = GM.git_repo.GitImplementation(repo)
         self.assertEqual(impl.tags, [


[12/16] allura git commit: [#7899] ticket:812 Add test for format=raw and fix unicode error

Posted by br...@apache.org.
[#7899] ticket:812 Add test for format=raw and fix unicode error


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

Branch: refs/heads/db/6373
Commit: ffba7216b9a07bf5a1418180b771662f522e6c44
Parents: fdefe42
Author: Igor Bondarenko <je...@gmail.com>
Authored: Mon Jul 6 16:13:50 2015 +0300
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Mon Jul 6 16:13:50 2015 +0300

----------------------------------------------------------------------
 Allura/allura/controllers/repository.py         |  2 +-
 .../tests/functional/test_controllers.py        | 37 ++++++++++++++++++--
 2 files changed, 35 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/ffba7216/Allura/allura/controllers/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/repository.py b/Allura/allura/controllers/repository.py
index e9f051d..f8b0834 100644
--- a/Allura/allura/controllers/repository.py
+++ b/Allura/allura/controllers/repository.py
@@ -739,7 +739,7 @@ class FileBrowser(BaseController):
             response.content_encoding = content_encoding
         response.headers.add(
             'Content-Disposition',
-            'attachment;filename="%s"' % filename.encode('utf-8'))
+            'attachment;filename="%s"' % filename)
         return iter(self._blob)
 
     def diff(self, commit, fmt=None, **kw):

http://git-wip-us.apache.org/repos/asf/allura/blob/ffba7216/ForgeGit/forgegit/tests/functional/test_controllers.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/functional/test_controllers.py b/ForgeGit/forgegit/tests/functional/test_controllers.py
index 917f765..b84cd5a 100644
--- a/ForgeGit/forgegit/tests/functional/test_controllers.py
+++ b/ForgeGit/forgegit/tests/functional/test_controllers.py
@@ -1,3 +1,5 @@
+# coding: utf-8
+
 #       Licensed to the Apache Software Foundation (ASF) under one
 #       or more contributor license agreements.  See the NOTICE file
 #       distributed with this work for additional information
@@ -78,6 +80,18 @@ class _TestCase(TestController):
 
 class TestRootController(_TestCase):
 
+
+    @with_tool('test', 'Git', 'weird-chars', 'WeirdChars', type='git')
+    def _setup_weird_chars_repo(self):
+        h.set_context('test', 'weird-chars', neighborhood='Projects')
+        repo_dir = pkg_resources.resource_filename(
+            'forgegit', 'tests/data')
+        c.app.repo.fs_path = repo_dir
+        c.app.repo.status = 'ready'
+        c.app.repo.name = 'weird-chars.git'
+        ThreadLocalORMSession.flush_all()
+        c.app.repo.refresh()
+
     def test_status(self):
         resp = self.app.get('/src-git/status')
         d = json.loads(resp.body)
@@ -164,11 +178,11 @@ class TestRootController(_TestCase):
     def test_tags(self):
         self.app.get('/src-git/ref/master~/tags/')
 
-    def _get_ci(self):
-        r = self.app.get('/src-git/ref/master/')
+    def _get_ci(self, repo='/p/test/src-git/'):
+        r = self.app.get(repo + 'ref/master/')
         resp = r.follow()
         for tag in resp.html.findAll('a'):
-            if tag['href'].startswith('/p/test/src-git/ci/'):
+            if tag['href'].startswith(repo + 'ci/'):
                 href = tag['href']
                 if href.endswith('tree/'):
                     href = href[:-5]
@@ -241,6 +255,23 @@ class TestRootController(_TestCase):
         assert '<span id="l1" class="code_block">' in resp
         assert 'var hash = window.location.hash.substring(1);' in resp
 
+    def test_file_raw(self):
+        self._setup_weird_chars_repo()
+        ci = self._get_ci(repo='/p/test/weird-chars/')
+        url = ci + 'tree/' + h.urlquote(u'привіт.txt') + '?format=raw'
+        resp = self.app.get(url)
+        assert_in(u'Привіт!\nWhich means Hello!', resp.body.decode('utf-8'))
+        assert_equal(
+            resp.headers.get('Content-Disposition').decode('utf-8'),
+            u'attachment;filename="привіт.txt"')
+
+        url = ci + 'tree/' + h.urlquote(u'with space.txt') + '?format=raw'
+        resp = self.app.get(url)
+        assert_in(u'with space', resp.body.decode('utf-8'))
+        assert_equal(
+            resp.headers.get('Content-Disposition').decode('utf-8'),
+            u'attachment;filename="with space.txt"')
+
     def test_invalid_file(self):
         ci = self._get_ci()
         self.app.get(ci + 'tree/READMEz', status=404)


[04/16] allura git commit: [#7906] in login post, pass a _session_id value in both POST and cookies, so it gets past CSRF checks

Posted by br...@apache.org.
[#7906] in login post, pass a _session_id value in both POST and cookies, so it gets past CSRF checks


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

Branch: refs/heads/db/6373
Commit: 276671bf22bc4c7a0c0f0ed3bd270a56642b63b5
Parents: 661c8d0
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Mon Jun 29 18:01:36 2015 +0000
Committer: Heith Seewald <hs...@slashdotmedia.com>
Committed: Mon Jun 29 20:50:21 2015 +0000

----------------------------------------------------------------------
 scripts/ApacheAccessHandler.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/276671bf/scripts/ApacheAccessHandler.py
----------------------------------------------------------------------
diff --git a/scripts/ApacheAccessHandler.py b/scripts/ApacheAccessHandler.py
index 1af3714..1ee9ebc 100644
--- a/scripts/ApacheAccessHandler.py
+++ b/scripts/ApacheAccessHandler.py
@@ -115,7 +115,11 @@ def check_authentication(req):
     r = requests.post(auth_url, allow_redirects=False, data={
         'username': username,
         'password': password,
-        'return_to': '/login_successful'})
+        'return_to': '/login_successful',
+        '_session_id': 'this-is-our-session',
+    }, cookies={
+        '_session_id': 'this-is-our-session',
+    })
     return r.status_code == 302 and r.headers['location'].endswith('/login_successful')
 
 


[08/16] allura git commit: [#7894] Merge request timestamps are no longer updated incorrectly

Posted by br...@apache.org.
[#7894] Merge request timestamps are no longer updated incorrectly


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

Branch: refs/heads/db/6373
Commit: 23bcdc9b1dcee3c230fa49003902d22aaa72520f
Parents: 0fd24ba
Author: Heith Seewald <hs...@slashdotmedia.com>
Authored: Mon Jun 15 16:33:06 2015 -0400
Committer: Heith Seewald <hs...@slashdotmedia.com>
Committed: Thu Jul 2 11:08:58 2015 -0400

----------------------------------------------------------------------
 Allura/allura/model/repository.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/23bcdc9b/Allura/allura/model/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repository.py b/Allura/allura/model/repository.py
index a3d574c..3f4799a 100644
--- a/Allura/allura/model/repository.py
+++ b/Allura/allura/model/repository.py
@@ -56,7 +56,8 @@ from .timeline import ActivityObject
 from .monq_model import MonQTask
 from .project import AppConfig
 from .session import main_doc_session
-from .session import repository_orm_session
+from .session import repository_orm_session, artifact_orm_session
+
 
 log = logging.getLogger(__name__)
 config = utils.ConfigProxy(
@@ -831,6 +832,9 @@ class MergeRequest(VersionedArtifact, ActivityObject):
             return False
         if self.app.config.options.get('merge_disabled'):
             return False
+
+        _session = artifact_orm_session._get()
+        _session.skip_mod_date = True
         return True
 
     def can_merge_cache_key(self):