release: Merge default into stable for release preparation
This commit is contained in:
commit
4bd1fbba7c
809 changed files with 12369 additions and 9868 deletions
|
|
@ -1,5 +1,5 @@
|
|||
[bumpversion]
|
||||
current_version = 4.5.2
|
||||
current_version = 4.6.0
|
||||
message = release: Bump version {current_version} to {new_version}
|
||||
|
||||
[bumpversion:file:rhodecode/VERSION]
|
||||
|
|
|
|||
17
.release.cfg
17
.release.cfg
|
|
@ -4,27 +4,22 @@ done = false
|
|||
[task:bump_version]
|
||||
done = true
|
||||
|
||||
[task:rc_tools_pinned]
|
||||
done = true
|
||||
|
||||
[task:fixes_on_stable]
|
||||
done = true
|
||||
|
||||
[task:pip2nix_generated]
|
||||
done = true
|
||||
|
||||
[task:changelog_updated]
|
||||
done = true
|
||||
|
||||
[task:generate_api_docs]
|
||||
done = true
|
||||
|
||||
[release]
|
||||
state = prepared
|
||||
version = 4.5.2
|
||||
|
||||
[task:updated_translation]
|
||||
|
||||
[release]
|
||||
state = in_progress
|
||||
version = 4.6.0
|
||||
|
||||
[task:rc_tools_pinned]
|
||||
|
||||
[task:generate_js_routes]
|
||||
|
||||
[task:updated_trial_license]
|
||||
|
|
|
|||
|
|
@ -29,8 +29,6 @@ recursive-include rhodecode *.mako
|
|||
# 502 page
|
||||
include rhodecode/public/502.html
|
||||
|
||||
# 502 page
|
||||
include rhodecode/public/502.html
|
||||
|
||||
# images, css
|
||||
include rhodecode/public/css/*.css
|
||||
|
|
|
|||
40
Makefile
40
Makefile
|
|
@ -1,11 +1,25 @@
|
|||
|
||||
.PHONY: clean docs docs-clean docs-cleanup test test-clean test-only web-build
|
||||
|
||||
WEBPACK=./node_modules/webpack/bin/webpack.js
|
||||
GRUNT=grunt
|
||||
NODE_PATH=./node_modules
|
||||
CI_PREFIX=enterprise
|
||||
|
||||
.PHONY: docs docs-clean ci-docs clean test test-clean test-lint test-only
|
||||
|
||||
clean:
|
||||
make test-clean
|
||||
find . -type f \( -iname '*.c' -o -iname '*.pyc' -o -iname '*.so' \) -exec rm '{}' ';'
|
||||
|
||||
test:
|
||||
make test-clean
|
||||
make test-only
|
||||
|
||||
test-clean:
|
||||
rm -rf coverage.xml htmlcov junit.xml pylint.log result
|
||||
find . -type d -name "__pycache__" -prune -exec rm -rf '{}' ';'
|
||||
|
||||
test-only:
|
||||
PYTHONHASHSEED=random py.test -vv -r xw --cov=rhodecode --cov-report=term-missing --cov-report=html rhodecode
|
||||
|
||||
docs:
|
||||
(cd docs; nix-build default.nix -o result; make clean html)
|
||||
|
|
@ -13,27 +27,9 @@ docs:
|
|||
docs-clean:
|
||||
(cd docs; make clean)
|
||||
|
||||
ci-docs: docs;
|
||||
|
||||
|
||||
clean: test-clean
|
||||
find . -type f \( -iname '*.c' -o -iname '*.pyc' -o -iname '*.so' \) -exec rm '{}' ';'
|
||||
|
||||
test: test-clean test-only
|
||||
|
||||
test-clean:
|
||||
rm -rf coverage.xml htmlcov junit.xml pylint.log result
|
||||
|
||||
test-only:
|
||||
PYTHONHASHSEED=random py.test -vv -r xw --cov=rhodecode --cov-report=term-missing --cov-report=html rhodecode/tests/
|
||||
docs-cleanup:
|
||||
(cd docs; make cleanup)
|
||||
|
||||
web-build:
|
||||
NODE_PATH=$(NODE_PATH) $(GRUNT)
|
||||
|
||||
web-test:
|
||||
@echo "no test for our javascript, yet!"
|
||||
|
||||
docs-bootstrap:
|
||||
(cd docs; nix-build default.nix -o result)
|
||||
@echo "Please go to docs folder and run make html"
|
||||
|
||||
|
|
|
|||
|
|
@ -415,19 +415,23 @@ search.location = %(here)s/data/index
|
|||
########################################
|
||||
## channelstream enables persistent connections and live notification
|
||||
## in the system. It's also used by the chat system
|
||||
|
||||
channelstream.enabled = false
|
||||
## location of channelstream server on the backend
|
||||
|
||||
## server address for channelstream server on the backend
|
||||
channelstream.server = 127.0.0.1:9800
|
||||
|
||||
## location of the channelstream server from outside world
|
||||
## most likely this would be an http server special backend URL, that handles
|
||||
## websocket connections see nginx example for config
|
||||
# channelstream.ws_url = ws://rhodecode.yourserver.com/_channelstream
|
||||
## proxy path that can be used by http daemons for exposing channelstream
|
||||
# channelstream.proxy_path = /_channelstream
|
||||
## use ws:// for http or wss:// for https. This address needs to be handled
|
||||
## by external HTTP server such as Nginx or Apache
|
||||
## see nginx/apache configuration examples in our docs
|
||||
channelstream.ws_url = ws://rhodecode.yourserver.com/_channelstream
|
||||
channelstream.secret = secret
|
||||
channelstream.history.location = %(here)s/channelstream_history
|
||||
|
||||
## Internal application path that Javascript uses to connect into.
|
||||
## If you use proxy-prefix the prefix should be added before /_channelstream
|
||||
channelstream.proxy_path = /_channelstream
|
||||
|
||||
|
||||
###################################
|
||||
## APPENLIGHT CONFIG ##
|
||||
|
|
@ -501,9 +505,9 @@ appenlight.log_namespace_blacklist =
|
|||
##############
|
||||
debug_style = true
|
||||
|
||||
#########################################################
|
||||
### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ###
|
||||
#########################################################
|
||||
###########################################
|
||||
### MAIN RHODECODE DATABASE CONFIG ###
|
||||
###########################################
|
||||
#sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db?timeout=30
|
||||
#sqlalchemy.db1.url = postgresql://postgres:qweqwe@localhost/rhodecode
|
||||
#sqlalchemy.db1.url = mysql://root:qweqwe@localhost/rhodecode
|
||||
|
|
@ -586,12 +590,16 @@ svn.proxy.location_root = /
|
|||
## be killed. Setting it to zero means no timeout. Defaults to 10 seconds.
|
||||
#svn.proxy.reload_timeout = 10
|
||||
|
||||
## Dummy marker to add new entries after.
|
||||
## Add any custom entries below. Please don't remove.
|
||||
custom.conf = 1
|
||||
|
||||
|
||||
################################
|
||||
### LOGGING CONFIGURATION ####
|
||||
################################
|
||||
[loggers]
|
||||
keys = root, routes, rhodecode, sqlalchemy, beaker, pyro4, templates
|
||||
keys = root, routes, rhodecode, sqlalchemy, beaker, templates
|
||||
|
||||
[handlers]
|
||||
keys = console, console_sql
|
||||
|
|
@ -619,12 +627,6 @@ handlers =
|
|||
qualname = beaker.container
|
||||
propagate = 1
|
||||
|
||||
[logger_pyro4]
|
||||
level = DEBUG
|
||||
handlers =
|
||||
qualname = Pyro4
|
||||
propagate = 1
|
||||
|
||||
[logger_templates]
|
||||
level = INFO
|
||||
handlers =
|
||||
|
|
@ -649,13 +651,13 @@ propagate = 0
|
|||
|
||||
[handler_console]
|
||||
class = StreamHandler
|
||||
args = (sys.stderr,)
|
||||
args = (sys.stderr, )
|
||||
level = DEBUG
|
||||
formatter = color_formatter
|
||||
|
||||
[handler_console_sql]
|
||||
class = StreamHandler
|
||||
args = (sys.stderr,)
|
||||
args = (sys.stderr, )
|
||||
level = DEBUG
|
||||
formatter = color_formatter_sql
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,17 @@
|
|||
"""gunicorn config hooks"""
|
||||
"""
|
||||
gunicorn config extension and hooks. Sets additional configuration that is
|
||||
available post the .ini config.
|
||||
|
||||
- workers = ${cpu_number}
|
||||
- threads = 1
|
||||
- proc_name = ${gunicorn_proc_name}
|
||||
- worker_class = sync
|
||||
- worker_connections = 10
|
||||
- max_requests = 1000
|
||||
- max_requests_jitter = 30
|
||||
- timeout = 21600
|
||||
|
||||
"""
|
||||
|
||||
import multiprocessing
|
||||
import sys
|
||||
|
|
@ -6,50 +19,31 @@ import threading
|
|||
import traceback
|
||||
|
||||
|
||||
# GLOBAL #
|
||||
# GLOBAL
|
||||
errorlog = '-'
|
||||
accesslog = '-'
|
||||
loglevel = 'debug'
|
||||
|
||||
# SECURITY #
|
||||
# SECURITY
|
||||
limit_request_line = 4094
|
||||
limit_request_fields = 100
|
||||
limit_request_field_size = 8190
|
||||
|
||||
# SERVER MECHANICS #
|
||||
# None == system temp dir #
|
||||
# SERVER MECHANICS
|
||||
# None == system temp dir
|
||||
worker_tmp_dir = None
|
||||
tmp_upload_dir = None
|
||||
#proc_name =
|
||||
|
||||
# self adjust workers based on CPU #
|
||||
#workers = multiprocessing.cpu_count() * 2 + 1
|
||||
|
||||
access_log_format = '[%(p)s] %(h)15s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s" request_time:%(L)s'
|
||||
|
||||
# For the gevent worker classes #
|
||||
# this limits the maximum number of simultaneous clients that #
|
||||
# a single process can handle. #
|
||||
#worker_connections = 10
|
||||
|
||||
# Max requests to handle by each worker before restarting it, #
|
||||
# could prevent memory leaks #
|
||||
#max_requests = 1000
|
||||
#max_requests_jitter = 30
|
||||
|
||||
|
||||
# If a worker does not notify the master process in this #
|
||||
# number of seconds it is killed and a new worker is spawned #
|
||||
# to replace it. #
|
||||
#timeout = 3600
|
||||
|
||||
# Custom log format
|
||||
access_log_format = (
|
||||
'[%(p)-10s] %(h)s time:%(L)s %(l)s %(u)s '
|
||||
'%(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s"')
|
||||
'%(t)s GNCRN %(p)-8s %(h)-15s rqt:%(L)s %(s)s %(b)s "%(m)s:%(U)s %(q)s" usr:%(u)s "%(f)s" "%(a)s"')
|
||||
|
||||
# self adjust workers based on CPU count
|
||||
# workers = multiprocessing.cpu_count() * 2 + 1
|
||||
|
||||
|
||||
def post_fork(server, worker):
|
||||
server.log.info("[<%s>] worker spawned", worker.pid)
|
||||
server.log.info("[<%-10s>] WORKER spawned", worker.pid)
|
||||
|
||||
|
||||
def pre_fork(server, worker):
|
||||
|
|
@ -67,7 +61,7 @@ def when_ready(server):
|
|||
def worker_int(worker):
|
||||
worker.log.info("[<%-10s>] worker received INT or QUIT signal", worker.pid)
|
||||
|
||||
# get traceback info
|
||||
# get traceback info, on worker crash
|
||||
id2name = dict([(th.ident, th.name) for th in threading.enumerate()])
|
||||
code = []
|
||||
for thread_id, stack in sys._current_frames().items():
|
||||
|
|
|
|||
|
|
@ -389,19 +389,23 @@ search.location = %(here)s/data/index
|
|||
########################################
|
||||
## channelstream enables persistent connections and live notification
|
||||
## in the system. It's also used by the chat system
|
||||
|
||||
channelstream.enabled = false
|
||||
## location of channelstream server on the backend
|
||||
|
||||
## server address for channelstream server on the backend
|
||||
channelstream.server = 127.0.0.1:9800
|
||||
|
||||
## location of the channelstream server from outside world
|
||||
## most likely this would be an http server special backend URL, that handles
|
||||
## websocket connections see nginx example for config
|
||||
# channelstream.ws_url = ws://rhodecode.yourserver.com/_channelstream
|
||||
## proxy path that can be used by http daemons for exposing channelstream
|
||||
# channelstream.proxy_path = /_channelstream
|
||||
## use ws:// for http or wss:// for https. This address needs to be handled
|
||||
## by external HTTP server such as Nginx or Apache
|
||||
## see nginx/apache configuration examples in our docs
|
||||
channelstream.ws_url = ws://rhodecode.yourserver.com/_channelstream
|
||||
channelstream.secret = secret
|
||||
channelstream.history.location = %(here)s/channelstream_history
|
||||
|
||||
## Internal application path that Javascript uses to connect into.
|
||||
## If you use proxy-prefix the prefix should be added before /_channelstream
|
||||
channelstream.proxy_path = /_channelstream
|
||||
|
||||
|
||||
###################################
|
||||
## APPENLIGHT CONFIG ##
|
||||
|
|
@ -470,9 +474,9 @@ appenlight.log_namespace_blacklist =
|
|||
set debug = false
|
||||
|
||||
|
||||
#########################################################
|
||||
### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ###
|
||||
#########################################################
|
||||
###########################################
|
||||
### MAIN RHODECODE DATABASE CONFIG ###
|
||||
###########################################
|
||||
#sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db?timeout=30
|
||||
#sqlalchemy.db1.url = postgresql://postgres:qweqwe@localhost/rhodecode
|
||||
#sqlalchemy.db1.url = mysql://root:qweqwe@localhost/rhodecode
|
||||
|
|
@ -555,12 +559,16 @@ svn.proxy.location_root = /
|
|||
## be killed. Setting it to zero means no timeout. Defaults to 10 seconds.
|
||||
#svn.proxy.reload_timeout = 10
|
||||
|
||||
## Dummy marker to add new entries after.
|
||||
## Add any custom entries below. Please don't remove.
|
||||
custom.conf = 1
|
||||
|
||||
|
||||
################################
|
||||
### LOGGING CONFIGURATION ####
|
||||
################################
|
||||
[loggers]
|
||||
keys = root, routes, rhodecode, sqlalchemy, beaker, pyro4, templates
|
||||
keys = root, routes, rhodecode, sqlalchemy, beaker, templates
|
||||
|
||||
[handlers]
|
||||
keys = console, console_sql
|
||||
|
|
@ -588,12 +596,6 @@ handlers =
|
|||
qualname = beaker.container
|
||||
propagate = 1
|
||||
|
||||
[logger_pyro4]
|
||||
level = DEBUG
|
||||
handlers =
|
||||
qualname = Pyro4
|
||||
propagate = 1
|
||||
|
||||
[logger_templates]
|
||||
level = INFO
|
||||
handlers =
|
||||
|
|
@ -618,13 +620,13 @@ propagate = 0
|
|||
|
||||
[handler_console]
|
||||
class = StreamHandler
|
||||
args = (sys.stderr,)
|
||||
args = (sys.stderr, )
|
||||
level = INFO
|
||||
formatter = generic
|
||||
|
||||
[handler_console_sql]
|
||||
class = StreamHandler
|
||||
args = (sys.stderr,)
|
||||
args = (sys.stderr, )
|
||||
level = WARN
|
||||
formatter = generic
|
||||
|
||||
|
|
|
|||
|
|
@ -135,6 +135,8 @@ let
|
|||
rhodecode-testdata
|
||||
]);
|
||||
|
||||
#TODO: either move this into overrides, OR use the new machanics from
|
||||
# pip2nix and requiremtn.txt file
|
||||
propagatedBuildInputs = attrs.propagatedBuildInputs ++ (with self; [
|
||||
rhodecode-tools
|
||||
]);
|
||||
|
|
|
|||
|
|
@ -49,6 +49,12 @@ help:
|
|||
clean:
|
||||
rm -rf $(BUILDDIR)/*
|
||||
|
||||
cleanup:
|
||||
@echo "cleaning build dir"
|
||||
rm -rf $(BUILDDIR)/*
|
||||
@echo "cleaning result symlink"
|
||||
rm -v result
|
||||
|
||||
html:
|
||||
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
|
||||
@echo
|
||||
|
|
|
|||
87
docs/admin/apache-conf-example.rst
Normal file
87
docs/admin/apache-conf-example.rst
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
.. _apache-conf-eg:
|
||||
|
||||
Apache Configuration Example
|
||||
----------------------------
|
||||
|
||||
Use the following example to configure Apache as a your web server.
|
||||
Below config if for an Apache Reverse Proxy configuration.
|
||||
|
||||
.. note::
|
||||
|
||||
Apache requires the following modules to be enabled. Below is an example
|
||||
how to enable them on Ubuntu Server
|
||||
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ sudo a2enmod proxy
|
||||
$ sudo a2enmod proxy_http
|
||||
$ sudo a2enmod proxy_balancer
|
||||
$ sudo a2enmod headers
|
||||
$ sudo a2enmod ssl
|
||||
$ sudo a2enmod rewrite
|
||||
|
||||
# requires Apache 2.4+, required to handle websockets/channelstream
|
||||
$ sudo a2enmod proxy_wstunnel
|
||||
|
||||
|
||||
.. code-block:: apache
|
||||
|
||||
## HTTP to HTTPS rewrite
|
||||
<VirtualHost *:80>
|
||||
ServerName rhodecode.myserver.com
|
||||
DocumentRoot /var/www/html
|
||||
Redirect permanent / https://rhodecode.myserver.com/
|
||||
</VirtualHost>
|
||||
|
||||
## MAIN SSL enabled server
|
||||
<VirtualHost *:443>
|
||||
|
||||
ServerName rhodecode.myserver.com
|
||||
ServerAlias rhodecode.myserver.com
|
||||
|
||||
## serve static files by Apache, recommended for performance
|
||||
#Alias /_static /home/ubuntu/.rccontrol/community-1/static
|
||||
|
||||
RequestHeader set X-Forwarded-Proto "https"
|
||||
|
||||
## channelstream websocket handling
|
||||
ProxyPass /_channelstream ws://localhost:9800
|
||||
ProxyPassReverse /_channelstream ws://localhost:9800
|
||||
|
||||
<Proxy *>
|
||||
Order allow,deny
|
||||
Allow from all
|
||||
</Proxy>
|
||||
|
||||
# Directive to properly generate url (clone url) for RhodeCode
|
||||
ProxyPreserveHost On
|
||||
|
||||
# Url to running RhodeCode instance. This is shown as `- URL:` when
|
||||
# running rccontrol status.
|
||||
ProxyPass / http://127.0.0.1:10002/
|
||||
ProxyPassReverse / http://127.0.0.1:10002/
|
||||
|
||||
# strict http prevents from https -> http downgrade
|
||||
Header always set Strict-Transport-Security "max-age=63072000; includeSubdomains; preload"
|
||||
|
||||
# Set x-frame options
|
||||
Header always append X-Frame-Options SAMEORIGIN
|
||||
|
||||
# To enable https use line below
|
||||
# SetEnvIf X-Url-Scheme https HTTPS=1
|
||||
|
||||
# SSL setup
|
||||
SSLEngine On
|
||||
SSLCertificateFile /etc/apache2/ssl/rhodecode.myserver.pem
|
||||
SSLCertificateKeyFile /etc/apache2/ssl/rhodecode.myserver.key
|
||||
|
||||
SSLProtocol all -SSLv2 -SSLv3
|
||||
SSLCipherSuite ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA
|
||||
SSLHonorCipherOrder on
|
||||
|
||||
# Diffie-Hellman parameter for DHE ciphersuites, recommended 2048 bits
|
||||
#SSLOpenSSLConfCmd DHParameters "/etc/apache2/dhparam.pem"
|
||||
|
||||
</VirtualHost>
|
||||
|
||||
|
|
@ -1,114 +0,0 @@
|
|||
.. _apache-conf-eg:
|
||||
|
||||
Apache Configuration Examples
|
||||
-----------------------------
|
||||
|
||||
Use the following example to securely configure your Apache HTTP virtual hosts
|
||||
file.
|
||||
|
||||
.. code-block:: apache
|
||||
|
||||
<VirtualHost *:80>
|
||||
ServerName hg.myserver.com
|
||||
ServerAlias hg.myserver.com
|
||||
|
||||
<Proxy *>
|
||||
Order allow,deny
|
||||
Allow from all
|
||||
</Proxy>
|
||||
|
||||
# important !
|
||||
# Directive to properly generate url (clone url) for pylons
|
||||
|
||||
ProxyPreserveHost On
|
||||
|
||||
#rhodecode instance
|
||||
ProxyPass / http://127.0.0.1:5000/
|
||||
ProxyPassReverse / http://127.0.0.1:5000/
|
||||
|
||||
# Set strict HTTPS
|
||||
Header always set Strict-Transport-Security "max-age=63072000; includeSubdomains; preload"
|
||||
|
||||
# Set x-frame options
|
||||
Header always append X-Frame-Options SAMEORIGIN
|
||||
|
||||
# To enable https use line below
|
||||
# SetEnvIf X-Url-Scheme https HTTPS=1
|
||||
|
||||
# Secure your Diffie-hellmann deployment
|
||||
SSLProtocol all -SSLv2 -SSLv3
|
||||
SSLCipherSuite ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA
|
||||
SSLHonorCipherOrder on
|
||||
SSLOpenSSLConfCmd DHParameters "{path to dhparams.pem}"
|
||||
|
||||
</VirtualHost>
|
||||
|
||||
Use the following example to configure Apache for a multi-node setup. The
|
||||
timeout setting should be increased if you experience timeouts when working
|
||||
with large |repos|.
|
||||
|
||||
.. code-block:: apache
|
||||
|
||||
#
|
||||
# Timeout: The number of seconds before receives and sends time out.
|
||||
#
|
||||
Timeout 600
|
||||
|
||||
<VirtualHost *:80>
|
||||
|
||||
ProxyRequests off
|
||||
|
||||
#important !
|
||||
#Directive to properly generate url (clone url) for pylons
|
||||
ProxyPreserveHost On
|
||||
|
||||
ServerName your.rce.com
|
||||
ServerAlias your.rce.com
|
||||
|
||||
<Proxy balancer://mycluster>
|
||||
# WebHead1
|
||||
BalancerMember http://10.58.1.171:10002 route=1
|
||||
# WebHead2
|
||||
BalancerMember http://10.58.1.172:10001 route=2
|
||||
|
||||
# Security "technically we aren't blocking
|
||||
# anyone but this the place to make those
|
||||
# chages
|
||||
Order Deny,Allow
|
||||
Deny from none
|
||||
Allow from all
|
||||
|
||||
# Load Balancer Settings
|
||||
# We will be configuring a simple Round
|
||||
# Robin style load balancer. This means
|
||||
# that all webheads take an equal share of
|
||||
# of the load.
|
||||
ProxySet stickysession=ROUTEID
|
||||
|
||||
</Proxy>
|
||||
|
||||
# balancer-manager
|
||||
# This tool is built into the mod_proxy_balancer
|
||||
# module and will allow you to do some simple
|
||||
# modifications to the balanced group via a gui
|
||||
# web interface.
|
||||
<Location /balancer-manager>
|
||||
SetHandler balancer-manager
|
||||
|
||||
# recommend locking this one down to your
|
||||
# your office
|
||||
Order deny,allow
|
||||
Allow from all
|
||||
</Location>
|
||||
|
||||
# Point of Balance
|
||||
# This setting will allow to explicitly name the
|
||||
# the location in the site that we want to be
|
||||
# balanced, in this example we will balance "/"
|
||||
# or everything in the site.
|
||||
ProxyPass /balancer-manager !
|
||||
ProxyPass / balancer://mycluster/
|
||||
|
||||
ProxyPassReverse / balancer://mycluster/
|
||||
|
||||
</VirtualHost>
|
||||
|
|
@ -9,7 +9,6 @@ the information in the following sections.
|
|||
.. toctree::
|
||||
|
||||
apache-diffie-hellman
|
||||
apache-conf-examples
|
||||
apache-conf-example
|
||||
apache-subdirectory
|
||||
apache-reverse-proxy
|
||||
apache-wsgi-coding
|
||||
|
|
|
|||
|
|
@ -1,33 +0,0 @@
|
|||
Apache Reverse Proxy
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Here is a sample configuration file for using Apache as a reverse proxy.
|
||||
|
||||
.. code-block:: apache
|
||||
|
||||
<VirtualHost *:80>
|
||||
ServerName hg.myserver.com
|
||||
ServerAlias hg.myserver.com
|
||||
|
||||
## uncomment to serve static files by Apache
|
||||
## ProxyPass /_static/rhodecode !
|
||||
## Alias /_static/rhodecode /path/to/.rccontrol/enterprise-1/static
|
||||
|
||||
<Proxy *>
|
||||
Order allow,deny
|
||||
Allow from all
|
||||
</Proxy>
|
||||
|
||||
## Important !
|
||||
## Directive to properly generate url (clone url) for pylons
|
||||
ProxyPreserveHost On
|
||||
|
||||
## RhodeCode instance running
|
||||
ProxyPass / http://127.0.0.1:10002/
|
||||
ProxyPassReverse / http://127.0.0.1:10002/
|
||||
|
||||
## to enable https use line below
|
||||
#SetEnvIf X-Url-Scheme https HTTPS=1
|
||||
|
||||
</VirtualHost>
|
||||
|
||||
|
|
@ -7,7 +7,8 @@ Use the following example to configure Apache to use a URL prefix.
|
|||
|
||||
.. code-block:: apache
|
||||
|
||||
<Location /<someprefix>/ # Change <someprefix> into your chosen prefix
|
||||
# Change someprefix into your chosen prefix
|
||||
<Location /someprefix >
|
||||
ProxyPreserveHost On
|
||||
ProxyPass "http://127.0.0.1:5000/"
|
||||
ProxyPassReverse "http://127.0.0.1:5000/"
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Nginx Configuration Example
|
|||
|
||||
Use the following example to configure Nginx as a your web server.
|
||||
|
||||
|
||||
.. code-block:: nginx
|
||||
|
||||
log_format log_custom '$remote_addr - $remote_user [$time_local] '
|
||||
|
|
@ -10,8 +11,10 @@ Use the following example to configure Nginx as a your web server.
|
|||
'"$http_referer" "$http_user_agent" '
|
||||
'$request_time $upstream_response_time $pipe';
|
||||
|
||||
## define upstream (local RhodeCode instance) to connect to
|
||||
upstream rc {
|
||||
|
||||
# Url to running RhodeCode instance.
|
||||
# This is shown as `- URL:` in output from rccontrol status.
|
||||
server 127.0.0.1:10002;
|
||||
|
||||
# add more instances for load balancing
|
||||
|
|
@ -19,8 +22,17 @@ Use the following example to configure Nginx as a your web server.
|
|||
# server 127.0.0.1:10004;
|
||||
}
|
||||
|
||||
## gist alias server, for serving nicer GIST urls
|
||||
## HTTP to HTTPS rewrite
|
||||
server {
|
||||
listen 80;
|
||||
server_name rhodecode.myserver.com;
|
||||
|
||||
if ($http_host = rhodecode.myserver.com) {
|
||||
rewrite (.*) https://rhodecode.myserver.com$1 permanent;
|
||||
}
|
||||
}
|
||||
|
||||
## Optional gist alias server, for serving nicer GIST urls.
|
||||
server {
|
||||
listen 443;
|
||||
server_name gist.myserver.com;
|
||||
|
|
@ -37,6 +49,7 @@ Use the following example to configure Nginx as a your web server.
|
|||
ssl_prefer_server_ciphers on;
|
||||
ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA';
|
||||
|
||||
# strict http prevents from https -> http downgrade
|
||||
add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;";
|
||||
|
||||
# Diffie-Hellman parameter for DHE ciphersuites, recommended 2048 bits
|
||||
|
|
@ -46,15 +59,6 @@ Use the following example to configure Nginx as a your web server.
|
|||
rewrite (.*) https://rhodecode.myserver.com/_admin/gists;
|
||||
}
|
||||
|
||||
## HTTP to HTTPS rewrite
|
||||
server {
|
||||
listen 80;
|
||||
server_name rhodecode.myserver.com;
|
||||
|
||||
if ($http_host = rhodecode.myserver.com) {
|
||||
rewrite (.*) https://rhodecode.myserver.com$1 permanent;
|
||||
}
|
||||
}
|
||||
|
||||
## MAIN SSL enabled server
|
||||
server {
|
||||
|
|
@ -79,14 +83,15 @@ Use the following example to configure Nginx as a your web server.
|
|||
|
||||
include /etc/nginx/proxy.conf;
|
||||
|
||||
## serve static files by nginx, recommended
|
||||
## serve static files by Nginx, recommended for performance
|
||||
# location /_static/rhodecode {
|
||||
# alias /path/to/.rccontrol/enterprise-1/static;
|
||||
# }
|
||||
|
||||
## channel stream live components
|
||||
## channelstream websocket handling
|
||||
location /_channelstream {
|
||||
rewrite /_channelstream/(.*) /$1 break;
|
||||
|
||||
proxy_pass http://127.0.0.1:9800;
|
||||
|
||||
proxy_connect_timeout 10;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
.. _nginx-ws-ref:
|
||||
|
||||
Nginx Configuration
|
||||
===================
|
||||
Nginx HTTP Server Configuration
|
||||
-------------------------------
|
||||
|
||||
To set up your Nginx Web Server for optimal performance and security, use
|
||||
the information in the following sections.
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ it somehow becomes unavailable you can use ``ishell`` inside your |RCE|
|
|||
Logging into the |RCE| database with ``iShell`` should only be done by an
|
||||
experienced and knowledgeable database administrator.
|
||||
|
||||
|
||||
Reset Admin Account Privileges
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
|
|
@ -22,8 +23,7 @@ account permissions.
|
|||
.. code-block:: bash
|
||||
|
||||
# Open iShell from the terminal
|
||||
$ .rccontrol/enterprise-1/profile/bin/paster \
|
||||
ishell .rccontrol/enterprise-1/rhodecode.ini
|
||||
$ rccontrol ishell enterprise-1
|
||||
|
||||
.. code-block:: mysql
|
||||
|
||||
|
|
@ -33,6 +33,7 @@ account permissions.
|
|||
In [3]: Session().add(adminuser);Session().commit()
|
||||
In [4]: exit()
|
||||
|
||||
|
||||
Set to read global ``.hgrc`` file
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
|
|
@ -46,8 +47,7 @@ following example to make changes to this table.
|
|||
.. code-block:: bash
|
||||
|
||||
# Open iShell from the terminal
|
||||
$ .rccontrol/enterprise-5/profile/bin/paster \
|
||||
ishell.rccontrol/enterprise-5/rhodecode.ini
|
||||
$ rccontrol ishell enterprise-1
|
||||
|
||||
.. code-block:: mysql
|
||||
|
||||
|
|
@ -59,6 +59,7 @@ following example to make changes to this table.
|
|||
In [5]: Session().add(new_option);Session().commit()
|
||||
In [6]: exit()
|
||||
|
||||
|
||||
Manually Reset Password
|
||||
^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
|
|
@ -73,8 +74,7 @@ Use the following code example to carry out these steps.
|
|||
.. code-block:: bash
|
||||
|
||||
# starts the ishell interactive prompt
|
||||
$ .rccontrol/enterprise-1/profile/bin/paster \
|
||||
ishell .rccontrol/enterprise-1/rhodecode.ini
|
||||
$ rccontrol ishell enterprise-1
|
||||
|
||||
.. code-block:: mysql
|
||||
|
||||
|
|
@ -91,7 +91,6 @@ Use the following code example to carry out these steps.
|
|||
In [8]: exit()
|
||||
|
||||
|
||||
|
||||
Change user details
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
|
|
@ -106,8 +105,7 @@ Use the following code example to carry out these steps.
|
|||
.. code-block:: bash
|
||||
|
||||
# starts the ishell interactive prompt
|
||||
$ .rccontrol/enterprise-1/profile/bin/paster \
|
||||
ishell .rccontrol/enterprise-1/rhodecode.ini
|
||||
$ rccontrol ishell enterprise-1
|
||||
|
||||
.. code-block:: mysql
|
||||
|
||||
|
|
@ -117,3 +115,37 @@ Use the following code example to carry out these steps.
|
|||
In [3]: my_user.username = 'SomeUser'
|
||||
In [4]: Session().add(my_user);Session().commit()
|
||||
In [5]: exit()
|
||||
|
||||
|
||||
Change user login type
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Sometimes it's required to change account type from RhodeCode to LDAP or
|
||||
other external authentication type.
|
||||
If you need to manually change the method of login, use the following steps.
|
||||
|
||||
1. Navigate to your |RCE| install location.
|
||||
2. Run the interactive ``ishell`` prompt.
|
||||
3. Set a new arguments for users.
|
||||
|
||||
Use the following code example to carry out these steps.
|
||||
Available values for new_extern_type can be found when browsing available
|
||||
authentication types in RhodeCode admin interface for authentication.
|
||||
Use the text which is shown after '#' sign, eg.
|
||||
` LDAP (egg:rhodecode-enterprise-ce#ldap)` it's type is 'ldap'
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# starts the ishell interactive prompt
|
||||
$ rccontrol ishell enterprise-1
|
||||
|
||||
.. code-block:: mysql
|
||||
|
||||
# Use this example to change users from authentication
|
||||
# using rhodecode internal to ldap
|
||||
In [1]: new_extern_type = 'ldap'
|
||||
In [2]: my_user = User.get_by_username('some_username')
|
||||
In [3]: my_user.extern_type = new_extern_type
|
||||
In [4]: my_user.extern_name = new_extern_type
|
||||
In [5]: Session().add(my_user);Session().commit()
|
||||
In [6]: exit()
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ Once installed you need to enable ``dav_svn``:
|
|||
|
||||
$ sudo a2enmod dav_svn
|
||||
$ sudo a2enmod headers
|
||||
$ sudo a2enmod authn_anon
|
||||
|
||||
|
||||
Configuring Apache Setup
|
||||
|
|
@ -55,7 +56,7 @@ permission issues could occur. To do this edit the ``/etc/apache2/envvars``
|
|||
export APACHE_RUN_GROUP=rhodecode
|
||||
|
||||
1. To configure Apache, create and edit a virtual hosts file, for example
|
||||
:file:`/etc/apache2/sites-available/default.conf`. Below is an example
|
||||
:file:`/etc/apache2/sites-enabled/default.conf`. Below is an example
|
||||
how to use one with auto-generated config ```mod_dav_svn.conf```
|
||||
from configured |RCE| instance.
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ the following steps:
|
|||
.. code-block:: bash
|
||||
|
||||
# Open iShell from the terminal and set ini file
|
||||
$ .rccontrol/enterprise-1/profile/bin/paster ishell .rccontrol/enterprise-1/rhodecode.ini
|
||||
$ rccontrol ishell enterprise-1
|
||||
|
||||
2. Run the following commands, and ensure that |RCE| has write access to the
|
||||
new directory:
|
||||
|
|
|
|||
|
|
@ -3,21 +3,6 @@
|
|||
Increase Database Performance
|
||||
-----------------------------
|
||||
|
||||
To increase database performance switch to database-based user sessions.
|
||||
File-based sessions are only suitable for smaller setups. The most common
|
||||
issue being file limit errors which occur if there are lots of session files.
|
||||
Therefore, in a large scale deployment, to give better performance,
|
||||
scalability, and maintainability we recommend switching from file-based
|
||||
sessions to database-based user sessions.
|
||||
For tuning PostgreSQL we recommend reading: http://www.revsys.com/writings/postgresql-performance.html
|
||||
|
||||
To switch to database-based user sessions uncomment the following section in
|
||||
your :file:`/home/{user}/.rccontrol/{instance-id}/rhodecode.ini` file.
|
||||
|
||||
.. code-block:: ini
|
||||
|
||||
# db session
|
||||
beaker.session.type = ext:database
|
||||
|
||||
# adjust this property to include your database credentials
|
||||
beaker.session.sa.url = postgresql://postgres:<pass>@localhost/rhodecode
|
||||
beaker.session.table_name = db_session
|
||||
For tuning MySQL we recommend reading: http://www.tecmint.com/mysql-mariadb-performance-tuning-and-optimization/
|
||||
|
|
@ -34,8 +34,8 @@ performance boost.
|
|||
|
||||
.. code-block:: bash
|
||||
|
||||
# mount tmp to memory with 2GB limit and 755 write permissions
|
||||
mount -t tmpfs -o size=2G,mode=0755 tmpfs /tmp
|
||||
# mount tmp to memory with 2GB limit and 1777 write permissions
|
||||
mount -t tmpfs -o size=2G,mode=1777 tmpfs /tmp
|
||||
|
||||
For more information about TMPFS, see the documentation `here`_.
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ may find some of the following methods useful.
|
|||
|
||||
tuning-gunicorn
|
||||
tuning-vcs-memory-cache
|
||||
tuning-user-sessions-performance
|
||||
tuning-increase-db-performance
|
||||
tuning-scale-horizontally
|
||||
tuning-increase-cache-size
|
||||
|
|
|
|||
60
docs/admin/tuning-user-sessions-performance.rst
Normal file
60
docs/admin/tuning-user-sessions-performance.rst
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
.. _user-session-ref:
|
||||
|
||||
Increase User Session Performance
|
||||
---------------------------------
|
||||
|
||||
The default file-based sessions are only suitable for smaller setups, or
|
||||
instances that doesn't have a lot of users or traffic.
|
||||
They are set as default option because it's setup-free solution.
|
||||
|
||||
The most common issue of file based sessions are file limit errors which occur
|
||||
if there are lots of session files.
|
||||
|
||||
Therefore, in a large scale deployment, to give better performance,
|
||||
scalability, and maintainability we recommend switching from file-based
|
||||
sessions to database-based user sessions or memcached sessions.
|
||||
|
||||
To switch to database-based user sessions uncomment the following section in
|
||||
your :file:`/home/{user}/.rccontrol/{instance-id}/rhodecode.ini` file.
|
||||
|
||||
|
||||
.. code-block:: ini
|
||||
|
||||
## db based session, fast, and allows easy management over logged in users
|
||||
beaker.session.type = ext:database
|
||||
beaker.session.table_name = db_session
|
||||
|
||||
# use just one of the following accoring to the type of database
|
||||
beaker.session.sa.url = postgresql://postgres:secret@localhost/rhodecode
|
||||
beaker.session.sa.url = mysql://root:secret@127.0.0.1/rhodecode
|
||||
|
||||
beaker.session.sa.pool_recycle = 3600
|
||||
beaker.session.sa.echo = false
|
||||
|
||||
|
||||
and make sure you comment out the file based sessions.
|
||||
|
||||
.. code-block:: ini
|
||||
|
||||
## types are file, ext:memcached, ext:database, and memory (default).
|
||||
#beaker.session.type = file
|
||||
#beaker.session.data_dir = %(here)s/data/sessions/data
|
||||
|
||||
|
||||
To switch to memcached-based user sessions uncomment the following section in
|
||||
your :file:`/home/{user}/.rccontrol/{instance-id}/rhodecode.ini` file.
|
||||
|
||||
.. code-block:: ini
|
||||
|
||||
## memcached sessions
|
||||
beaker.session.type = ext:memcached
|
||||
beaker.session.url = localhost:11211
|
||||
|
||||
|
||||
and make sure you comment out the file based sessions.
|
||||
|
||||
.. code-block:: ini
|
||||
|
||||
## types are file, ext:memcached, ext:database, and memory (default).
|
||||
#beaker.session.type = file
|
||||
#beaker.session.data_dir = %(here)s/data/sessions/data
|
||||
|
|
@ -36,7 +36,7 @@ close_pull_request
|
|||
comment_pull_request
|
||||
--------------------
|
||||
|
||||
.. py:function:: comment_pull_request(apiuser, repoid, pullrequestid, message=<Optional:None>, status=<Optional:None>, userid=<Optional:<OptionalAttr:apiuser>>)
|
||||
.. py:function:: comment_pull_request(apiuser, repoid, pullrequestid, message=<Optional:None>, commit_id=<Optional:None>, status=<Optional:None>, comment_type=<Optional:u'note'>, resolves_comment_id=<Optional:None>, userid=<Optional:<OptionalAttr:apiuser>>)
|
||||
|
||||
Comment on the pull request specified with the `pullrequestid`,
|
||||
in the |repo| specified by the `repoid`, and optionally change the
|
||||
|
|
@ -48,15 +48,18 @@ comment_pull_request
|
|||
:type repoid: str or int
|
||||
:param pullrequestid: The pull request ID.
|
||||
:type pullrequestid: int
|
||||
:param commit_id: Specify the commit_id for which to set a comment. If
|
||||
given commit_id is different than latest in the PR status
|
||||
change won't be performed.
|
||||
:type commit_id: str
|
||||
:param message: The text content of the comment.
|
||||
:type message: str
|
||||
:param status: (**Optional**) Set the approval status of the pull
|
||||
request. Valid options are:
|
||||
* not_reviewed
|
||||
* approved
|
||||
* rejected
|
||||
* under_review
|
||||
request. One of: 'not_reviewed', 'approved', 'rejected',
|
||||
'under_review'
|
||||
:type status: str
|
||||
:param comment_type: Comment type, one of: 'note', 'todo'
|
||||
:type comment_type: Optional(str), default: 'note'
|
||||
:param userid: Comment on the pull request as this user
|
||||
:type userid: Optional(str or int)
|
||||
|
||||
|
|
@ -68,7 +71,9 @@ comment_pull_request
|
|||
result :
|
||||
{
|
||||
"pull_request_id": "<Integer>",
|
||||
"comment_id": "<Integer>"
|
||||
"comment_id": "<Integer>",
|
||||
"status": {"given": <given_status>,
|
||||
"was_changed": <bool status_was_actually_changed> },
|
||||
}
|
||||
error : null
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ add_field_to_repo
|
|||
comment_commit
|
||||
--------------
|
||||
|
||||
.. py:function:: comment_commit(apiuser, repoid, commit_id, message, userid=<Optional:<OptionalAttr:apiuser>>, status=<Optional:None>)
|
||||
.. py:function:: comment_commit(apiuser, repoid, commit_id, message, status=<Optional:None>, comment_type=<Optional:u'note'>, resolves_comment_id=<Optional:None>, userid=<Optional:<OptionalAttr:apiuser>>)
|
||||
|
||||
Set a commit comment, and optionally change the status of the commit.
|
||||
|
||||
|
|
@ -40,15 +40,17 @@ comment_commit
|
|||
:type commit_id: str
|
||||
:param message: The comment text.
|
||||
:type message: str
|
||||
:param status: (**Optional**) status of commit, one of: 'not_reviewed',
|
||||
'approved', 'rejected', 'under_review'
|
||||
:type status: str
|
||||
:param comment_type: Comment type, one of: 'note', 'todo'
|
||||
:type comment_type: Optional(str), default: 'note'
|
||||
:param userid: Set the user name of the comment creator.
|
||||
:type userid: Optional(str or int)
|
||||
:param status: status, one of 'not_reviewed', 'approved', 'rejected',
|
||||
'under_review'
|
||||
:type status: str
|
||||
|
||||
Example error output:
|
||||
|
||||
.. code-block:: json
|
||||
.. code-block:: bash
|
||||
|
||||
{
|
||||
"id" : <id_given_in_input>,
|
||||
|
|
@ -539,7 +541,7 @@ get_repo_settings
|
|||
get_repos
|
||||
---------
|
||||
|
||||
.. py:function:: get_repos(apiuser)
|
||||
.. py:function:: get_repos(apiuser, root=<Optional:None>, traverse=<Optional:True>)
|
||||
|
||||
Lists all existing repositories.
|
||||
|
||||
|
|
@ -548,6 +550,14 @@ get_repos
|
|||
|
||||
:param apiuser: This is filled automatically from the |authtoken|.
|
||||
:type apiuser: AuthUser
|
||||
:param root: specify root repository group to fetch repositories.
|
||||
filters the returned repositories to be members of given root group.
|
||||
:type root: Optional(None)
|
||||
:param traverse: traverse given root into subrepositories. With this flag
|
||||
set to False, it will only return top-level repositories from `root`.
|
||||
if root is empty it will return just top-level repositories.
|
||||
:type traverse: Optional(True)
|
||||
|
||||
|
||||
Example output:
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,49 @@
|
|||
server methods
|
||||
==============
|
||||
|
||||
cleanup_sessions
|
||||
----------------
|
||||
|
||||
.. py:function:: cleanup_sessions(apiuser, older_then=<Optional:60>)
|
||||
|
||||
Triggers a session cleanup action.
|
||||
|
||||
If the ``older_then`` option is set, only sessions that hasn't been
|
||||
accessed in the given number of days will be removed.
|
||||
|
||||
This command can only be run using an |authtoken| with admin rights to
|
||||
the specified repository.
|
||||
|
||||
This command takes the following options:
|
||||
|
||||
:param apiuser: This is filled automatically from the |authtoken|.
|
||||
:type apiuser: AuthUser
|
||||
:param older_then: Deletes session that hasn't been accessed
|
||||
in given number of days.
|
||||
:type older_then: Optional(int)
|
||||
|
||||
Example output:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
id : <id_given_in_input>
|
||||
result: {
|
||||
"backend": "<type of backend>",
|
||||
"sessions_removed": <number_of_removed_sessions>
|
||||
}
|
||||
error : null
|
||||
|
||||
Example error output:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
id : <id_given_in_input>
|
||||
result : null
|
||||
error : {
|
||||
'Error occurred during session cleanup'
|
||||
}
|
||||
|
||||
|
||||
get_ip
|
||||
------
|
||||
|
||||
|
|
|
|||
|
|
@ -47,6 +47,17 @@ Followed by::
|
|||
nix-channel --update
|
||||
|
||||
|
||||
Install required binaries
|
||||
-------------------------
|
||||
|
||||
We need some handy tools first.
|
||||
|
||||
run::
|
||||
|
||||
nix-env -i nix-prefetch-hg
|
||||
nix-env -i nix-prefetch-git
|
||||
|
||||
|
||||
Clone the required repositories
|
||||
-------------------------------
|
||||
|
||||
|
|
@ -64,6 +75,21 @@ To do this, use the following example::
|
|||
via support@rhodecode.com
|
||||
|
||||
|
||||
Install some required libraries
|
||||
-------------------------------
|
||||
|
||||
There are some required drivers that we need to install to test RhodeCode
|
||||
under different types of databases. For example in Ubuntu we need to install
|
||||
the following.
|
||||
|
||||
required libraries::
|
||||
|
||||
sudo apt-get install libapr1-dev libaprutil1-dev
|
||||
sudo apt-get install libsvn-dev
|
||||
sudo apt-get install mysql-server libmysqlclient-dev
|
||||
sudo apt-get install postgresql postgresql-contrib libpq-dev
|
||||
sudo apt-get install libcurl4-openssl-dev
|
||||
|
||||
|
||||
Enter the Development Shell
|
||||
---------------------------
|
||||
|
|
|
|||
158
docs/release-notes/release-notes-4.6.0.rst
Normal file
158
docs/release-notes/release-notes-4.6.0.rst
Normal file
|
|
@ -0,0 +1,158 @@
|
|||
|RCE| 4.6.0 |RNS|
|
||||
-----------------
|
||||
|
||||
Release Date
|
||||
^^^^^^^^^^^^
|
||||
|
||||
- 2017-02-03
|
||||
|
||||
|
||||
New Features
|
||||
^^^^^^^^^^^^
|
||||
|
||||
- Pull requests: introduced versioning for pull requests.
|
||||
Each update of pull requests creates and exposes a new version of it.
|
||||
Users can navigate each version to show the previous state of pull request, or
|
||||
generate diffs between versions to show what changed since the last update.
|
||||
Also on each update attached comments are pinned to versions, so users can
|
||||
tell at which state particular comment was made.
|
||||
Various UI/UX fixes on PR page.
|
||||
|
||||
- Pull requests: introduced new merge-checks.
|
||||
Merge checks show nicer UI for the status of merge approval.
|
||||
Merge checks now also forbid a merge if TODO notes are present.
|
||||
Submitting a status will auto-refresh merge checks, it means that it's no
|
||||
longer required to re-load diff to merge a PR.
|
||||
Same logic is now used for API, pre-conditions on show, and checks on
|
||||
actual merge API call.
|
||||
|
||||
- Code review: approval state is now bound to pull request versioning. Users
|
||||
can track their last approval and only show changes of pull requests between
|
||||
their last approval and latest state.
|
||||
- Code review: inline and main comments have now two types. a `note` and `todo`.
|
||||
unresolved TODO comments show up in pull requests or commit view.
|
||||
Unresolved TODO also prevents a PR from being merged.
|
||||
- Code review: added navigation on outdated comments.
|
||||
|
||||
- Diffs: compare mode overhaul.
|
||||
Made compare and commit range pages more consistent with other commit
|
||||
diff pages. Old diff2way is replaced by new diffs with side-by-side
|
||||
mode, and it also removes mergerly. Cleanup button behaviour on the compare
|
||||
page. Switched file-diffs to use the compare page with file filter.
|
||||
Added collapse/expand commits buttons in compare views. Generally improved UX.
|
||||
- Diffs: added a wide-mode button to expand large diffs.
|
||||
|
||||
- Comments: an overhaul of comments forms. Adjust them for new comment types and
|
||||
resolution comments.
|
||||
- Comments: replaced a ctrl+space commands with slash commands. This becomes
|
||||
more standardized and easier to use.
|
||||
|
||||
- Changelog: added load more anchors into changelog view.
|
||||
Users in changelog can now load comments via ajax and extend the data
|
||||
set to show more than 100 commits. This also re-renders the graph. So it's
|
||||
possible to show 1000s of commits in an efficient way with the DAG graph.
|
||||
|
||||
- User sessions: added interface to show, and cleanup user auth sessions.
|
||||
It's possible to show, and clean obsolete sessions. Also a cleanup of all
|
||||
sessions option were added to completely log-out all users from the system.
|
||||
|
||||
- Integrations: webhook integration have now additional setting to choose if
|
||||
the call should be made with POST or GET.
|
||||
|
||||
- API: get_repos call now allows to filter returned data by specifying a start
|
||||
root location. Additionally, a traverse flag was added to define if returned
|
||||
data should be only from top-level or recursive.
|
||||
- API: comment_type (`note` or `todo`) for comment API.
|
||||
- API: added comment_resolved_id into comments API to resolve TODO notes.
|
||||
|
||||
|
||||
General
|
||||
^^^^^^^
|
||||
|
||||
- Api: comment_pull_request, added commit_id parameter to validate status
|
||||
changed on particular commit. In case users set status on the commit
|
||||
which is not current valid head this API call won't change the status anymore.
|
||||
- Channelstream: added testing panel for live notifications.
|
||||
- Authentication: disable password change form for accounts that are not
|
||||
managed by RhodeCode, in the case of external accounts such as LDAP/oAuth,
|
||||
password reset doesn't make sense.
|
||||
- Core: let pyramid handle tracebacks for all exceptions.
|
||||
Otherwise, we'll miss exception caused in pure pyramid views.
|
||||
- Vcs server: expose remote tracebacks from HTTP backend using
|
||||
the Pyro4AwareFormatter. This will now in most cases propagate VCSServer
|
||||
exception into Enterprise logs for easier tracking of errors
|
||||
- Ishell: updated code with latest iShell changes.
|
||||
- Svn: generate HTTP downgrade via the auto-generated config. This allows
|
||||
a HTTPs/HTTP configuration with SVN.
|
||||
- Dependencies: bumped various pytest related libraries to latest versions.
|
||||
- Dependencies: bumped gevent to 1.1.2 and greenlet to 0.4.10 versions.
|
||||
- Dependencies: bumped msgpack to version 0.4.8.
|
||||
- Dependencies: bumped supervisor to 3.3.1 version.
|
||||
- Dependencies: bumped Whoosh to version 2.7.4.
|
||||
- Dependencies: bumped Markdown library to 2.6.7
|
||||
- Dependencies: bumped mako templates to 1.0.6
|
||||
- Dependencies: bumped waitress version to 1.0.1
|
||||
- Dependencies: bumped pygments to 2.2.0
|
||||
- dependencies: bumped Mercurial version to 4.0.2
|
||||
- dependencies: bumped git version to 2.9.3
|
||||
|
||||
|
||||
Security
|
||||
^^^^^^^^
|
||||
|
||||
- Login: Don't display partial password helper hash inside the logs.
|
||||
The information is not-required and will prevent people worrying about this
|
||||
shown in logs.
|
||||
- Auth: use pyramid HTTP exception when detecting CSRF errors. It helps
|
||||
catching this error by our error handler and displaying it nicely to users.
|
||||
- SVN: hide password entries in logs using specially generated configuration
|
||||
for Apache Mod-Dav
|
||||
- Permissions: fixed call to correctly check permissions for admin, before admin
|
||||
users were ban deleting of pull requests in certain conditions.
|
||||
|
||||
|
||||
Performance
|
||||
^^^^^^^^^^^
|
||||
|
||||
- Markup renderer: use global Markdown object to speed up markdown rendering.
|
||||
We'll skip heavy initialization on each render thanks to this.
|
||||
- Diffs: optimize how lexer is fetched for rich highlight mode.
|
||||
Speeds up initial diff creation significantly since lexer cache is re used
|
||||
and we don't need to fetch lexer many times.
|
||||
- VCS: do an early detection of vcs-type request.
|
||||
In case we're handling a VCS request, we can skip some of the pylons
|
||||
stack initialization, speeding the request processing.
|
||||
|
||||
|
||||
Fixes
|
||||
^^^^^
|
||||
|
||||
- Code review: render outdated comments that don't fit current context.
|
||||
Comments attached to files that were removed from pull-request now will also
|
||||
properly show up.
|
||||
- Markup renderer: don't render plaintext files as RST. This prevents plain
|
||||
Readme files have been wrongly rendered.
|
||||
- VCS: raise a better exception if file node history cannot be extracted.
|
||||
Helps to trace corrupted repositories.
|
||||
- Exception handling: nicer error catching on repository creation.
|
||||
- Fixed excessive number of session object creation. There should be now a
|
||||
significant reduction in new file or DB entries created for sessions.
|
||||
- Core: remove global timezone hook from tests. This was leaking into main
|
||||
application causing TZ problems (such as UTC log dates).
|
||||
- Pull requests: wait for all dynamic checks before enabling opening a PR.
|
||||
This ensures that all code analysis were run before users are allowed to open
|
||||
a pull request.
|
||||
- i18n: use a consistent way of setting user language.
|
||||
- API: added merge checks into API because it was not validated before and could
|
||||
return an error if the merge wasn't possible for some reason.
|
||||
- VCSServer: fetch proper locale before defaulting to default. Prevents
|
||||
errors on some machines that don't have locales set.
|
||||
- VCSServer: fixed 500 error if the wrong URL on HTTP mode vcsserver was accessed.
|
||||
|
||||
|
||||
Upgrade notes
|
||||
^^^^^^^^^^^^^
|
||||
|
||||
- Integrations: since new POST/GET option was added to integrations, users
|
||||
are advised to optionally check Webhooks integrations and pick one.
|
||||
(default is still POST)
|
||||
|
|
@ -9,6 +9,7 @@ Release Notes
|
|||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
release-notes-4.6.0.rst
|
||||
release-notes-4.5.2.rst
|
||||
release-notes-4.5.1.rst
|
||||
release-notes-4.5.0.rst
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@
|
|||
"<%= dirs.js.src %>/rhodecode/utils/os.js",
|
||||
"<%= dirs.js.src %>/rhodecode/utils/topics.js",
|
||||
"<%= dirs.js.src %>/rhodecode/init.js",
|
||||
"<%= dirs.js.src %>/rhodecode/changelog.js",
|
||||
"<%= dirs.js.src %>/rhodecode/codemirror.js",
|
||||
"<%= dirs.js.src %>/rhodecode/comments.js",
|
||||
"<%= dirs.js.src %>/rhodecode/constants.js",
|
||||
|
|
|
|||
|
|
@ -1,12 +0,0 @@
|
|||
diff --git a/requirements.txt b/requirements.txt
|
||||
--- a/requirements.txt
|
||||
+++ b/requirements.txt
|
||||
@@ -3,7 +3,7 @@ future==0.14.3
|
||||
six==1.9.0
|
||||
mako==1.0.1
|
||||
markupsafe==0.23
|
||||
-requests==2.5.1
|
||||
+requests
|
||||
whoosh==2.7.0
|
||||
elasticsearch==2.3.0
|
||||
elasticsearch-dsl==2.0.0
|
||||
|
|
@ -100,11 +100,7 @@ self: super: {
|
|||
});
|
||||
|
||||
py-gfm = super.py-gfm.override {
|
||||
src = pkgs.fetchgit {
|
||||
url = "https://code.rhodecode.com/upstream/py-gfm";
|
||||
rev = "0d66a19bc16e3d49de273c0f797d4e4781e8c0f2";
|
||||
sha256 = "0ryp74jyihd3ckszq31bml5jr3bciimhfp7va7kw6ld92930ksv3";
|
||||
};
|
||||
name = "py-gfm-0.1.3.rhodecode-upstream1";
|
||||
};
|
||||
|
||||
pycurl = super.pycurl.override (attrs: {
|
||||
|
|
@ -123,12 +119,7 @@ self: super: {
|
|||
});
|
||||
|
||||
Pylons = super.Pylons.override (attrs: {
|
||||
name = "Pylons-1.0.1-patch1";
|
||||
src = pkgs.fetchgit {
|
||||
url = "https://code.rhodecode.com/upstream/pylons";
|
||||
rev = "707354ee4261b9c10450404fc9852ccea4fd667d";
|
||||
sha256 = "b2763274c2780523a335f83a1df65be22ebe4ff413a7bc9e9288d23c1f62032e";
|
||||
};
|
||||
name = "Pylons-1.0.2.rhodecode-patch1";
|
||||
});
|
||||
|
||||
pyramid = super.pyramid.override (attrs: {
|
||||
|
|
@ -149,16 +140,6 @@ self: super: {
|
|||
};
|
||||
});
|
||||
|
||||
Pyro4 = super.Pyro4.override (attrs: {
|
||||
# TODO: Was not able to generate this version, needs further
|
||||
# investigation.
|
||||
name = "Pyro4-4.35";
|
||||
src = pkgs.fetchurl {
|
||||
url = "https://pypi.python.org/packages/source/P/Pyro4/Pyro4-4.35.src.tar.gz";
|
||||
md5 = "cbe6cb855f086a0f092ca075005855f3";
|
||||
};
|
||||
});
|
||||
|
||||
pysqlite = super.pysqlite.override (attrs: {
|
||||
propagatedBuildInputs = [
|
||||
pkgs.sqlite
|
||||
|
|
@ -202,12 +183,6 @@ self: super: {
|
|||
'';
|
||||
});
|
||||
|
||||
rhodecode-tools = super.rhodecode-tools.override (attrs: {
|
||||
patches = [
|
||||
./patch-rhodecode-tools-setup.diff
|
||||
];
|
||||
});
|
||||
|
||||
URLObject = super.URLObject.override (attrs: {
|
||||
meta = {
|
||||
license = {
|
||||
|
|
|
|||
|
|
@ -81,26 +81,26 @@
|
|||
};
|
||||
};
|
||||
Mako = super.buildPythonPackage {
|
||||
name = "Mako-1.0.1";
|
||||
name = "Mako-1.0.6";
|
||||
buildInputs = with self; [];
|
||||
doCheck = false;
|
||||
propagatedBuildInputs = with self; [MarkupSafe];
|
||||
src = fetchurl {
|
||||
url = "https://pypi.python.org/packages/8e/a4/aa56533ecaa5f22ca92428f74e074d0c9337282933c722391902c8f9e0f8/Mako-1.0.1.tar.gz";
|
||||
md5 = "9f0aafd177b039ef67b90ea350497a54";
|
||||
url = "https://pypi.python.org/packages/56/4b/cb75836863a6382199aefb3d3809937e21fa4cb0db15a4f4ba0ecc2e7e8e/Mako-1.0.6.tar.gz";
|
||||
md5 = "a28e22a339080316b2acc352b9ee631c";
|
||||
};
|
||||
meta = {
|
||||
license = [ pkgs.lib.licenses.mit ];
|
||||
};
|
||||
};
|
||||
Markdown = super.buildPythonPackage {
|
||||
name = "Markdown-2.6.2";
|
||||
name = "Markdown-2.6.7";
|
||||
buildInputs = with self; [];
|
||||
doCheck = false;
|
||||
propagatedBuildInputs = with self; [];
|
||||
src = fetchurl {
|
||||
url = "https://pypi.python.org/packages/62/8b/83658b5f6c220d5fcde9f9852d46ea54765d734cfbc5a9f4c05bfc36db4d/Markdown-2.6.2.tar.gz";
|
||||
md5 = "256d19afcc564dc4ce4c229bb762f7ae";
|
||||
url = "https://pypi.python.org/packages/48/a4/fc6b002789c2239ac620ca963694c95b8f74e4747769cdf6021276939e74/Markdown-2.6.7.zip";
|
||||
md5 = "632710a7474bbb74a82084392251061f";
|
||||
};
|
||||
meta = {
|
||||
license = [ pkgs.lib.licenses.bsdOriginal ];
|
||||
|
|
@ -133,13 +133,13 @@
|
|||
};
|
||||
};
|
||||
Paste = super.buildPythonPackage {
|
||||
name = "Paste-2.0.2";
|
||||
name = "Paste-2.0.3";
|
||||
buildInputs = with self; [];
|
||||
doCheck = false;
|
||||
propagatedBuildInputs = with self; [six];
|
||||
src = fetchurl {
|
||||
url = "https://pypi.python.org/packages/d5/8d/0f8ac40687b97ff3e07ebd1369be20bdb3f93864d2dc3c2ff542edb4ce50/Paste-2.0.2.tar.gz";
|
||||
md5 = "4bfc8a7eaf858f6309d2ac0f40fc951c";
|
||||
url = "https://pypi.python.org/packages/30/c3/5c2f7c7a02e4f58d4454353fa1c32c94f79fa4e36d07a67c0ac295ea369e/Paste-2.0.3.tar.gz";
|
||||
md5 = "1231e14eae62fa7ed76e9130b04bc61e";
|
||||
};
|
||||
meta = {
|
||||
license = [ pkgs.lib.licenses.mit ];
|
||||
|
|
@ -172,26 +172,26 @@
|
|||
};
|
||||
};
|
||||
Pygments = super.buildPythonPackage {
|
||||
name = "Pygments-2.1.3";
|
||||
name = "Pygments-2.2.0";
|
||||
buildInputs = with self; [];
|
||||
doCheck = false;
|
||||
propagatedBuildInputs = with self; [];
|
||||
src = fetchurl {
|
||||
url = "https://pypi.python.org/packages/b8/67/ab177979be1c81bc99c8d0592ef22d547e70bb4c6815c383286ed5dec504/Pygments-2.1.3.tar.gz";
|
||||
md5 = "ed3fba2467c8afcda4d317e4ef2c6150";
|
||||
url = "https://pypi.python.org/packages/71/2a/2e4e77803a8bd6408a2903340ac498cb0a2181811af7c9ec92cb70b0308a/Pygments-2.2.0.tar.gz";
|
||||
md5 = "13037baca42f16917cbd5ad2fab50844";
|
||||
};
|
||||
meta = {
|
||||
license = [ pkgs.lib.licenses.bsdOriginal ];
|
||||
};
|
||||
};
|
||||
Pylons = super.buildPythonPackage {
|
||||
name = "Pylons-1.0.1";
|
||||
name = "Pylons-1.0.2.dev20161213";
|
||||
buildInputs = with self; [];
|
||||
doCheck = false;
|
||||
propagatedBuildInputs = with self; [Routes WebHelpers Beaker Paste PasteDeploy PasteScript FormEncode simplejson decorator nose Mako WebError WebTest Tempita MarkupSafe WebOb];
|
||||
src = fetchurl {
|
||||
url = "https://pypi.python.org/packages/a2/69/b835a6bad00acbfeed3f33c6e44fa3f936efc998c795bfb15c61a79ecf62/Pylons-1.0.1.tar.gz";
|
||||
md5 = "6cb880d75fa81213192142b07a6e4915";
|
||||
url = "https://code.rhodecode.com/upstream/pylons/archive/707354ee4261b9c10450404fc9852ccea4fd667d.tar.gz?md5=f26633726fa2cd3a340316ee6a5d218f";
|
||||
md5 = "f26633726fa2cd3a340316ee6a5d218f";
|
||||
};
|
||||
meta = {
|
||||
license = [ pkgs.lib.licenses.bsdOriginal ];
|
||||
|
|
@ -341,13 +341,13 @@
|
|||
};
|
||||
};
|
||||
Whoosh = super.buildPythonPackage {
|
||||
name = "Whoosh-2.7.0";
|
||||
name = "Whoosh-2.7.4";
|
||||
buildInputs = with self; [];
|
||||
doCheck = false;
|
||||
propagatedBuildInputs = with self; [];
|
||||
src = fetchurl {
|
||||
url = "https://pypi.python.org/packages/1c/dc/2f0231ff3875ded36df8c1ab851451e51a237dc0e5a86d3d96036158da94/Whoosh-2.7.0.zip";
|
||||
md5 = "7abfd970f16fadc7311960f3fa0bc7a9";
|
||||
url = "https://pypi.python.org/packages/25/2b/6beed2107b148edc1321da0d489afc4617b9ed317ef7b72d4993cad9b684/Whoosh-2.7.4.tar.gz";
|
||||
md5 = "c2710105f20b3e29936bd2357383c325";
|
||||
};
|
||||
meta = {
|
||||
license = [ pkgs.lib.licenses.bsdOriginal pkgs.lib.licenses.bsd2 ];
|
||||
|
|
@ -639,19 +639,6 @@
|
|||
license = [ pkgs.lib.licenses.bsdOriginal ];
|
||||
};
|
||||
};
|
||||
dulwich = super.buildPythonPackage {
|
||||
name = "dulwich-0.12.0";
|
||||
buildInputs = with self; [];
|
||||
doCheck = false;
|
||||
propagatedBuildInputs = with self; [];
|
||||
src = fetchurl {
|
||||
url = "https://pypi.python.org/packages/6f/04/fbe561b6d45c0ec758330d5b7f5ba4b6cb4f1ca1ab49859d2fc16320da75/dulwich-0.12.0.tar.gz";
|
||||
md5 = "f3a8a12bd9f9dd8c233e18f3d49436fa";
|
||||
};
|
||||
meta = {
|
||||
license = [ pkgs.lib.licenses.gpl2Plus ];
|
||||
};
|
||||
};
|
||||
ecdsa = super.buildPythonPackage {
|
||||
name = "ecdsa-0.11";
|
||||
buildInputs = with self; [];
|
||||
|
|
@ -679,13 +666,13 @@
|
|||
};
|
||||
};
|
||||
elasticsearch-dsl = super.buildPythonPackage {
|
||||
name = "elasticsearch-dsl-2.0.0";
|
||||
name = "elasticsearch-dsl-2.2.0";
|
||||
buildInputs = with self; [];
|
||||
doCheck = false;
|
||||
propagatedBuildInputs = with self; [six python-dateutil elasticsearch];
|
||||
src = fetchurl {
|
||||
url = "https://pypi.python.org/packages/4e/5d/e788ae8dbe2ff4d13426db0a027533386a5c276c77a2654dc0e2007ce04a/elasticsearch-dsl-2.0.0.tar.gz";
|
||||
md5 = "4cdfec81bb35383dd3b7d02d7dc5ee68";
|
||||
url = "https://pypi.python.org/packages/66/2f/52a086968788e58461641570f45c3207a52d46ebbe9b77dc22b6a8ffda66/elasticsearch-dsl-2.2.0.tar.gz";
|
||||
md5 = "fa6bd3c87ea3caa8f0f051bc37c53221";
|
||||
};
|
||||
meta = {
|
||||
license = [ pkgs.lib.licenses.asl20 ];
|
||||
|
|
@ -731,13 +718,13 @@
|
|||
};
|
||||
};
|
||||
gevent = super.buildPythonPackage {
|
||||
name = "gevent-1.1.1";
|
||||
name = "gevent-1.1.2";
|
||||
buildInputs = with self; [];
|
||||
doCheck = false;
|
||||
propagatedBuildInputs = with self; [greenlet];
|
||||
src = fetchurl {
|
||||
url = "https://pypi.python.org/packages/12/dc/0b2e57823225de86f6e111a65d212c9e3b64847dddaa19691a6cb94b0b2e/gevent-1.1.1.tar.gz";
|
||||
md5 = "1532f5396ab4d07a231f1935483be7c3";
|
||||
url = "https://pypi.python.org/packages/43/8f/cb3224a0e6ab663547f45c10d0651cfd52633fde4283bf68d627084df8cc/gevent-1.1.2.tar.gz";
|
||||
md5 = "bb32a2f852a4997138014d5007215c6e";
|
||||
};
|
||||
meta = {
|
||||
license = [ pkgs.lib.licenses.mit ];
|
||||
|
|
@ -757,26 +744,26 @@
|
|||
};
|
||||
};
|
||||
gprof2dot = super.buildPythonPackage {
|
||||
name = "gprof2dot-2015.12.1";
|
||||
name = "gprof2dot-2016.10.13";
|
||||
buildInputs = with self; [];
|
||||
doCheck = false;
|
||||
propagatedBuildInputs = with self; [];
|
||||
src = fetchurl {
|
||||
url = "https://pypi.python.org/packages/b9/34/7bf93c1952d40fa5c95ad963f4d8344b61ef58558632402eca18e6c14127/gprof2dot-2015.12.1.tar.gz";
|
||||
md5 = "e23bf4e2f94db032750c193384b4165b";
|
||||
url = "https://pypi.python.org/packages/a0/e0/73c71baed306f0402a00a94ffc7b2be94ad1296dfcb8b46912655b93154c/gprof2dot-2016.10.13.tar.gz";
|
||||
md5 = "0125401f15fd2afe1df686a76c64a4fd";
|
||||
};
|
||||
meta = {
|
||||
license = [ { fullName = "LGPL"; } ];
|
||||
};
|
||||
};
|
||||
greenlet = super.buildPythonPackage {
|
||||
name = "greenlet-0.4.9";
|
||||
name = "greenlet-0.4.10";
|
||||
buildInputs = with self; [];
|
||||
doCheck = false;
|
||||
propagatedBuildInputs = with self; [];
|
||||
src = fetchurl {
|
||||
url = "https://pypi.python.org/packages/4e/3d/9d421539b74e33608b245092870156b2e171fb49f2b51390aa4641eecb4a/greenlet-0.4.9.zip";
|
||||
md5 = "c6659cdb2a5e591723e629d2eef22e82";
|
||||
url = "https://pypi.python.org/packages/67/62/ca2a95648666eaa2ffeb6a9b3964f21d419ae27f82f2e66b53da5b943fc4/greenlet-0.4.10.zip";
|
||||
md5 = "bed0c4b3b896702131f4d5c72f87c41d";
|
||||
};
|
||||
meta = {
|
||||
license = [ pkgs.lib.licenses.mit ];
|
||||
|
|
@ -939,13 +926,13 @@
|
|||
};
|
||||
};
|
||||
msgpack-python = super.buildPythonPackage {
|
||||
name = "msgpack-python-0.4.6";
|
||||
name = "msgpack-python-0.4.8";
|
||||
buildInputs = with self; [];
|
||||
doCheck = false;
|
||||
propagatedBuildInputs = with self; [];
|
||||
src = fetchurl {
|
||||
url = "https://pypi.python.org/packages/15/ce/ff2840885789ef8035f66cd506ea05bdb228340307d5e71a7b1e3f82224c/msgpack-python-0.4.6.tar.gz";
|
||||
md5 = "8b317669314cf1bc881716cccdaccb30";
|
||||
url = "https://pypi.python.org/packages/21/27/8a1d82041c7a2a51fcc73675875a5f9ea06c2663e02fcfeb708be1d081a0/msgpack-python-0.4.8.tar.gz";
|
||||
md5 = "dcd854fb41ee7584ebbf35e049e6be98";
|
||||
};
|
||||
meta = {
|
||||
license = [ pkgs.lib.licenses.asl20 ];
|
||||
|
|
@ -1108,13 +1095,13 @@
|
|||
};
|
||||
};
|
||||
py = super.buildPythonPackage {
|
||||
name = "py-1.4.29";
|
||||
name = "py-1.4.31";
|
||||
buildInputs = with self; [];
|
||||
doCheck = false;
|
||||
propagatedBuildInputs = with self; [];
|
||||
src = fetchurl {
|
||||
url = "https://pypi.python.org/packages/2a/bc/a1a4a332ac10069b8e5e25136a35e08a03f01fd6ab03d819889d79a1fd65/py-1.4.29.tar.gz";
|
||||
md5 = "c28e0accba523a29b35a48bb703fb96c";
|
||||
url = "https://pypi.python.org/packages/f4/9a/8dfda23f36600dd701c6722316ba8a3ab4b990261f83e7d3ffc6dfedf7ef/py-1.4.31.tar.gz";
|
||||
md5 = "5d2c63c56dc3f2115ec35c066ecd582b";
|
||||
};
|
||||
meta = {
|
||||
license = [ pkgs.lib.licenses.mit ];
|
||||
|
|
@ -1139,8 +1126,8 @@
|
|||
doCheck = false;
|
||||
propagatedBuildInputs = with self; [setuptools Markdown];
|
||||
src = fetchurl {
|
||||
url = "https://pypi.python.org/packages/12/e4/6b3d8678da04f97d7490d8264d8de51c2dc9fb91209ccee9c515c95e14c5/py-gfm-0.1.3.tar.gz";
|
||||
md5 = "e588d9e69640a241b97e2c59c22527a6";
|
||||
url = "https://code.rhodecode.com/upstream/py-gfm/archive/0d66a19bc16e3d49de273c0f797d4e4781e8c0f2.tar.gz?md5=0d0d5385bfb629eea636a80b9c2bfd16";
|
||||
md5 = "0d0d5385bfb629eea636a80b9c2bfd16";
|
||||
};
|
||||
meta = {
|
||||
license = [ pkgs.lib.licenses.bsdOriginal ];
|
||||
|
|
@ -1290,13 +1277,13 @@
|
|||
};
|
||||
};
|
||||
pytest = super.buildPythonPackage {
|
||||
name = "pytest-2.8.5";
|
||||
name = "pytest-3.0.5";
|
||||
buildInputs = with self; [];
|
||||
doCheck = false;
|
||||
propagatedBuildInputs = with self; [py];
|
||||
src = fetchurl {
|
||||
url = "https://pypi.python.org/packages/b1/3d/d7ea9b0c51e0cacded856e49859f0a13452747491e842c236bbab3714afe/pytest-2.8.5.zip";
|
||||
md5 = "8493b06f700862f1294298d6c1b715a9";
|
||||
url = "https://pypi.python.org/packages/a8/87/b7ca49efe52d2b4169f2bfc49aa5e384173c4619ea8e635f123a0dac5b75/pytest-3.0.5.tar.gz";
|
||||
md5 = "cefd527b59332688bf5db4a10aa8a7cb";
|
||||
};
|
||||
meta = {
|
||||
license = [ pkgs.lib.licenses.mit ];
|
||||
|
|
@ -1316,52 +1303,65 @@
|
|||
};
|
||||
};
|
||||
pytest-cov = super.buildPythonPackage {
|
||||
name = "pytest-cov-1.8.1";
|
||||
name = "pytest-cov-2.4.0";
|
||||
buildInputs = with self; [];
|
||||
doCheck = false;
|
||||
propagatedBuildInputs = with self; [py pytest coverage cov-core];
|
||||
propagatedBuildInputs = with self; [pytest coverage];
|
||||
src = fetchurl {
|
||||
url = "https://pypi.python.org/packages/11/4b/b04646e97f1721878eb21e9f779102d84dd044d324382263b1770a3e4838/pytest-cov-1.8.1.tar.gz";
|
||||
md5 = "76c778afa2494088270348be42d759fc";
|
||||
url = "https://pypi.python.org/packages/00/c0/2bfd1fcdb9d407b8ac8185b1cb5ff458105c6b207a9a7f0e13032de9828f/pytest-cov-2.4.0.tar.gz";
|
||||
md5 = "2fda09677d232acc99ec1b3c5831e33f";
|
||||
};
|
||||
meta = {
|
||||
license = [ pkgs.lib.licenses.mit ];
|
||||
license = [ pkgs.lib.licenses.bsdOriginal pkgs.lib.licenses.mit ];
|
||||
};
|
||||
};
|
||||
pytest-profiling = super.buildPythonPackage {
|
||||
name = "pytest-profiling-1.0.1";
|
||||
name = "pytest-profiling-1.2.2";
|
||||
buildInputs = with self; [];
|
||||
doCheck = false;
|
||||
propagatedBuildInputs = with self; [six pytest gprof2dot];
|
||||
src = fetchurl {
|
||||
url = "https://pypi.python.org/packages/d8/67/8ffab73406e22870e07fa4dc8dce1d7689b26dba8efd00161c9b6fc01ec0/pytest-profiling-1.0.1.tar.gz";
|
||||
md5 = "354404eb5b3fd4dc5eb7fffbb3d9b68b";
|
||||
url = "https://pypi.python.org/packages/73/e8/804681323bac0bc45c520ec34185ba8469008942266d0074699b204835c1/pytest-profiling-1.2.2.tar.gz";
|
||||
md5 = "0a16d7dda2d23b91e9730fa4558cf728";
|
||||
};
|
||||
meta = {
|
||||
license = [ pkgs.lib.licenses.mit ];
|
||||
};
|
||||
};
|
||||
pytest-runner = super.buildPythonPackage {
|
||||
name = "pytest-runner-2.7.1";
|
||||
name = "pytest-runner-2.9";
|
||||
buildInputs = with self; [];
|
||||
doCheck = false;
|
||||
propagatedBuildInputs = with self; [];
|
||||
src = fetchurl {
|
||||
url = "https://pypi.python.org/packages/99/6b/c4ff4418d3424d4475b7af60724fd4a5cdd91ed8e489dc9443281f0052bc/pytest-runner-2.7.1.tar.gz";
|
||||
md5 = "e56f0bc8d79a6bd91772b44ef4215c7e";
|
||||
url = "https://pypi.python.org/packages/11/d4/c335ddf94463e451109e3494e909765c3e5205787b772e3b25ee8601b86a/pytest-runner-2.9.tar.gz";
|
||||
md5 = "2212a2e34404b0960b2fdc2c469247b2";
|
||||
};
|
||||
meta = {
|
||||
license = [ pkgs.lib.licenses.mit ];
|
||||
};
|
||||
};
|
||||
pytest-sugar = super.buildPythonPackage {
|
||||
name = "pytest-sugar-0.7.1";
|
||||
buildInputs = with self; [];
|
||||
doCheck = false;
|
||||
propagatedBuildInputs = with self; [pytest termcolor];
|
||||
src = fetchurl {
|
||||
url = "https://pypi.python.org/packages/03/97/05d988b4fa870e7373e8ee4582408543b9ca2bd35c3c67b569369c6f9c49/pytest-sugar-0.7.1.tar.gz";
|
||||
md5 = "7400f7c11f3d572b2c2a3b60352d35fe";
|
||||
};
|
||||
meta = {
|
||||
license = [ pkgs.lib.licenses.bsdOriginal ];
|
||||
};
|
||||
};
|
||||
pytest-timeout = super.buildPythonPackage {
|
||||
name = "pytest-timeout-0.4";
|
||||
name = "pytest-timeout-1.2.0";
|
||||
buildInputs = with self; [];
|
||||
doCheck = false;
|
||||
propagatedBuildInputs = with self; [pytest];
|
||||
src = fetchurl {
|
||||
url = "https://pypi.python.org/packages/24/48/5f6bd4b8026a26e1dd427243d560a29a0f1b24a5c7cffca4bf049a7bb65b/pytest-timeout-0.4.tar.gz";
|
||||
md5 = "03b28aff69cbbfb959ed35ade5fde262";
|
||||
url = "https://pypi.python.org/packages/cc/b7/b2a61365ea6b6d2e8881360ae7ed8dad0327ad2df89f2f0be4a02304deb2/pytest-timeout-1.2.0.tar.gz";
|
||||
md5 = "83607d91aa163562c7ee835da57d061d";
|
||||
};
|
||||
meta = {
|
||||
license = [ pkgs.lib.licenses.mit { fullName = "DFSG approved"; } ];
|
||||
|
|
@ -1498,36 +1498,36 @@
|
|||
};
|
||||
};
|
||||
rhodecode-enterprise-ce = super.buildPythonPackage {
|
||||
name = "rhodecode-enterprise-ce-4.5.2";
|
||||
buildInputs = with self; [WebTest configobj cssselect lxml mock pytest pytest-cov pytest-runner pytest-sugar];
|
||||
name = "rhodecode-enterprise-ce-4.6.0";
|
||||
buildInputs = with self; [pytest py pytest-cov pytest-sugar pytest-runner pytest-catchlog pytest-profiling gprof2dot pytest-timeout mock WebTest cov-core coverage cssselect lxml configobj];
|
||||
doCheck = true;
|
||||
propagatedBuildInputs = with self; [Babel Beaker FormEncode Mako Markdown MarkupSafe MySQL-python Paste PasteDeploy PasteScript Pygments pygments-markdown-lexer Pylons Pyro4 Routes SQLAlchemy Tempita URLObject WebError WebHelpers WebHelpers2 WebOb WebTest Whoosh alembic amqplib anyjson appenlight-client authomatic backport-ipaddress celery channelstream colander decorator deform docutils gevent gunicorn infrae.cache ipython iso8601 kombu msgpack-python packaging psycopg2 py-gfm pycrypto pycurl pyparsing pyramid pyramid-debugtoolbar pyramid-mako pyramid-beaker pysqlite python-dateutil python-ldap python-memcached python-pam recaptcha-client repoze.lru requests simplejson subprocess32 waitress zope.cachedescriptors dogpile.cache dogpile.core psutil py-bcrypt];
|
||||
src = ./.;
|
||||
meta = {
|
||||
license = [ { fullName = "AGPLv3, and Commercial License"; } ];
|
||||
license = [ { fullName = "Affero GNU General Public License v3 or later (AGPLv3+)"; } { fullName = "AGPLv3, and Commercial License"; } ];
|
||||
};
|
||||
};
|
||||
rhodecode-tools = super.buildPythonPackage {
|
||||
name = "rhodecode-tools-0.10.2";
|
||||
name = "rhodecode-tools-0.11.0";
|
||||
buildInputs = with self; [];
|
||||
doCheck = false;
|
||||
propagatedBuildInputs = with self; [click future six Mako MarkupSafe requests Whoosh elasticsearch elasticsearch-dsl urllib3];
|
||||
propagatedBuildInputs = with self; [click future six Mako MarkupSafe requests elasticsearch elasticsearch-dsl urllib3 Whoosh];
|
||||
src = fetchurl {
|
||||
url = "https://code.rhodecode.com/rhodecode-tools-ce/archive/v0.10.2.zip";
|
||||
md5 = "d2af3985a1a32a678944d4d48870cb04";
|
||||
url = "https://code.rhodecode.com/rhodecode-tools-ce/archive/v0.11.0.tar.gz?md5=e5fd0a8363af08a0ced71b50ca9cce15";
|
||||
md5 = "e5fd0a8363af08a0ced71b50ca9cce15";
|
||||
};
|
||||
meta = {
|
||||
license = [ { fullName = "AGPLv3 and Proprietary"; } ];
|
||||
};
|
||||
};
|
||||
serpent = super.buildPythonPackage {
|
||||
name = "serpent-1.12";
|
||||
name = "serpent-1.15";
|
||||
buildInputs = with self; [];
|
||||
doCheck = false;
|
||||
propagatedBuildInputs = with self; [];
|
||||
src = fetchurl {
|
||||
url = "https://pypi.python.org/packages/3b/19/1e0e83b47c09edaef8398655088036e7e67386b5c48770218ebb339fbbd5/serpent-1.12.tar.gz";
|
||||
md5 = "05869ac7b062828b34f8f927f0457b65";
|
||||
url = "https://pypi.python.org/packages/7b/38/b2b27673a882ff2ea5871bb3e3e6b496ebbaafd1612e51990ffb158b9254/serpent-1.15.tar.gz";
|
||||
md5 = "e27b1aad5c218e16442f52abb7c7053a";
|
||||
};
|
||||
meta = {
|
||||
license = [ pkgs.lib.licenses.mit ];
|
||||
|
|
@ -1547,26 +1547,26 @@
|
|||
};
|
||||
};
|
||||
setuptools = super.buildPythonPackage {
|
||||
name = "setuptools-20.8.1";
|
||||
name = "setuptools-30.1.0";
|
||||
buildInputs = with self; [];
|
||||
doCheck = false;
|
||||
propagatedBuildInputs = with self; [];
|
||||
src = fetchurl {
|
||||
url = "https://pypi.python.org/packages/c4/19/c1bdc88b53da654df43770f941079dbab4e4788c2dcb5658fb86259894c7/setuptools-20.8.1.zip";
|
||||
md5 = "fe58a5cac0df20bb83942b252a4b0543";
|
||||
url = "https://pypi.python.org/packages/1e/43/002c8616db9a3e7be23c2556e39b90a32bb40ba0dc652de1999d5334d372/setuptools-30.1.0.tar.gz";
|
||||
md5 = "cac497f42e5096ac8df29e38d3f81c3e";
|
||||
};
|
||||
meta = {
|
||||
license = [ pkgs.lib.licenses.mit ];
|
||||
};
|
||||
};
|
||||
setuptools-scm = super.buildPythonPackage {
|
||||
name = "setuptools-scm-1.11.0";
|
||||
name = "setuptools-scm-1.15.0";
|
||||
buildInputs = with self; [];
|
||||
doCheck = false;
|
||||
propagatedBuildInputs = with self; [];
|
||||
src = fetchurl {
|
||||
url = "https://pypi.python.org/packages/cd/5f/e3a038292358058d83d764a47d09114aa5a8003ed4529518f9e580f1a94f/setuptools_scm-1.11.0.tar.gz";
|
||||
md5 = "4c5c896ba52e134bbc3507bac6400087";
|
||||
url = "https://pypi.python.org/packages/80/b7/31b6ae5fcb188e37f7e31abe75f9be90490a5456a72860fa6e643f8a3cbc/setuptools_scm-1.15.0.tar.gz";
|
||||
md5 = "b6916c78ed6253d6602444fad4279c5b";
|
||||
};
|
||||
meta = {
|
||||
license = [ pkgs.lib.licenses.mit ];
|
||||
|
|
@ -1625,18 +1625,31 @@
|
|||
};
|
||||
};
|
||||
supervisor = super.buildPythonPackage {
|
||||
name = "supervisor-3.3.0";
|
||||
name = "supervisor-3.3.1";
|
||||
buildInputs = with self; [];
|
||||
doCheck = false;
|
||||
propagatedBuildInputs = with self; [meld3];
|
||||
src = fetchurl {
|
||||
url = "https://pypi.python.org/packages/44/80/d28047d120bfcc8158b4e41127706731ee6a3419c661e0a858fb0e7c4b2d/supervisor-3.3.0.tar.gz";
|
||||
md5 = "46bac00378d1eddb616752b990c67416";
|
||||
url = "https://pypi.python.org/packages/80/37/964c0d53cbd328796b1aeb7abea4c0f7b0e8c7197ea9b0b9967b7d004def/supervisor-3.3.1.tar.gz";
|
||||
md5 = "202f760f9bf4930ec06557bac73e5cf2";
|
||||
};
|
||||
meta = {
|
||||
license = [ { fullName = "BSD-derived (http://www.repoze.org/LICENSE.txt)"; } ];
|
||||
};
|
||||
};
|
||||
termcolor = super.buildPythonPackage {
|
||||
name = "termcolor-1.1.0";
|
||||
buildInputs = with self; [];
|
||||
doCheck = false;
|
||||
propagatedBuildInputs = with self; [];
|
||||
src = fetchurl {
|
||||
url = "https://pypi.python.org/packages/8a/48/a76be51647d0eb9f10e2a4511bf3ffb8cc1e6b14e9e4fab46173aa79f981/termcolor-1.1.0.tar.gz";
|
||||
md5 = "043e89644f8909d462fbbfa511c768df";
|
||||
};
|
||||
meta = {
|
||||
license = [ pkgs.lib.licenses.mit ];
|
||||
};
|
||||
};
|
||||
traitlets = super.buildPythonPackage {
|
||||
name = "traitlets-4.3.1";
|
||||
buildInputs = with self; [];
|
||||
|
|
@ -1729,13 +1742,13 @@
|
|||
};
|
||||
};
|
||||
waitress = super.buildPythonPackage {
|
||||
name = "waitress-0.8.9";
|
||||
name = "waitress-1.0.1";
|
||||
buildInputs = with self; [];
|
||||
doCheck = false;
|
||||
propagatedBuildInputs = with self; [setuptools];
|
||||
propagatedBuildInputs = with self; [];
|
||||
src = fetchurl {
|
||||
url = "https://pypi.python.org/packages/ee/65/fc9dee74a909a1187ca51e4f15ad9c4d35476e4ab5813f73421505c48053/waitress-0.8.9.tar.gz";
|
||||
md5 = "da3f2e62b3676be5dd630703a68e2a04";
|
||||
url = "https://pypi.python.org/packages/78/7d/84d11b96c3f60164dec3bef4a859a03aeae0231aa93f57fbe0d05fa4ff36/waitress-1.0.1.tar.gz";
|
||||
md5 = "dda92358a7569669086155923a46e57c";
|
||||
};
|
||||
meta = {
|
||||
license = [ pkgs.lib.licenses.zpt21 ];
|
||||
|
|
@ -1835,30 +1848,5 @@
|
|||
|
||||
### Test requirements
|
||||
|
||||
pytest-sugar = super.buildPythonPackage {
|
||||
name = "pytest-sugar-0.7.1";
|
||||
buildInputs = with self; [];
|
||||
doCheck = false;
|
||||
propagatedBuildInputs = with self; [pytest termcolor];
|
||||
src = fetchurl {
|
||||
url = "https://pypi.python.org/packages/03/97/05d988b4fa870e7373e8ee4582408543b9ca2bd35c3c67b569369c6f9c49/pytest-sugar-0.7.1.tar.gz";
|
||||
md5 = "7400f7c11f3d572b2c2a3b60352d35fe";
|
||||
};
|
||||
meta = {
|
||||
license = [ pkgs.lib.licenses.bsdOriginal ];
|
||||
};
|
||||
};
|
||||
termcolor = super.buildPythonPackage {
|
||||
name = "termcolor-1.1.0";
|
||||
buildInputs = with self; [];
|
||||
doCheck = false;
|
||||
propagatedBuildInputs = with self; [];
|
||||
src = fetchurl {
|
||||
url = "https://pypi.python.org/packages/8a/48/a76be51647d0eb9f10e2a4511bf3ffb8cc1e6b14e9e4fab46173aa79f981/termcolor-1.1.0.tar.gz";
|
||||
md5 = "043e89644f8909d462fbbfa511c768df";
|
||||
};
|
||||
meta = {
|
||||
license = [ pkgs.lib.licenses.mit ];
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
159
requirements.txt
159
requirements.txt
|
|
@ -1,150 +1,131 @@
|
|||
Babel==1.3
|
||||
Beaker==1.7.0
|
||||
Chameleon==2.24
|
||||
CProfileV==1.0.6
|
||||
FormEncode==1.2.4
|
||||
Jinja2==2.7.3
|
||||
Mako==1.0.1
|
||||
Markdown==2.6.2
|
||||
MarkupSafe==0.23
|
||||
MySQL-python==1.2.5
|
||||
Paste==2.0.2
|
||||
PasteDeploy==1.5.2
|
||||
PasteScript==1.7.5
|
||||
Pygments==2.1.3
|
||||
pygments-markdown-lexer==0.1.0.dev39
|
||||
## core
|
||||
setuptools==30.1.0
|
||||
setuptools-scm==1.15.0
|
||||
|
||||
# TODO: This version is not available on PyPI
|
||||
# Pylons==1.0.2.dev20160108
|
||||
Pylons==1.0.1
|
||||
|
||||
# TODO: This version is not available, but newer ones are
|
||||
# Pyro4==4.35
|
||||
Pyro4==4.41
|
||||
|
||||
# TODO: This should probably not be in here
|
||||
# -e hg+https://johbo@code.rhodecode.com/johbo/rhodecode-fork@3a454bd1f17c0b2b2a951cf2b111e0320d7942a9#egg=RhodeCodeEnterprise-dev
|
||||
|
||||
Routes==1.13
|
||||
SQLAlchemy==0.9.9
|
||||
Sphinx==1.2.2
|
||||
Tempita==0.5.2
|
||||
URLObject==2.4.0
|
||||
WebError==0.10.3
|
||||
|
||||
# TODO: This is modified by us, needs a better integration. For now
|
||||
# using the latest version before.
|
||||
# WebHelpers==1.3.dev20150807
|
||||
WebHelpers==1.3
|
||||
|
||||
WebHelpers2==2.0
|
||||
WebOb==1.3.1
|
||||
WebTest==1.4.3
|
||||
Whoosh==2.7.0
|
||||
alembic==0.8.4
|
||||
amqplib==1.0.2
|
||||
anyjson==0.3.3
|
||||
appenlight-client==0.6.14
|
||||
authomatic==0.1.0.post1;
|
||||
authomatic==0.1.0.post1
|
||||
Babel==1.3
|
||||
backport-ipaddress==0.1
|
||||
bottle==0.12.8
|
||||
bumpversion==0.5.3
|
||||
Beaker==1.7.0
|
||||
celery==2.2.10
|
||||
Chameleon==2.24
|
||||
channelstream==0.5.2
|
||||
click==5.1
|
||||
colander==1.2
|
||||
configobj==5.0.6
|
||||
cov-core==1.15.0
|
||||
coverage==3.7.1
|
||||
cssselect==0.9.1
|
||||
decorator==3.4.2
|
||||
deform==2.0a2
|
||||
docutils==0.12
|
||||
dogpile.cache==0.6.1
|
||||
dogpile.core==0.4.1
|
||||
dulwich==0.12.0
|
||||
ecdsa==0.11
|
||||
FormEncode==1.2.4
|
||||
future==0.14.3
|
||||
futures==3.0.2
|
||||
gevent==1.1.1
|
||||
gprof2dot==2015.12.1
|
||||
greenlet==0.4.9
|
||||
gunicorn==19.6.0
|
||||
|
||||
# TODO: Needs subvertpy and blows up without Subversion headers,
|
||||
# actually we should not need this for Enterprise at all.
|
||||
# hgsubversion==1.8.2
|
||||
|
||||
gnureadline==6.3.3
|
||||
infrae.cache==1.0.1
|
||||
invoke==0.13.0
|
||||
ipdb==0.10.1
|
||||
ipython==5.1.0
|
||||
iso8601==0.1.11
|
||||
itsdangerous==0.24
|
||||
Jinja2==2.7.3
|
||||
kombu==1.5.1
|
||||
lxml==3.4.4
|
||||
Mako==1.0.6
|
||||
Markdown==2.6.7
|
||||
MarkupSafe==0.23
|
||||
meld3==1.0.2
|
||||
mock==1.0.1
|
||||
msgpack-python==0.4.6
|
||||
msgpack-python==0.4.8
|
||||
MySQL-python==1.2.5
|
||||
nose==1.3.6
|
||||
objgraph==2.0.0
|
||||
packaging==15.2
|
||||
paramiko==1.15.1
|
||||
Paste==2.0.3
|
||||
PasteDeploy==1.5.2
|
||||
PasteScript==1.7.5
|
||||
psutil==4.3.1
|
||||
psycopg2==2.6.1
|
||||
py==1.4.29
|
||||
py-bcrypt==0.4
|
||||
py-gfm==0.1.3
|
||||
pycrypto==2.6.1
|
||||
pycurl==7.19.5
|
||||
pyflakes==0.8.1
|
||||
pygments-markdown-lexer==0.1.0.dev39
|
||||
Pygments==2.2.0
|
||||
pyparsing==1.5.7
|
||||
pyramid==1.6.1
|
||||
pyramid-beaker==0.8
|
||||
pyramid-debugtoolbar==2.4.2
|
||||
pyramid-jinja2==2.5
|
||||
pyramid-mako==1.0.2
|
||||
pyramid==1.6.1
|
||||
pysqlite==2.6.3
|
||||
pytest==2.8.5
|
||||
pytest-runner==2.7.1
|
||||
pytest-catchlog==1.2.2
|
||||
pytest-cov==1.8.1
|
||||
pytest-profiling==1.0.1
|
||||
pytest-timeout==0.4
|
||||
python-dateutil==1.5
|
||||
python-ldap==2.4.19
|
||||
python-memcached==1.57
|
||||
python-pam==1.8.2
|
||||
pytz==2015.4
|
||||
pyzmq==14.6.0
|
||||
|
||||
# TODO: This is not available in public
|
||||
# rc-testdata==0.2.0
|
||||
|
||||
https://code.rhodecode.com/rhodecode-tools-ce/archive/v0.10.2.zip#md5=d2af3985a1a32a678944d4d48870cb04
|
||||
|
||||
|
||||
recaptcha-client==1.0.6
|
||||
repoze.lru==0.6
|
||||
requests==2.9.1
|
||||
serpent==1.12
|
||||
Routes==1.13
|
||||
setproctitle==1.1.8
|
||||
setuptools==20.8.1
|
||||
setuptools-scm==1.11.0
|
||||
simplejson==3.7.2
|
||||
six==1.9.0
|
||||
Sphinx==1.2.2
|
||||
SQLAlchemy==0.9.9
|
||||
subprocess32==3.2.6
|
||||
supervisor==3.3.0
|
||||
transifex-client==0.10
|
||||
supervisor==3.3.1
|
||||
Tempita==0.5.2
|
||||
translationstring==1.3
|
||||
trollius==1.0.4
|
||||
uWSGI==2.0.11.2
|
||||
urllib3==1.16
|
||||
URLObject==2.4.0
|
||||
venusian==1.0
|
||||
waitress==0.8.9
|
||||
WebError==0.10.3
|
||||
WebHelpers2==2.0
|
||||
WebHelpers==1.3
|
||||
WebOb==1.3.1
|
||||
Whoosh==2.7.4
|
||||
wsgiref==0.1.2
|
||||
zope.cachedescriptors==4.0.0
|
||||
zope.deprecation==4.1.2
|
||||
zope.event==4.0.3
|
||||
zope.interface==4.1.3
|
||||
|
||||
## customized/patched libs
|
||||
# our patched version of Pylons==1.0.2
|
||||
https://code.rhodecode.com/upstream/pylons/archive/707354ee4261b9c10450404fc9852ccea4fd667d.tar.gz?md5=f26633726fa2cd3a340316ee6a5d218f#egg=Pylons==1.0.2.rhodecode-patch-1
|
||||
# not released py-gfm==0.1.3
|
||||
https://code.rhodecode.com/upstream/py-gfm/archive/0d66a19bc16e3d49de273c0f797d4e4781e8c0f2.tar.gz?md5=0d0d5385bfb629eea636a80b9c2bfd16#egg=py-gfm==0.1.3.rhodecode-upstream1
|
||||
|
||||
|
||||
## cli tools
|
||||
alembic==0.8.4
|
||||
invoke==0.13.0
|
||||
bumpversion==0.5.3
|
||||
transifex-client==0.10
|
||||
|
||||
## http servers
|
||||
gevent==1.1.2
|
||||
greenlet==0.4.10
|
||||
gunicorn==19.6.0
|
||||
waitress==1.0.1
|
||||
uWSGI==2.0.11.2
|
||||
|
||||
## debug
|
||||
ipdb==0.10.1
|
||||
ipython==5.1.0
|
||||
CProfileV==1.0.6
|
||||
bottle==0.12.8
|
||||
|
||||
## rhodecode-tools, special case
|
||||
https://code.rhodecode.com/rhodecode-tools-ce/archive/v0.11.0.tar.gz?md5=e5fd0a8363af08a0ced71b50ca9cce15#egg=rhodecode-tools==0.11.0
|
||||
|
||||
## appenlight
|
||||
appenlight-client==0.6.14
|
||||
|
||||
# Pyro/Deprecated TODO(Marcink): remove in 4.7 release.
|
||||
Pyro4==4.41
|
||||
serpent==1.15
|
||||
|
||||
## test related requirements
|
||||
-r requirements_test.txt
|
||||
|
|
|
|||
17
requirements_test.txt
Normal file
17
requirements_test.txt
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
# test related requirements
|
||||
pytest==3.0.5
|
||||
py==1.4.31
|
||||
pytest-cov==2.4.0
|
||||
pytest-sugar==0.7.1
|
||||
pytest-runner==2.9.0
|
||||
pytest-catchlog==1.2.2
|
||||
pytest-profiling==1.2.2
|
||||
gprof2dot==2016.10.13
|
||||
pytest-timeout==1.2.0
|
||||
|
||||
mock==1.0.1
|
||||
WebTest==1.4.3
|
||||
cov-core==1.15.0
|
||||
coverage==3.7.1
|
||||
cssselect==0.9.1
|
||||
lxml==3.4.4
|
||||
|
|
@ -1 +1 @@
|
|||
4.5.2
|
||||
4.6.0
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
@ -51,11 +51,11 @@ PYRAMID_SETTINGS = {}
|
|||
EXTENSIONS = {}
|
||||
|
||||
__version__ = ('.'.join((str(each) for each in VERSION[:3])))
|
||||
__dbversion__ = 63 # defines current db version for migrations
|
||||
__dbversion__ = 64 # defines current db version for migrations
|
||||
__platform__ = platform.system()
|
||||
__license__ = 'AGPLv3, and Commercial License'
|
||||
__author__ = 'RhodeCode GmbH'
|
||||
__url__ = 'http://rhodecode.com'
|
||||
__url__ = 'https://code.rhodecode.com'
|
||||
|
||||
is_windows = __platform__ in ['Windows']
|
||||
is_unix = not is_windows
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2016-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2016-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
@ -39,5 +39,19 @@ def includeme(config):
|
|||
name='admin_settings_vcs_svn_generate_cfg',
|
||||
pattern=ADMIN_PREFIX + '/settings/vcs/svn_generate_cfg')
|
||||
|
||||
config.add_route(
|
||||
name='admin_settings_system',
|
||||
pattern=ADMIN_PREFIX + '/settings/system')
|
||||
config.add_route(
|
||||
name='admin_settings_system_update',
|
||||
pattern=ADMIN_PREFIX + '/settings/system/updates')
|
||||
|
||||
config.add_route(
|
||||
name='admin_settings_sessions',
|
||||
pattern=ADMIN_PREFIX + '/settings/sessions')
|
||||
config.add_route(
|
||||
name='admin_settings_sessions_cleanup',
|
||||
pattern=ADMIN_PREFIX + '/settings/sessions/cleanup')
|
||||
|
||||
# Scan module for configuration decorators.
|
||||
config.scan()
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2016-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2016-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2016-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2016-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
@ -66,6 +66,15 @@ class NavEntry(object):
|
|||
else:
|
||||
return url(self.view_name)
|
||||
|
||||
def get_localized_name(self, request):
|
||||
if hasattr(request, 'translate'):
|
||||
return request.translate(self.name)
|
||||
else:
|
||||
# TODO(marcink): Remove this after migrating to pyramid
|
||||
from pyramid.threadlocal import get_current_request
|
||||
pyramid_request = get_current_request()
|
||||
return pyramid_request.translate(self.name)
|
||||
|
||||
|
||||
@implementer(IAdminNavigationRegistry)
|
||||
class NavigationRegistry(object):
|
||||
|
|
@ -80,18 +89,22 @@ class NavigationRegistry(object):
|
|||
NavEntry('email', _('Email'), 'admin_settings_email'),
|
||||
NavEntry('hooks', _('Hooks'), 'admin_settings_hooks'),
|
||||
NavEntry('search', _('Full Text Search'), 'admin_settings_search'),
|
||||
|
||||
NavEntry('integrations', _('Integrations'),
|
||||
'global_integrations_home', pyramid=True),
|
||||
NavEntry('system', _('System Info'), 'admin_settings_system'),
|
||||
NavEntry('system', _('System Info'),
|
||||
'admin_settings_system', pyramid=True),
|
||||
NavEntry('sessions', _('User Sessions'),
|
||||
'admin_settings_sessions', pyramid=True),
|
||||
NavEntry('open_source', _('Open Source Licenses'),
|
||||
'admin_settings_open_source', pyramid=True),
|
||||
|
||||
# TODO: marcink: we disable supervisor now until the supervisor stats
|
||||
# page is fixed in the nix configuration
|
||||
# NavEntry('supervisor', _('Supervisor'), 'admin_settings_supervisor'),
|
||||
]
|
||||
|
||||
_labs_entry = NavEntry('labs', _('Labs'),
|
||||
'admin_settings_labs')
|
||||
_labs_entry = NavEntry('labs', _('Labs'), 'admin_settings_labs')
|
||||
|
||||
def __init__(self, labs_active=False):
|
||||
self._registered_entries = collections.OrderedDict([
|
||||
|
|
@ -105,7 +118,8 @@ class NavigationRegistry(object):
|
|||
self._registered_entries[entry.key] = entry
|
||||
|
||||
def get_navlist(self, request):
|
||||
navlist = [NavListEntry(i.key, i.name, i.generate_url(request))
|
||||
navlist = [NavListEntry(i.key, i.get_localized_name(request),
|
||||
i.generate_url(request))
|
||||
for i in self._registered_entries.values()]
|
||||
return navlist
|
||||
|
||||
|
|
|
|||
19
rhodecode/admin/views/__init__.py
Normal file
19
rhodecode/admin/views/__init__.py
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2016-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
# (only), as published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# This program is dual-licensed. If you wish to learn more about the
|
||||
# RhodeCode Enterprise Edition, including its added features, Support services,
|
||||
# and proprietary license terms, please see https://rhodecode.com/licenses/
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2014-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2016-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
@ -19,24 +19,10 @@
|
|||
# and proprietary license terms, please see https://rhodecode.com/licenses/
|
||||
|
||||
|
||||
"""
|
||||
Login and cookies session model for RhodeCode
|
||||
"""
|
||||
|
||||
import logging
|
||||
|
||||
from pylons import session, tmpl_context as c
|
||||
from rhodecode.model import BaseModel
|
||||
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class LoginSession(BaseModel):
|
||||
cls = None
|
||||
|
||||
def destroy_user_session(self):
|
||||
cur_user = c.rhodecode_user
|
||||
log.info('Deleting session for user: `%s`', cur_user)
|
||||
session.delete()
|
||||
class AdminSettingsView(object):
|
||||
|
||||
def __init__(self, context, request):
|
||||
self.request = request
|
||||
self.context = context
|
||||
self.session = request.session
|
||||
self._rhodecode_user = request.user
|
||||
48
rhodecode/admin/views/open_source_licenses.py
Normal file
48
rhodecode/admin/views/open_source_licenses.py
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2016-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
# (only), as published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# This program is dual-licensed. If you wish to learn more about the
|
||||
# RhodeCode Enterprise Edition, including its added features, Support services,
|
||||
# and proprietary license terms, please see https://rhodecode.com/licenses/
|
||||
|
||||
import collections
|
||||
import logging
|
||||
|
||||
from pylons import tmpl_context as c
|
||||
from pyramid.view import view_config
|
||||
|
||||
from rhodecode.admin.views.base import AdminSettingsView
|
||||
from rhodecode.admin.navigation import navigation_list
|
||||
from rhodecode.lib.auth import (LoginRequired, HasPermissionAllDecorator)
|
||||
from rhodecode.lib.utils import read_opensource_licenses
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class OpenSourceLicensesAdminSettingsView(AdminSettingsView):
|
||||
|
||||
@LoginRequired()
|
||||
@HasPermissionAllDecorator('hg.admin')
|
||||
@view_config(
|
||||
route_name='admin_settings_open_source', request_method='GET',
|
||||
renderer='rhodecode:templates/admin/settings/settings.mako')
|
||||
def open_source_licenses(self):
|
||||
c.active = 'open_source'
|
||||
c.navlist = navigation_list(self.request)
|
||||
c.opensource_licenses = collections.OrderedDict(
|
||||
sorted(read_opensource_licenses().items(), key=lambda t: t[0]))
|
||||
|
||||
return {}
|
||||
100
rhodecode/admin/views/sessions.py
Normal file
100
rhodecode/admin/views/sessions.py
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2016-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
# (only), as published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# This program is dual-licensed. If you wish to learn more about the
|
||||
# RhodeCode Enterprise Edition, including its added features, Support services,
|
||||
# and proprietary license terms, please see https://rhodecode.com/licenses/
|
||||
|
||||
import logging
|
||||
|
||||
from pylons import tmpl_context as c
|
||||
from pyramid.view import view_config
|
||||
from pyramid.httpexceptions import HTTPFound
|
||||
|
||||
from rhodecode.translation import _
|
||||
|
||||
from rhodecode.admin.views.base import AdminSettingsView
|
||||
from rhodecode.lib.auth import (
|
||||
LoginRequired, HasPermissionAllDecorator, CSRFRequired)
|
||||
from rhodecode.lib.utils2 import safe_int
|
||||
from rhodecode.lib import system_info
|
||||
from rhodecode.lib import user_sessions
|
||||
|
||||
|
||||
from rhodecode.admin.navigation import navigation_list
|
||||
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class AdminSessionSettingsView(AdminSettingsView):
|
||||
|
||||
@LoginRequired()
|
||||
@HasPermissionAllDecorator('hg.admin')
|
||||
@view_config(
|
||||
route_name='admin_settings_sessions', request_method='GET',
|
||||
renderer='rhodecode:templates/admin/settings/settings.mako')
|
||||
def settings_sessions(self):
|
||||
c.active = 'sessions'
|
||||
c.navlist = navigation_list(self.request)
|
||||
|
||||
c.cleanup_older_days = 60
|
||||
older_than_seconds = 60 * 60 * 24 * c.cleanup_older_days
|
||||
|
||||
config = system_info.rhodecode_config().get_value()['value']['config']
|
||||
c.session_model = user_sessions.get_session_handler(
|
||||
config.get('beaker.session.type', 'memory'))(config)
|
||||
|
||||
c.session_conf = c.session_model.config
|
||||
c.session_count = c.session_model.get_count()
|
||||
c.session_expired_count = c.session_model.get_expired_count(
|
||||
older_than_seconds)
|
||||
|
||||
return {}
|
||||
|
||||
@LoginRequired()
|
||||
@CSRFRequired()
|
||||
@HasPermissionAllDecorator('hg.admin')
|
||||
@view_config(
|
||||
route_name='admin_settings_sessions_cleanup', request_method='POST')
|
||||
def settings_sessions_cleanup(self):
|
||||
_ = self.request.translate
|
||||
expire_days = safe_int(self.request.params.get('expire_days'))
|
||||
|
||||
if expire_days is None:
|
||||
expire_days = 60
|
||||
|
||||
older_than_seconds = 60 * 60 * 24 * expire_days
|
||||
|
||||
config = system_info.rhodecode_config().get_value()['value']['config']
|
||||
session_model = user_sessions.get_session_handler(
|
||||
config.get('beaker.session.type', 'memory'))(config)
|
||||
|
||||
try:
|
||||
session_model.clean_sessions(
|
||||
older_than_seconds=older_than_seconds)
|
||||
self.request.session.flash(
|
||||
_('Cleaned up old sessions'), queue='success')
|
||||
except user_sessions.CleanupCommand as msg:
|
||||
self.request.session.flash(msg.message, queue='warning')
|
||||
except Exception as e:
|
||||
log.exception('Failed session cleanup')
|
||||
self.request.session.flash(
|
||||
_('Failed to cleanup up old sessions'), queue='error')
|
||||
|
||||
redirect_to = self.request.resource_path(
|
||||
self.context, route_name='admin_settings_sessions')
|
||||
return HTTPFound(redirect_to)
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2016-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2016-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
@ -18,44 +18,20 @@
|
|||
# RhodeCode Enterprise Edition, including its added features, Support services,
|
||||
# and proprietary license terms, please see https://rhodecode.com/licenses/
|
||||
|
||||
import collections
|
||||
import logging
|
||||
|
||||
from pylons import tmpl_context as c
|
||||
from pyramid.view import view_config
|
||||
|
||||
from rhodecode.svn_support.utils import generate_mod_dav_svn_config
|
||||
|
||||
from rhodecode.admin.views.base import AdminSettingsView
|
||||
from rhodecode.lib.auth import (
|
||||
LoginRequired, HasPermissionAllDecorator, CSRFRequired)
|
||||
from rhodecode.lib.utils import read_opensource_licenses
|
||||
from rhodecode.svn_support.utils import generate_mod_dav_svn_config
|
||||
from rhodecode.translation import _
|
||||
|
||||
from .navigation import navigation_list
|
||||
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class AdminSettingsView(object):
|
||||
|
||||
def __init__(self, context, request):
|
||||
self.request = request
|
||||
self.context = context
|
||||
self.session = request.session
|
||||
self._rhodecode_user = request.user
|
||||
|
||||
@LoginRequired()
|
||||
@HasPermissionAllDecorator('hg.admin')
|
||||
@view_config(
|
||||
route_name='admin_settings_open_source', request_method='GET',
|
||||
renderer='rhodecode:templates/admin/settings/settings.html')
|
||||
def open_source_licenses(self):
|
||||
c.active = 'open_source'
|
||||
c.navlist = navigation_list(self.request)
|
||||
c.opensource_licenses = collections.OrderedDict(
|
||||
sorted(read_opensource_licenses().items(), key=lambda t: t[0]))
|
||||
|
||||
return {}
|
||||
class SvnConfigAdminSettingsView(AdminSettingsView):
|
||||
|
||||
@LoginRequired()
|
||||
@CSRFRequired()
|
||||
|
|
@ -64,6 +40,7 @@ class AdminSettingsView(object):
|
|||
route_name='admin_settings_vcs_svn_generate_cfg',
|
||||
request_method='POST', renderer='json')
|
||||
def vcs_svn_generate_config(self):
|
||||
_ = self.request.translate
|
||||
try:
|
||||
generate_mod_dav_svn_config(self.request.registry)
|
||||
msg = {
|
||||
|
|
@ -72,7 +49,8 @@ class AdminSettingsView(object):
|
|||
}
|
||||
except Exception:
|
||||
log.exception(
|
||||
'Exception while generating the Apache configuration for Subversion.')
|
||||
'Exception while generating the Apache '
|
||||
'configuration for Subversion.')
|
||||
msg = {
|
||||
'message': _('Failed to generate the Apache configuration for Subversion.'),
|
||||
'level': 'error',
|
||||
202
rhodecode/admin/views/system_info.py
Normal file
202
rhodecode/admin/views/system_info.py
Normal file
|
|
@ -0,0 +1,202 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2016-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
# (only), as published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# This program is dual-licensed. If you wish to learn more about the
|
||||
# RhodeCode Enterprise Edition, including its added features, Support services,
|
||||
# and proprietary license terms, please see https://rhodecode.com/licenses/
|
||||
|
||||
import logging
|
||||
import urllib2
|
||||
import packaging.version
|
||||
|
||||
from pylons import tmpl_context as c
|
||||
from pyramid.view import view_config
|
||||
|
||||
import rhodecode
|
||||
from rhodecode.lib import helpers as h
|
||||
from rhodecode.lib.auth import (LoginRequired, HasPermissionAllDecorator)
|
||||
from rhodecode.lib.utils2 import str2bool
|
||||
from rhodecode.lib import system_info
|
||||
from rhodecode.lib.ext_json import json
|
||||
|
||||
from rhodecode.admin.views.base import AdminSettingsView
|
||||
from rhodecode.admin.navigation import navigation_list
|
||||
from rhodecode.model.settings import SettingsModel
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class AdminSystemInfoSettingsView(AdminSettingsView):
|
||||
|
||||
@staticmethod
|
||||
def get_update_data(update_url):
|
||||
"""Return the JSON update data."""
|
||||
ver = rhodecode.__version__
|
||||
log.debug('Checking for upgrade on `%s` server', update_url)
|
||||
opener = urllib2.build_opener()
|
||||
opener.addheaders = [('User-agent', 'RhodeCode-SCM/%s' % ver)]
|
||||
response = opener.open(update_url)
|
||||
response_data = response.read()
|
||||
data = json.loads(response_data)
|
||||
|
||||
return data
|
||||
|
||||
def get_update_url(self):
|
||||
settings = SettingsModel().get_all_settings()
|
||||
return settings.get('rhodecode_update_url')
|
||||
|
||||
@LoginRequired()
|
||||
@HasPermissionAllDecorator('hg.admin')
|
||||
@view_config(
|
||||
route_name='admin_settings_system', request_method='GET',
|
||||
renderer='rhodecode:templates/admin/settings/settings.mako')
|
||||
def settings_system_info(self):
|
||||
_ = self.request.translate
|
||||
|
||||
c.active = 'system'
|
||||
c.navlist = navigation_list(self.request)
|
||||
|
||||
# TODO(marcink), figure out how to allow only selected users to do this
|
||||
c.allowed_to_snapshot = self._rhodecode_user.admin
|
||||
|
||||
snapshot = str2bool(self.request.params.get('snapshot'))
|
||||
|
||||
c.rhodecode_update_url = self.get_update_url()
|
||||
server_info = system_info.get_system_info(self.request.environ)
|
||||
|
||||
for key, val in server_info.items():
|
||||
setattr(c, key, val)
|
||||
|
||||
def val(name, subkey='human_value'):
|
||||
return server_info[name][subkey]
|
||||
|
||||
def state(name):
|
||||
return server_info[name]['state']
|
||||
|
||||
def val2(name):
|
||||
val = server_info[name]['human_value']
|
||||
state = server_info[name]['state']
|
||||
return val, state
|
||||
|
||||
update_info_msg = _('Note: please make sure this server can '
|
||||
'access `${url}` for the update link to work',
|
||||
mapping=dict(url=c.rhodecode_update_url))
|
||||
c.data_items = [
|
||||
# update info
|
||||
(_('Update info'), h.literal(
|
||||
'<span class="link" id="check_for_update" >%s.</span>' % (
|
||||
_('Check for updates')) +
|
||||
'<br/> <span >%s.</span>' % (update_info_msg)
|
||||
), ''),
|
||||
|
||||
# RhodeCode specific
|
||||
(_('RhodeCode Version'), val('rhodecode_app')['text'], state('rhodecode_app')),
|
||||
(_('RhodeCode Server IP'), val('server')['server_ip'], state('server')),
|
||||
(_('RhodeCode Server ID'), val('server')['server_id'], state('server')),
|
||||
(_('RhodeCode Configuration'), val('rhodecode_config')['path'], state('rhodecode_config')),
|
||||
('', '', ''), # spacer
|
||||
|
||||
# Database
|
||||
(_('Database'), val('database')['url'], state('database')),
|
||||
(_('Database version'), val('database')['version'], state('database')),
|
||||
('', '', ''), # spacer
|
||||
|
||||
# Platform/Python
|
||||
(_('Platform'), val('platform')['name'], state('platform')),
|
||||
(_('Platform UUID'), val('platform')['uuid'], state('platform')),
|
||||
(_('Python version'), val('python')['version'], state('python')),
|
||||
(_('Python path'), val('python')['executable'], state('python')),
|
||||
('', '', ''), # spacer
|
||||
|
||||
# Systems stats
|
||||
(_('CPU'), val('cpu'), state('cpu')),
|
||||
(_('Load'), val('load')['text'], state('load')),
|
||||
(_('Memory'), val('memory')['text'], state('memory')),
|
||||
(_('Uptime'), val('uptime')['text'], state('uptime')),
|
||||
('', '', ''), # spacer
|
||||
|
||||
# Repo storage
|
||||
(_('Storage location'), val('storage')['path'], state('storage')),
|
||||
(_('Storage info'), val('storage')['text'], state('storage')),
|
||||
(_('Storage inodes'), val('storage_inodes')['text'], state('storage_inodes')),
|
||||
|
||||
(_('Gist storage location'), val('storage_gist')['path'], state('storage_gist')),
|
||||
(_('Gist storage info'), val('storage_gist')['text'], state('storage_gist')),
|
||||
|
||||
(_('Archive cache storage location'), val('storage_archive')['path'], state('storage_archive')),
|
||||
(_('Archive cache info'), val('storage_archive')['text'], state('storage_archive')),
|
||||
|
||||
(_('Temp storage location'), val('storage_temp')['path'], state('storage_temp')),
|
||||
(_('Temp storage info'), val('storage_temp')['text'], state('storage_temp')),
|
||||
|
||||
(_('Search info'), val('search')['text'], state('search')),
|
||||
(_('Search location'), val('search')['location'], state('search')),
|
||||
('', '', ''), # spacer
|
||||
|
||||
# VCS specific
|
||||
(_('VCS Backends'), val('vcs_backends'), state('vcs_backends')),
|
||||
(_('VCS Server'), val('vcs_server')['text'], state('vcs_server')),
|
||||
(_('GIT'), val('git'), state('git')),
|
||||
(_('HG'), val('hg'), state('hg')),
|
||||
(_('SVN'), val('svn'), state('svn')),
|
||||
|
||||
]
|
||||
|
||||
if snapshot:
|
||||
if c.allowed_to_snapshot:
|
||||
c.data_items.pop(0) # remove server info
|
||||
self.request.override_renderer = 'admin/settings/settings_system_snapshot.mako'
|
||||
else:
|
||||
self.request.session.flash(
|
||||
'You are not allowed to do this', queue='warning')
|
||||
return {}
|
||||
|
||||
@LoginRequired()
|
||||
@HasPermissionAllDecorator('hg.admin')
|
||||
@view_config(
|
||||
route_name='admin_settings_system_update', request_method='GET',
|
||||
renderer='rhodecode:templates/admin/settings/settings_system_update.mako')
|
||||
def settings_system_info_check_update(self):
|
||||
_ = self.request.translate
|
||||
|
||||
update_url = self.get_update_url()
|
||||
|
||||
_err = lambda s: '<div style="color:#ff8888; padding:4px 0px">{}</div>'.format(s)
|
||||
try:
|
||||
data = self.get_update_data(update_url)
|
||||
except urllib2.URLError as e:
|
||||
log.exception("Exception contacting upgrade server")
|
||||
self.request.override_renderer = 'string'
|
||||
return _err('Failed to contact upgrade server: %r' % e)
|
||||
except ValueError as e:
|
||||
log.exception("Bad data sent from update server")
|
||||
self.request.override_renderer = 'string'
|
||||
return _err('Bad data sent from update server')
|
||||
|
||||
latest = data['versions'][0]
|
||||
|
||||
c.update_url = update_url
|
||||
c.latest_data = latest
|
||||
c.latest_ver = latest['version']
|
||||
c.cur_ver = rhodecode.__version__
|
||||
c.should_upgrade = False
|
||||
|
||||
if (packaging.version.Version(c.latest_ver) >
|
||||
packaging.version.Version(c.cur_ver)):
|
||||
c.should_upgrade = True
|
||||
c.important_notices = latest['general']
|
||||
|
||||
return {}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2011-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2011-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
@ -132,7 +132,7 @@ def exception_view(exc, request):
|
|||
log.debug('json-rpc error rpc_id:%s "%s"', rpc_id, fault_message)
|
||||
elif isinstance(exc, JSONRPCValidationError):
|
||||
colander_exc = exc.colander_exception
|
||||
#TODO: think maybe of nicer way to serialize errors ?
|
||||
# TODO(marcink): think maybe of nicer way to serialize errors ?
|
||||
fault_message = colander_exc.asdict()
|
||||
log.debug('json-rpc error rpc_id:%s "%s"', rpc_id, fault_message)
|
||||
elif isinstance(exc, JSONRPCForbidden):
|
||||
|
|
@ -240,7 +240,7 @@ def request_view(request):
|
|||
message=('Missing non optional `%s` arg in JSON DATA' % arg)
|
||||
)
|
||||
|
||||
# sanitze extra passed arguments
|
||||
# sanitize extra passed arguments
|
||||
for k in request.rpc_params.keys()[:]:
|
||||
if k not in func_kwargs:
|
||||
del request.rpc_params[k]
|
||||
|
|
@ -256,7 +256,7 @@ def request_view(request):
|
|||
except JSONRPCBaseError:
|
||||
raise
|
||||
except Exception:
|
||||
log.exception('Unhandled exception occured on api call: %s', func)
|
||||
log.exception('Unhandled exception occurred on api call: %s', func)
|
||||
return jsonrpc_error(request, retid=request.rpc_id,
|
||||
message='Internal server error')
|
||||
|
||||
|
|
@ -269,9 +269,10 @@ def setup_request(request):
|
|||
We need to raise JSONRPCError here if we want to return some errors back to
|
||||
user.
|
||||
"""
|
||||
|
||||
log.debug('Executing setup request: %r', request)
|
||||
request.rpc_ip_addr = get_ip_addr(request.environ)
|
||||
# TODO: marcink, deprecate GET at some point
|
||||
# TODO(marcink): deprecate GET at some point
|
||||
if request.method not in ['POST', 'GET']:
|
||||
log.debug('unsupported request method "%s"', request.method)
|
||||
raise JSONRPCError(
|
||||
|
|
@ -308,6 +309,8 @@ def setup_request(request):
|
|||
if not api_key:
|
||||
raise KeyError('api_key or auth_token')
|
||||
|
||||
# TODO(marcink): support passing in token in request header
|
||||
|
||||
request.rpc_api_key = api_key
|
||||
request.rpc_id = json_body['id']
|
||||
request.rpc_method = json_body['method']
|
||||
|
|
@ -485,8 +488,7 @@ def includeme(config):
|
|||
config.registry.jsonrpc_methods = OrderedDict()
|
||||
|
||||
# match filter by given method only
|
||||
config.add_view_predicate(
|
||||
'jsonrpc_method', MethodPredicate)
|
||||
config.add_view_predicate('jsonrpc_method', MethodPredicate)
|
||||
|
||||
config.add_renderer(DEFAULT_RENDERER, ExtJsonRenderer(
|
||||
serializer=json.dumps, indent=4))
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2011-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2011-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
|
|||
44
rhodecode/api/tests/test_cleanup_sessions.py
Normal file
44
rhodecode/api/tests/test_cleanup_sessions.py
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2017-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
# (only), as published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# This program is dual-licensed. If you wish to learn more about the
|
||||
# RhodeCode Enterprise Edition, including its added features, Support services,
|
||||
# and proprietary license terms, please see https://rhodecode.com/licenses/
|
||||
|
||||
import mock
|
||||
import pytest
|
||||
|
||||
from rhodecode.lib.user_sessions import FileAuthSessions
|
||||
from rhodecode.api.tests.utils import (
|
||||
build_data, api_call, assert_ok, assert_error, crash)
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("testuser_api", "app")
|
||||
class TestCleanupSessions(object):
|
||||
def test_api_cleanup_sessions(self):
|
||||
id_, params = build_data(self.apikey, 'cleanup_sessions')
|
||||
response = api_call(self.app, params)
|
||||
|
||||
expected = {'backend': 'file sessions', 'sessions_removed': 0}
|
||||
assert_ok(id_, expected, given=response.body)
|
||||
|
||||
@mock.patch.object(FileAuthSessions, 'clean_sessions', crash)
|
||||
def test_api_cleanup_error(self):
|
||||
id_, params = build_data(self.apikey, 'cleanup_sessions', )
|
||||
response = api_call(self.app, params)
|
||||
|
||||
expected = 'Error occurred during session cleanup'
|
||||
assert_error(id_, expected, given=response.body)
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
import pytest
|
||||
|
||||
from rhodecode.model.comment import ChangesetCommentsModel
|
||||
from rhodecode.model.comment import CommentsModel
|
||||
from rhodecode.model.db import UserLog
|
||||
from rhodecode.model.pull_request import PullRequestModel
|
||||
from rhodecode.tests import TEST_USER_ADMIN_LOGIN
|
||||
|
|
@ -52,13 +52,13 @@ class TestCommentPullRequest(object):
|
|||
response = api_call(self.app, params)
|
||||
pull_request = PullRequestModel().get(pull_request.pull_request_id)
|
||||
|
||||
comments = ChangesetCommentsModel().get_comments(
|
||||
comments = CommentsModel().get_comments(
|
||||
pull_request.target_repo.repo_id, pull_request=pull_request)
|
||||
|
||||
expected = {
|
||||
'pull_request_id': pull_request.pull_request_id,
|
||||
'comment_id': comments[-1].comment_id,
|
||||
'status': None
|
||||
'status': {'given': None, 'was_changed': None}
|
||||
}
|
||||
assert_ok(id_, expected, response.body)
|
||||
|
||||
|
|
@ -83,12 +83,61 @@ class TestCommentPullRequest(object):
|
|||
response = api_call(self.app, params)
|
||||
pull_request = PullRequestModel().get(pull_request_id)
|
||||
|
||||
comments = ChangesetCommentsModel().get_comments(
|
||||
comments = CommentsModel().get_comments(
|
||||
pull_request.target_repo.repo_id, pull_request=pull_request)
|
||||
expected = {
|
||||
'pull_request_id': pull_request.pull_request_id,
|
||||
'comment_id': comments[-1].comment_id,
|
||||
'status': 'rejected'
|
||||
'status': {'given': 'rejected', 'was_changed': True}
|
||||
}
|
||||
assert_ok(id_, expected, response.body)
|
||||
|
||||
@pytest.mark.backends("git", "hg")
|
||||
def test_api_comment_pull_request_change_status_with_specific_commit_id(
|
||||
self, pr_util, no_notifications):
|
||||
pull_request = pr_util.create_pull_request()
|
||||
pull_request_id = pull_request.pull_request_id
|
||||
latest_commit_id = 'test_commit'
|
||||
# inject additional revision, to fail test the status change on
|
||||
# non-latest commit
|
||||
pull_request.revisions = pull_request.revisions + ['test_commit']
|
||||
|
||||
id_, params = build_data(
|
||||
self.apikey, 'comment_pull_request',
|
||||
repoid=pull_request.target_repo.repo_name,
|
||||
pullrequestid=pull_request.pull_request_id,
|
||||
status='approved', commit_id=latest_commit_id)
|
||||
response = api_call(self.app, params)
|
||||
pull_request = PullRequestModel().get(pull_request_id)
|
||||
|
||||
expected = {
|
||||
'pull_request_id': pull_request.pull_request_id,
|
||||
'comment_id': None,
|
||||
'status': {'given': 'approved', 'was_changed': False}
|
||||
}
|
||||
assert_ok(id_, expected, response.body)
|
||||
|
||||
@pytest.mark.backends("git", "hg")
|
||||
def test_api_comment_pull_request_change_status_with_specific_commit_id(
|
||||
self, pr_util, no_notifications):
|
||||
pull_request = pr_util.create_pull_request()
|
||||
pull_request_id = pull_request.pull_request_id
|
||||
latest_commit_id = pull_request.revisions[0]
|
||||
|
||||
id_, params = build_data(
|
||||
self.apikey, 'comment_pull_request',
|
||||
repoid=pull_request.target_repo.repo_name,
|
||||
pullrequestid=pull_request.pull_request_id,
|
||||
status='approved', commit_id=latest_commit_id)
|
||||
response = api_call(self.app, params)
|
||||
pull_request = PullRequestModel().get(pull_request_id)
|
||||
|
||||
comments = CommentsModel().get_comments(
|
||||
pull_request.target_repo.repo_id, pull_request=pull_request)
|
||||
expected = {
|
||||
'pull_request_id': pull_request.pull_request_id,
|
||||
'comment_id': comments[-1].comment_id,
|
||||
'status': {'given': 'approved', 'was_changed': True}
|
||||
}
|
||||
assert_ok(id_, expected, response.body)
|
||||
|
||||
|
|
@ -103,7 +152,7 @@ class TestCommentPullRequest(object):
|
|||
pullrequestid=pull_request_id)
|
||||
response = api_call(self.app, params)
|
||||
|
||||
expected = 'message and status parameter missing'
|
||||
expected = 'Both message and status parameters are missing. At least one is required.'
|
||||
assert_error(id_, expected, given=response.body)
|
||||
|
||||
@pytest.mark.backends("git", "hg")
|
||||
|
|
@ -118,7 +167,7 @@ class TestCommentPullRequest(object):
|
|||
status='42')
|
||||
response = api_call(self.app, params)
|
||||
|
||||
expected = 'unknown comment status`42`'
|
||||
expected = 'Unknown comment status: `42`'
|
||||
assert_error(id_, expected, given=response.body)
|
||||
|
||||
@pytest.mark.backends("git", "hg")
|
||||
|
|
@ -144,3 +193,17 @@ class TestCommentPullRequest(object):
|
|||
|
||||
expected = 'userid is not the same as your user'
|
||||
assert_error(id_, expected, given=response.body)
|
||||
|
||||
@pytest.mark.backends("git", "hg")
|
||||
def test_api_comment_pull_request_wrong_commit_id_error(self, pr_util):
|
||||
pull_request = pr_util.create_pull_request()
|
||||
id_, params = build_data(
|
||||
self.apikey_regular, 'comment_pull_request',
|
||||
repoid=pull_request.target_repo.repo_name,
|
||||
status='approved',
|
||||
pullrequestid=pull_request.pull_request_id,
|
||||
commit_id='XXX')
|
||||
response = api_call(self.app, params)
|
||||
|
||||
expected = 'Invalid commit_id `XXX` for this pull request.'
|
||||
assert_error(id_, expected, given=response.body)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
@ -22,7 +22,8 @@
|
|||
import pytest
|
||||
|
||||
from rhodecode.model.repo import RepoModel
|
||||
from rhodecode.api.tests.utils import build_data, api_call, assert_ok, jsonify
|
||||
from rhodecode.api.tests.utils import (
|
||||
build_data, api_call, assert_ok, assert_error, jsonify)
|
||||
from rhodecode.model.db import User
|
||||
|
||||
|
||||
|
|
@ -40,6 +41,76 @@ class TestGetRepos(object):
|
|||
expected = ret
|
||||
assert_ok(id_, expected, given=response.body)
|
||||
|
||||
def test_api_get_repos_only_toplevel(self, user_util):
|
||||
repo_group = user_util.create_repo_group(auto_cleanup=True)
|
||||
user_util.create_repo(parent=repo_group)
|
||||
|
||||
id_, params = build_data(self.apikey, 'get_repos', traverse=0)
|
||||
response = api_call(self.app, params)
|
||||
|
||||
result = []
|
||||
for repo in RepoModel().get_repos_for_root(root=None):
|
||||
result.append(repo.get_api_data(include_secrets=True))
|
||||
expected = jsonify(result)
|
||||
|
||||
assert_ok(id_, expected, given=response.body)
|
||||
|
||||
def test_api_get_repos_with_wrong_root(self):
|
||||
id_, params = build_data(self.apikey, 'get_repos', root='abracadabra')
|
||||
response = api_call(self.app, params)
|
||||
|
||||
expected = 'Root repository group `abracadabra` does not exist'
|
||||
assert_error(id_, expected, given=response.body)
|
||||
|
||||
def test_api_get_repos_with_root(self, user_util):
|
||||
repo_group = user_util.create_repo_group(auto_cleanup=True)
|
||||
repo_group_name = repo_group.group_name
|
||||
|
||||
user_util.create_repo(parent=repo_group)
|
||||
user_util.create_repo(parent=repo_group)
|
||||
|
||||
# nested, should not show up
|
||||
user_util._test_name = '{}/'.format(repo_group_name)
|
||||
sub_repo_group = user_util.create_repo_group(auto_cleanup=True)
|
||||
user_util.create_repo(parent=sub_repo_group)
|
||||
|
||||
id_, params = build_data(self.apikey, 'get_repos',
|
||||
root=repo_group_name, traverse=0)
|
||||
response = api_call(self.app, params)
|
||||
|
||||
result = []
|
||||
for repo in RepoModel().get_repos_for_root(repo_group):
|
||||
result.append(repo.get_api_data(include_secrets=True))
|
||||
|
||||
assert len(result) == 2
|
||||
expected = jsonify(result)
|
||||
assert_ok(id_, expected, given=response.body)
|
||||
|
||||
def test_api_get_repos_with_root_and_traverse(self, user_util):
|
||||
repo_group = user_util.create_repo_group(auto_cleanup=True)
|
||||
repo_group_name = repo_group.group_name
|
||||
|
||||
user_util.create_repo(parent=repo_group)
|
||||
user_util.create_repo(parent=repo_group)
|
||||
|
||||
# nested, should not show up
|
||||
user_util._test_name = '{}/'.format(repo_group_name)
|
||||
sub_repo_group = user_util.create_repo_group(auto_cleanup=True)
|
||||
user_util.create_repo(parent=sub_repo_group)
|
||||
|
||||
id_, params = build_data(self.apikey, 'get_repos',
|
||||
root=repo_group_name, traverse=1)
|
||||
response = api_call(self.app, params)
|
||||
|
||||
result = []
|
||||
for repo in RepoModel().get_repos_for_root(
|
||||
repo_group_name, traverse=True):
|
||||
result.append(repo.get_api_data(include_secrets=True))
|
||||
|
||||
assert len(result) == 3
|
||||
expected = jsonify(result)
|
||||
assert_ok(id_, expected, given=response.body)
|
||||
|
||||
def test_api_get_repos_non_admin(self):
|
||||
id_, params = build_data(self.apikey_regular, 'get_repos')
|
||||
response = api_call(self.app, params)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
@ -20,18 +20,17 @@
|
|||
|
||||
import pytest
|
||||
|
||||
from rhodecode.model.db import UserLog
|
||||
from rhodecode.model.db import UserLog, PullRequest
|
||||
from rhodecode.model.meta import Session
|
||||
from rhodecode.model.pull_request import PullRequestModel
|
||||
from rhodecode.tests import TEST_USER_ADMIN_LOGIN
|
||||
from rhodecode.api.tests.utils import (
|
||||
build_data, api_call, assert_error)
|
||||
build_data, api_call, assert_error, assert_ok)
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("testuser_api", "app")
|
||||
class TestMergePullRequest(object):
|
||||
@pytest.mark.backends("git", "hg")
|
||||
def test_api_merge_pull_request(self, pr_util, no_notifications):
|
||||
def test_api_merge_pull_request_merge_failed(self, pr_util, no_notifications):
|
||||
pull_request = pr_util.create_pull_request(mergeable=True)
|
||||
author = pull_request.user_id
|
||||
repo = pull_request.target_repo.repo_id
|
||||
|
|
@ -51,6 +50,41 @@ class TestMergePullRequest(object):
|
|||
# it.
|
||||
Session().add(pull_request)
|
||||
|
||||
expected = 'merge not possible for following reasons: ' \
|
||||
'Pull request reviewer approval is pending.'
|
||||
assert_error(id_, expected, given=response.body)
|
||||
|
||||
@pytest.mark.backends("git", "hg")
|
||||
def test_api_merge_pull_request(self, pr_util, no_notifications):
|
||||
pull_request = pr_util.create_pull_request(mergeable=True, approved=True)
|
||||
author = pull_request.user_id
|
||||
repo = pull_request.target_repo.repo_id
|
||||
pull_request_id = pull_request.pull_request_id
|
||||
pull_request_repo = pull_request.target_repo.repo_name
|
||||
|
||||
id_, params = build_data(
|
||||
self.apikey, 'comment_pull_request',
|
||||
repoid=pull_request_repo,
|
||||
pullrequestid=pull_request_id,
|
||||
status='approved')
|
||||
|
||||
response = api_call(self.app, params)
|
||||
expected = {
|
||||
'comment_id': response.json.get('result', {}).get('comment_id'),
|
||||
'pull_request_id': pull_request_id,
|
||||
'status': {'given': 'approved', 'was_changed': True}
|
||||
}
|
||||
assert_ok(id_, expected, given=response.body)
|
||||
|
||||
id_, params = build_data(
|
||||
self.apikey, 'merge_pull_request',
|
||||
repoid=pull_request_repo,
|
||||
pullrequestid=pull_request_id)
|
||||
|
||||
response = api_call(self.app, params)
|
||||
|
||||
pull_request = PullRequest.get(pull_request_id)
|
||||
|
||||
expected = {
|
||||
'executed': True,
|
||||
'failure_reason': 0,
|
||||
|
|
@ -59,8 +93,7 @@ class TestMergePullRequest(object):
|
|||
'merge_ref': pull_request.shadow_merge_ref._asdict()
|
||||
}
|
||||
|
||||
response_json = response.json['result']
|
||||
assert response_json == expected
|
||||
assert_ok(id_, expected, response.body)
|
||||
|
||||
action = 'user_merged_pull_request:%d' % (pull_request_id, )
|
||||
journal = UserLog.query()\
|
||||
|
|
@ -75,8 +108,7 @@ class TestMergePullRequest(object):
|
|||
repoid=pull_request_repo, pullrequestid=pull_request_id)
|
||||
response = api_call(self.app, params)
|
||||
|
||||
expected = 'pull request `%s` merge failed, pull request is closed' % (
|
||||
pull_request_id)
|
||||
expected = 'merge not possible for following reasons: This pull request is closed.'
|
||||
assert_error(id_, expected, given=response.body)
|
||||
|
||||
@pytest.mark.backends("git", "hg")
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2010-2016 RhodeCode GmbH
|
||||
# Copyright (C) 2010-2017 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License, version 3
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue