argus-alm 0.12.5__tar.gz → 0.12.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {argus_alm-0.12.5 → argus_alm-0.12.7}/PKG-INFO +1 -1
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/controller/admin_api.py +67 -2
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/controller/api.py +14 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/controller/auth.py +15 -13
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/controller/client_api.py +9 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/controller/main.py +1 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/models/result.py +22 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/plugins/core.py +3 -3
- argus_alm-0.12.7/argus/backend/plugins/driver_matrix_tests/controller.py +63 -0
- argus_alm-0.12.7/argus/backend/plugins/driver_matrix_tests/model.py +421 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/plugins/driver_matrix_tests/raw_types.py +27 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/plugins/driver_matrix_tests/service.py +18 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/plugins/driver_matrix_tests/udt.py +14 -13
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/plugins/sct/testrun.py +2 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/service/argus_service.py +15 -5
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/service/build_system_monitor.py +3 -3
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/service/client_service.py +13 -1
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/service/jenkins_service.py +3 -1
- argus_alm-0.12.7/argus/backend/service/results_service.py +140 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/service/testrun.py +13 -8
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/service/user.py +61 -4
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/service/views.py +3 -3
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/util/config.py +3 -1
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/util/encoders.py +17 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/client/base.py +18 -1
- argus_alm-0.12.7/argus/client/driver_matrix_tests/cli.py +110 -0
- argus_alm-0.12.7/argus/client/driver_matrix_tests/client.py +79 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/pyproject.toml +9 -8
- argus_alm-0.12.5/argus/backend/plugins/driver_matrix_tests/controller.py +0 -24
- argus_alm-0.12.5/argus/backend/plugins/driver_matrix_tests/model.py +0 -175
- argus_alm-0.12.5/argus/client/driver_matrix_tests/client.py +0 -216
- argus_alm-0.12.5/argus/client/generic_result_old.py +0 -143
- {argus_alm-0.12.5 → argus_alm-0.12.7}/LICENSE +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/README.md +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/__init__.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/.gitkeep +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/__init__.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/cli.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/controller/__init__.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/controller/admin.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/controller/notification_api.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/controller/notifications.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/controller/team.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/controller/team_ui.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/controller/testrun_api.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/controller/view_api.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/db.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/error_handlers.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/events/event_processors.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/models/__init__.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/models/web.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/plugins/__init__.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/plugins/driver_matrix_tests/plugin.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/plugins/generic/model.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/plugins/generic/plugin.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/plugins/generic/types.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/plugins/loader.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/plugins/sct/controller.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/plugins/sct/plugin.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/plugins/sct/resource_setup.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/plugins/sct/service.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/plugins/sct/types.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/plugins/sct/udt.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/plugins/sirenada/model.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/plugins/sirenada/plugin.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/plugins/sirenada/types.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/service/admin.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/service/event_service.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/service/notification_manager.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/service/release_manager.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/service/stats.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/service/team_manager_service.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/template_filters.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/util/common.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/util/enums.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/util/logsetup.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/util/module_loaders.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/backend/util/send_email.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/client/__init__.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/client/generic/cli.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/client/generic/client.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/client/generic_result.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/client/sct/client.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/client/sct/types.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/client/sirenada/client.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/db/.gitkeep +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/db/argus_json.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/db/cloud_types.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/db/config.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/db/db_types.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/db/interface.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/db/testrun.py +0 -0
- {argus_alm-0.12.5 → argus_alm-0.12.7}/argus/db/utils.py +0 -0
|
@@ -7,8 +7,8 @@ from flask import (
|
|
|
7
7
|
)
|
|
8
8
|
from argus.backend.error_handlers import handle_api_exception
|
|
9
9
|
from argus.backend.service.release_manager import ReleaseEditPayload, ReleaseManagerService
|
|
10
|
-
from argus.backend.service.user import api_login_required, check_roles
|
|
11
|
-
from argus.backend.models.web import UserRoles
|
|
10
|
+
from argus.backend.service.user import UserService, api_login_required, check_roles
|
|
11
|
+
from argus.backend.models.web import User, UserRoles
|
|
12
12
|
|
|
13
13
|
bp = Blueprint('admin_api', __name__, url_prefix='/api/v1')
|
|
14
14
|
LOGGER = logging.getLogger(__name__)
|
|
@@ -287,3 +287,68 @@ def quick_toggle_group_enabled():
|
|
|
287
287
|
"status": "ok",
|
|
288
288
|
"response": res
|
|
289
289
|
}
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
@bp.route("/users", methods=["GET"])
|
|
293
|
+
@check_roles(UserRoles.Admin)
|
|
294
|
+
@api_login_required
|
|
295
|
+
def user_info():
|
|
296
|
+
result = UserService().get_users_privileged()
|
|
297
|
+
|
|
298
|
+
return {
|
|
299
|
+
"status": "ok",
|
|
300
|
+
"response": result
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
@bp.route("/user/<string:user_id>/email/set", methods=["POST"])
|
|
305
|
+
@check_roles(UserRoles.Admin)
|
|
306
|
+
@api_login_required
|
|
307
|
+
def user_change_email(user_id: str):
|
|
308
|
+
payload = get_payload(request)
|
|
309
|
+
|
|
310
|
+
user = User.get(id=user_id)
|
|
311
|
+
result = UserService().update_email(user=user, new_email=payload["newEmail"])
|
|
312
|
+
|
|
313
|
+
return {
|
|
314
|
+
"status": "ok",
|
|
315
|
+
"response": result
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
@bp.route("/user/<string:user_id>/delete", methods=["POST"])
|
|
320
|
+
@check_roles(UserRoles.Admin)
|
|
321
|
+
@api_login_required
|
|
322
|
+
def user_delete(user_id: str):
|
|
323
|
+
result = UserService().delete_user(user_id=user_id)
|
|
324
|
+
|
|
325
|
+
return {
|
|
326
|
+
"status": "ok",
|
|
327
|
+
"response": result
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
@bp.route("/user/<string:user_id>/password/set", methods=["POST"])
|
|
332
|
+
@check_roles(UserRoles.Admin)
|
|
333
|
+
@api_login_required
|
|
334
|
+
def user_change_password(user_id: str):
|
|
335
|
+
payload = get_payload(request)
|
|
336
|
+
|
|
337
|
+
user = User.get(id=user_id)
|
|
338
|
+
result = UserService().update_password(user=user, old_password="", new_password=payload["newPassword"], force=True)
|
|
339
|
+
|
|
340
|
+
return {
|
|
341
|
+
"status": "ok",
|
|
342
|
+
"response": result
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
@bp.route("/user/<string:user_id>/admin/toggle", methods=["POST"])
|
|
346
|
+
@check_roles(UserRoles.Admin)
|
|
347
|
+
@api_login_required
|
|
348
|
+
def user_toggle_admin(user_id: str):
|
|
349
|
+
result = UserService().toggle_admin(user_id=user_id)
|
|
350
|
+
|
|
351
|
+
return {
|
|
352
|
+
"status": "ok",
|
|
353
|
+
"response": result
|
|
354
|
+
}
|
|
@@ -14,6 +14,7 @@ from argus.backend.controller.testrun_api import bp as testrun_bp
|
|
|
14
14
|
from argus.backend.controller.team import bp as team_bp
|
|
15
15
|
from argus.backend.controller.view_api import bp as view_bp
|
|
16
16
|
from argus.backend.service.argus_service import ArgusService, ScheduleUpdateRequest
|
|
17
|
+
from argus.backend.service.results_service import ResultsService
|
|
17
18
|
from argus.backend.service.user import UserService, api_login_required
|
|
18
19
|
from argus.backend.service.stats import ReleaseStatsCollector
|
|
19
20
|
from argus.backend.models.web import ArgusRelease, ArgusGroup, ArgusTest, User, UserOauthToken
|
|
@@ -381,6 +382,19 @@ def test_info():
|
|
|
381
382
|
"response": info
|
|
382
383
|
}
|
|
383
384
|
|
|
385
|
+
@bp.route("/test-results", methods=["GET"])
|
|
386
|
+
@api_login_required
|
|
387
|
+
def test_results():
|
|
388
|
+
test_id = request.args.get("testId")
|
|
389
|
+
if not test_id:
|
|
390
|
+
raise Exception("No testId provided")
|
|
391
|
+
service = ResultsService()
|
|
392
|
+
info = service.get_results(test_id=UUID(test_id))
|
|
393
|
+
|
|
394
|
+
return {
|
|
395
|
+
"status": "ok",
|
|
396
|
+
"response": info
|
|
397
|
+
}
|
|
384
398
|
|
|
385
399
|
@bp.route("/test_run/comment/get", methods=["GET"]) # TODO: remove
|
|
386
400
|
@api_login_required
|
|
@@ -5,7 +5,7 @@ from flask import (
|
|
|
5
5
|
)
|
|
6
6
|
from werkzeug.security import check_password_hash
|
|
7
7
|
from argus.backend.models.web import User
|
|
8
|
-
from argus.backend.service.user import UserService, load_logged_in_user, login_required
|
|
8
|
+
from argus.backend.service.user import UserService, UserServiceException, load_logged_in_user, login_required
|
|
9
9
|
|
|
10
10
|
bp = Blueprint('auth', __name__, url_prefix='/auth')
|
|
11
11
|
|
|
@@ -21,24 +21,26 @@ def login():
|
|
|
21
21
|
session["csrf_token"] = token
|
|
22
22
|
|
|
23
23
|
if request.method == 'POST':
|
|
24
|
-
username = request.form["username"]
|
|
25
|
-
password = request.form["password"]
|
|
26
|
-
error = None
|
|
27
24
|
try:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
if "password" not in current_app.config.get("LOGIN_METHODS", []):
|
|
26
|
+
raise UserServiceException("Password Login is disabled")
|
|
27
|
+
username = request.form["username"]
|
|
28
|
+
password = request.form["password"]
|
|
31
29
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
try:
|
|
31
|
+
user: User = User.get(username=username)
|
|
32
|
+
except User.DoesNotExist:
|
|
33
|
+
raise UserServiceException("User not found")
|
|
34
|
+
|
|
35
|
+
if not check_password_hash(user.password, password):
|
|
36
|
+
raise UserServiceException("Incorrect Password")
|
|
36
37
|
|
|
37
|
-
if not error:
|
|
38
38
|
session.clear()
|
|
39
39
|
session["user_id"] = str(user.id)
|
|
40
40
|
session["csrf_token"] = token
|
|
41
|
-
|
|
41
|
+
except UserServiceException as exc:
|
|
42
|
+
flash(next(iter(exc.args), "No message"), category="error")
|
|
43
|
+
|
|
42
44
|
return redirect(url_for('main.home'))
|
|
43
45
|
|
|
44
46
|
return render_template('auth/login.html.j2',
|
|
@@ -23,6 +23,15 @@ def submit_run(run_type: str):
|
|
|
23
23
|
"response": result
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
@bp.route("/testrun/<string:run_type>/<string:run_id>/get", methods=["GET"])
|
|
27
|
+
@api_login_required
|
|
28
|
+
def get_run(run_type: str, run_id: str):
|
|
29
|
+
result = ClientService().get_run(run_type=run_type, run_id=run_id)
|
|
30
|
+
return {
|
|
31
|
+
"status": "ok",
|
|
32
|
+
"response": result
|
|
33
|
+
}
|
|
34
|
+
|
|
26
35
|
|
|
27
36
|
@bp.route("/testrun/<string:run_type>/<string:run_id>/heartbeat", methods=["POST"])
|
|
28
37
|
@api_login_required
|
|
@@ -152,6 +152,7 @@ def profile_oauth_github_callback():
|
|
|
152
152
|
try:
|
|
153
153
|
first_run_info = service.github_callback(req_code)
|
|
154
154
|
except Exception as exc: # pylint: disable=broad-except
|
|
155
|
+
LOGGER.error("An error occured in callback", exc_info=True)
|
|
155
156
|
flash(message=exc.args[0], category="error")
|
|
156
157
|
return redirect(url_for("main.error", type=403))
|
|
157
158
|
if first_run_info:
|
|
@@ -28,6 +28,28 @@ class ArgusGenericResultMetadata(Model):
|
|
|
28
28
|
kwargs["columns_meta"] = [ColumnMetadata(**col) for col in kwargs.pop('columns_meta', [])]
|
|
29
29
|
super().__init__(**kwargs)
|
|
30
30
|
|
|
31
|
+
def update_if_changed(self, new_data: dict) -> None:
|
|
32
|
+
"""
|
|
33
|
+
Updates table metadata if changed column/description or new rows were added.
|
|
34
|
+
See that rows can only be added, not removed once was sent.
|
|
35
|
+
Columns may be removed, but data in results table persists.
|
|
36
|
+
"""
|
|
37
|
+
updated = False
|
|
38
|
+
for field, value in new_data.items():
|
|
39
|
+
if field == "columns_meta":
|
|
40
|
+
value = [ColumnMetadata(**col) for col in value]
|
|
41
|
+
elif field == "rows_meta":
|
|
42
|
+
added_rows = []
|
|
43
|
+
for row in value:
|
|
44
|
+
if row not in self.rows_meta:
|
|
45
|
+
added_rows.append(row)
|
|
46
|
+
value = self.rows_meta + added_rows
|
|
47
|
+
if getattr(self, field) != value:
|
|
48
|
+
setattr(self, field, value)
|
|
49
|
+
updated = True
|
|
50
|
+
|
|
51
|
+
if updated:
|
|
52
|
+
self.save()
|
|
31
53
|
|
|
32
54
|
class ArgusGenericResultData(Model):
|
|
33
55
|
__table_name__ = "generic_result_data_v1"
|
|
@@ -30,7 +30,7 @@ class PluginModelBase(Model):
|
|
|
30
30
|
_plugin_name = "unknown"
|
|
31
31
|
# Metadata
|
|
32
32
|
build_id = columns.Text(required=True, partition_key=True)
|
|
33
|
-
start_time = columns.DateTime(required=True, primary_key=True, clustering_order="DESC", default=datetime.
|
|
33
|
+
start_time = columns.DateTime(required=True, primary_key=True, clustering_order="DESC", default=datetime.utcnow, custom_index=True)
|
|
34
34
|
id = columns.UUID(index=True, required=True)
|
|
35
35
|
release_id = columns.UUID(index=True)
|
|
36
36
|
group_id = columns.UUID(index=True)
|
|
@@ -110,11 +110,11 @@ class PluginModelBase(Model):
|
|
|
110
110
|
return assignees_uuids[0] if len(assignees_uuids) > 0 else None
|
|
111
111
|
|
|
112
112
|
@classmethod
|
|
113
|
-
def get_jobs_assigned_to_user(cls,
|
|
113
|
+
def get_jobs_assigned_to_user(cls, user_id: str | UUID):
|
|
114
114
|
cluster = ScyllaCluster.get()
|
|
115
115
|
query = cluster.prepare("SELECT build_id, start_time, release_id, group_id, assignee, "
|
|
116
116
|
f"test_id, id, status, investigation_status, build_job_url, scylla_version FROM {cls.table_name()} WHERE assignee = ?")
|
|
117
|
-
rows = cluster.session.execute(query=query, parameters=(
|
|
117
|
+
rows = cluster.session.execute(query=query, parameters=(user_id,))
|
|
118
118
|
|
|
119
119
|
return list(rows)
|
|
120
120
|
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
from flask import Blueprint, request
|
|
2
|
+
|
|
3
|
+
from argus.backend.error_handlers import handle_api_exception
|
|
4
|
+
from argus.backend.plugins.driver_matrix_tests.raw_types import DriverMatrixSubmitEnvRequest, DriverMatrixSubmitFailureRequest, DriverMatrixSubmitResultRequest
|
|
5
|
+
from argus.backend.service.user import api_login_required
|
|
6
|
+
from argus.backend.plugins.driver_matrix_tests.service import DriverMatrixService
|
|
7
|
+
from argus.backend.util.common import get_payload
|
|
8
|
+
|
|
9
|
+
bp = Blueprint("driver_matrix_api", __name__, url_prefix="/driver_matrix")
|
|
10
|
+
bp.register_error_handler(Exception, handle_api_exception)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@bp.route("/test_report", methods=["GET"])
|
|
14
|
+
@api_login_required
|
|
15
|
+
def driver_matrix_test_report():
|
|
16
|
+
|
|
17
|
+
build_id = request.args.get("buildId")
|
|
18
|
+
if not build_id:
|
|
19
|
+
raise Exception("No build id provided")
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
result = DriverMatrixService().tested_versions_report(build_id=build_id)
|
|
23
|
+
return {
|
|
24
|
+
"status": "ok",
|
|
25
|
+
"response": result
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@bp.route("/result/submit", methods=["POST"])
|
|
29
|
+
@api_login_required
|
|
30
|
+
def submit_result():
|
|
31
|
+
payload = get_payload(request)
|
|
32
|
+
request_data = DriverMatrixSubmitResultRequest(**payload)
|
|
33
|
+
|
|
34
|
+
result = DriverMatrixService().submit_driver_result(driver_name=request_data.driver_name, driver_type=request_data.driver_type, run_id=request_data.run_id, raw_xml=request_data.raw_xml)
|
|
35
|
+
return {
|
|
36
|
+
"status": "ok",
|
|
37
|
+
"response": result
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
@bp.route("/result/fail", methods=["POST"])
|
|
42
|
+
@api_login_required
|
|
43
|
+
def submit_failure():
|
|
44
|
+
payload = get_payload(request)
|
|
45
|
+
request_data = DriverMatrixSubmitFailureRequest(**payload)
|
|
46
|
+
|
|
47
|
+
result = DriverMatrixService().submit_driver_failure(driver_name=request_data.driver_name, driver_type=request_data.driver_type, run_id=request_data.run_id, failure_reason=request_data.failure_reason)
|
|
48
|
+
return {
|
|
49
|
+
"status": "ok",
|
|
50
|
+
"response": result
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@bp.route("/env/submit", methods=["POST"])
|
|
54
|
+
@api_login_required
|
|
55
|
+
def submit_env():
|
|
56
|
+
payload = get_payload(request)
|
|
57
|
+
request_data = DriverMatrixSubmitEnvRequest(**payload)
|
|
58
|
+
|
|
59
|
+
result = DriverMatrixService().submit_env_info(run_id=request_data.run_id, raw_env=request_data.raw_env)
|
|
60
|
+
return {
|
|
61
|
+
"status": "ok",
|
|
62
|
+
"response": result
|
|
63
|
+
}
|