Skip to content

Commit 7b9e975

Browse files
authored
Stable Release Part 1.0.0 (#221)
* Adjust request & response logs. * Different way for exception handling. * Replace app.modules.core.response.Response with app.controllers.controller.Controller * Adjust api.private.v1.* to use app.controllers.controller.Controller * Add log filter. * Move app.modules.core.Request functionality to app.controllers.controller.Controller * Move app.modules.core.Context functionality to app.controllers.controller.Controller * Add Request Id to all logs.
1 parent 2bd06e9 commit 7b9e975

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+1399
-1856
lines changed

.env.docker

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ DJANGO_LOGGING_LEVEL=warning
2929
DJANGO_LOGGING_PROPAGATE=false
3030

3131
APP_LOGGING_HANDLERS=file
32-
APP_LOGGING_LEVEL=warning
32+
APP_LOGGING_LEVEL=info
3333
APP_LOGGING_PROPAGATE=true
3434

3535
ACTIVATE_NOTIFICATIONS=false

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ DJANGO_LOGGING_LEVEL=warning
2929
DJANGO_LOGGING_PROPAGATE=false
3030

3131
APP_LOGGING_HANDLERS=file
32-
APP_LOGGING_LEVEL=warning
32+
APP_LOGGING_LEVEL=info
3333
APP_LOGGING_PROPAGATE=true
3434

3535
ACTIVATE_NOTIFICATIONS=false

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ before_script:
4242
# command to run tests
4343
script:
4444
- make ci
45+
- cat storage/logs/*.log
4546

4647
# Push the results back to coveralls
4748
after_success:

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44
<p align="center">A Status and Incident Communication Tool.</p>
55
<p align="center">
66
<a href="https://travis-ci.org/silverbackhq/Silverback"><img src="https://travis-ci.org/silverbackhq/Silverback.svg?branch=master"></a>
7-
<a href='https://coveralls.io/github/silverbackhq/silverback?branch=master'><img src='https://coveralls.io/repos/github/silverbackhq/silverback/badge.svg?branch=master' alt='Coverage Status' /></a>
8-
<a href="https://hub.docker.com/r/clivern/silverback"><img src="https://img.shields.io/badge/Docker-Latest-orange"></a>
7+
<a href="https://sonarcloud.io/dashboard?id=silverbackhq_silverback"><img src="https://sonarcloud.io/api/project_badges/measure?project=silverbackhq_silverback&metric=alert_status"></a>
8+
<a href='https://coveralls.io/github/silverbackhq/silverback?branch=master'><img src='https://coveralls.io/repos/github/silverbackhq/silverback/badge.svg?branch=master' alt='Coverage Status' /></a>
9+
<a href="https://hub.docker.com/r/clivern/silverback"><img src="https://img.shields.io/badge/Docker-Latest-orange"></a>
910
<a href="https://github.com/silverbackhq/Silverback/releases"><img src="https://img.shields.io/badge/Version-v1.0.0--alpha.1-blue.svg"></a>
1011
<a href="https://github.com/silverbackhq/Silverback/blob/master/LICENSE"><img src="https://img.shields.io/badge/LICENSE-Apache--2.0-orange.svg"></a>
1112
</p>
1213
</p>
1314
<p align="center">
14-
<a href="https://heroku.com/deploy" target="_blank"><img src="https://www.herokucdn.com/deploy/button.svg" alt="Deploy"></a>
15+
<a href="https://heroku.com/deploy" target="_blank"><img src="https://www.herokucdn.com/deploy/button.svg" alt="Deploy"></a>
1516
</p>
1617

1718

app/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,4 @@
1414

1515
from .celery import app as celery_app
1616

17-
1817
__all__ = (celery_app)

app/controllers/api/private/v1/admin/activity.py

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,40 +14,25 @@
1414

1515
# Third Party Library
1616
from django.views import View
17-
from pyvalitron.form import Form
18-
from django.http import JsonResponse
1917

2018
# Local Library
21-
from app.modules.util.helpers import Helpers
22-
from app.modules.core.request import Request
23-
from app.modules.core.response import Response
24-
from app.modules.validation.extension import ExtraRules
19+
from app.controllers.controller import Controller
2520
from app.modules.core.decorators import allow_if_authenticated
2621
from app.modules.core.activity import Activity as ActivityModule
2722

2823

29-
class Activities(View):
24+
class Activities(View, Controller):
3025
"""List Activities Private Endpoint Controller"""
3126

3227
def __init__(self):
33-
self.__request = Request()
34-
self.__response = Response()
35-
self.__helpers = Helpers()
36-
self.__form = Form()
3728
self.__activity = ActivityModule()
38-
self.__logger = self.__helpers.get_logger(__name__)
39-
self.__user_id = None
40-
self.__correlation_id = ""
41-
self.__form.add_validator(ExtraRules())
4229

4330
@allow_if_authenticated
4431
def get(self, request):
4532

46-
self.__correlation_id = request.META["X-Correlation-ID"] if "X-Correlation-ID" in request.META else ""
4733
self.__user_id = request.user.id
48-
self.__request.set_request(request)
4934

50-
request_data = self.__request.get_request_data("get", {
35+
request_data = self.get_request_data(request, "get", {
5136
"offset": 0,
5237
"limit": 20
5338
})
@@ -59,14 +44,14 @@ def get(self, request):
5944
offset = 0
6045
limit = 20
6146

62-
return JsonResponse(self.__response.send_private_success([], {
47+
return self.json([], {
6348
'activities': self.__format_activities(self.__activity.get(self.__user_id, offset, limit)),
6449
'metadata': {
6550
'offset': offset,
6651
'limit': limit,
6752
'count': self.__activity.count(self.__user_id)
6853
}
69-
}, self.__correlation_id))
54+
})
7055

7156
def __format_activities(self, activities):
7257
activities_list = []

0 commit comments

Comments
 (0)