argus-alm 0.15.2__py3-none-any.whl → 0.15.3__py3-none-any.whl
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/_version.py +2 -2
- argus/client/generic_result.py +6 -1
- {argus_alm-0.15.2.dist-info → argus_alm-0.15.3.dist-info}/METADATA +1 -1
- argus_alm-0.15.3.dist-info/RECORD +22 -0
- argus/backend/.gitkeep +0 -0
- argus/backend/__init__.py +0 -0
- argus/backend/cli.py +0 -57
- argus/backend/controller/__init__.py +0 -0
- argus/backend/controller/admin.py +0 -20
- argus/backend/controller/admin_api.py +0 -355
- argus/backend/controller/api.py +0 -589
- argus/backend/controller/auth.py +0 -67
- argus/backend/controller/client_api.py +0 -109
- argus/backend/controller/main.py +0 -316
- argus/backend/controller/notification_api.py +0 -72
- argus/backend/controller/notifications.py +0 -13
- argus/backend/controller/planner_api.py +0 -194
- argus/backend/controller/team.py +0 -129
- argus/backend/controller/team_ui.py +0 -19
- argus/backend/controller/testrun_api.py +0 -513
- argus/backend/controller/view_api.py +0 -188
- argus/backend/controller/views_widgets/__init__.py +0 -0
- argus/backend/controller/views_widgets/graphed_stats.py +0 -54
- argus/backend/controller/views_widgets/graphs.py +0 -68
- argus/backend/controller/views_widgets/highlights.py +0 -135
- argus/backend/controller/views_widgets/nemesis_stats.py +0 -26
- argus/backend/controller/views_widgets/summary.py +0 -43
- argus/backend/db.py +0 -98
- argus/backend/error_handlers.py +0 -41
- argus/backend/events/event_processors.py +0 -34
- argus/backend/models/__init__.py +0 -0
- argus/backend/models/argus_ai.py +0 -24
- argus/backend/models/github_issue.py +0 -60
- argus/backend/models/plan.py +0 -24
- argus/backend/models/result.py +0 -187
- argus/backend/models/runtime_store.py +0 -58
- argus/backend/models/view_widgets.py +0 -25
- argus/backend/models/web.py +0 -403
- argus/backend/plugins/__init__.py +0 -0
- argus/backend/plugins/core.py +0 -248
- argus/backend/plugins/driver_matrix_tests/controller.py +0 -66
- argus/backend/plugins/driver_matrix_tests/model.py +0 -429
- argus/backend/plugins/driver_matrix_tests/plugin.py +0 -21
- argus/backend/plugins/driver_matrix_tests/raw_types.py +0 -62
- argus/backend/plugins/driver_matrix_tests/service.py +0 -61
- argus/backend/plugins/driver_matrix_tests/udt.py +0 -42
- argus/backend/plugins/generic/model.py +0 -86
- argus/backend/plugins/generic/plugin.py +0 -15
- argus/backend/plugins/generic/types.py +0 -14
- argus/backend/plugins/loader.py +0 -39
- argus/backend/plugins/sct/controller.py +0 -224
- argus/backend/plugins/sct/plugin.py +0 -37
- argus/backend/plugins/sct/resource_setup.py +0 -177
- argus/backend/plugins/sct/service.py +0 -682
- argus/backend/plugins/sct/testrun.py +0 -288
- argus/backend/plugins/sct/udt.py +0 -100
- argus/backend/plugins/sirenada/model.py +0 -118
- argus/backend/plugins/sirenada/plugin.py +0 -16
- argus/backend/service/admin.py +0 -26
- argus/backend/service/argus_service.py +0 -696
- argus/backend/service/build_system_monitor.py +0 -185
- argus/backend/service/client_service.py +0 -127
- argus/backend/service/event_service.py +0 -18
- argus/backend/service/github_service.py +0 -233
- argus/backend/service/jenkins_service.py +0 -269
- argus/backend/service/notification_manager.py +0 -159
- argus/backend/service/planner_service.py +0 -608
- argus/backend/service/release_manager.py +0 -229
- argus/backend/service/results_service.py +0 -690
- argus/backend/service/stats.py +0 -610
- argus/backend/service/team_manager_service.py +0 -82
- argus/backend/service/test_lookup.py +0 -172
- argus/backend/service/testrun.py +0 -489
- argus/backend/service/user.py +0 -308
- argus/backend/service/views.py +0 -219
- argus/backend/service/views_widgets/__init__.py +0 -0
- argus/backend/service/views_widgets/graphed_stats.py +0 -180
- argus/backend/service/views_widgets/highlights.py +0 -374
- argus/backend/service/views_widgets/nemesis_stats.py +0 -34
- argus/backend/template_filters.py +0 -27
- argus/backend/tests/__init__.py +0 -0
- argus/backend/tests/client_service/__init__.py +0 -0
- argus/backend/tests/client_service/test_submit_results.py +0 -79
- argus/backend/tests/conftest.py +0 -180
- argus/backend/tests/results_service/__init__.py +0 -0
- argus/backend/tests/results_service/test_best_results.py +0 -178
- argus/backend/tests/results_service/test_cell.py +0 -65
- argus/backend/tests/results_service/test_chartjs_additional_functions.py +0 -259
- argus/backend/tests/results_service/test_create_chartjs.py +0 -220
- argus/backend/tests/results_service/test_result_metadata.py +0 -100
- argus/backend/tests/results_service/test_results_service.py +0 -203
- argus/backend/tests/results_service/test_validation_rules.py +0 -213
- argus/backend/tests/view_widgets/__init__.py +0 -0
- argus/backend/tests/view_widgets/test_highlights_api.py +0 -532
- argus/backend/util/common.py +0 -65
- argus/backend/util/config.py +0 -38
- argus/backend/util/encoders.py +0 -56
- argus/backend/util/logsetup.py +0 -80
- argus/backend/util/module_loaders.py +0 -30
- argus/backend/util/send_email.py +0 -91
- argus/client/tests/__init__.py +0 -0
- argus/client/tests/conftest.py +0 -19
- argus/client/tests/test_package.py +0 -45
- argus/client/tests/test_results.py +0 -224
- argus_alm-0.15.2.dist-info/RECORD +0 -122
- {argus_alm-0.15.2.dist-info → argus_alm-0.15.3.dist-info}/WHEEL +0 -0
- {argus_alm-0.15.2.dist-info → argus_alm-0.15.3.dist-info}/entry_points.txt +0 -0
- {argus_alm-0.15.2.dist-info → argus_alm-0.15.3.dist-info}/licenses/LICENSE +0 -0
- {argus_alm-0.15.2.dist-info → argus_alm-0.15.3.dist-info}/top_level.txt +0 -0
argus/backend/controller/team.py
DELETED
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
import logging
|
|
2
|
-
from uuid import UUID
|
|
3
|
-
from flask import (
|
|
4
|
-
Blueprint,
|
|
5
|
-
request
|
|
6
|
-
)
|
|
7
|
-
from argus.backend.error_handlers import handle_api_exception
|
|
8
|
-
from argus.backend.models.web import User
|
|
9
|
-
from argus.backend.service.argus_service import ArgusService
|
|
10
|
-
from argus.backend.service.user import api_login_required
|
|
11
|
-
from argus.backend.util.common import get_payload
|
|
12
|
-
from argus.backend.service.team_manager_service import TeamManagerService
|
|
13
|
-
|
|
14
|
-
bp = Blueprint('team_api', __name__, url_prefix='/team')
|
|
15
|
-
LOGGER = logging.getLogger(__name__)
|
|
16
|
-
bp.register_error_handler(Exception, handle_api_exception)
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
@bp.route("/create", methods=["POST"])
|
|
20
|
-
@api_login_required
|
|
21
|
-
def team_create():
|
|
22
|
-
payload = get_payload(request)
|
|
23
|
-
result = TeamManagerService().create_team(
|
|
24
|
-
name=payload["name"],
|
|
25
|
-
leader=UUID(payload["leader"]),
|
|
26
|
-
members=[UUID(m) for m in payload["members"]],
|
|
27
|
-
)
|
|
28
|
-
|
|
29
|
-
return {
|
|
30
|
-
"status": "ok",
|
|
31
|
-
"response": result
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
@bp.route("/<string:team_id>/get")
|
|
36
|
-
@api_login_required
|
|
37
|
-
def team_get(team_id: str):
|
|
38
|
-
result = TeamManagerService().get_team_by_id(UUID(team_id))
|
|
39
|
-
|
|
40
|
-
return {
|
|
41
|
-
"status": "ok",
|
|
42
|
-
"response": result
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
@bp.route("/<string:team_id>/delete", methods=["DELETE"])
|
|
47
|
-
@api_login_required
|
|
48
|
-
def team_delete(team_id: str):
|
|
49
|
-
TeamManagerService().delete_team(UUID(team_id))
|
|
50
|
-
|
|
51
|
-
return {
|
|
52
|
-
"status": "ok",
|
|
53
|
-
"response": {
|
|
54
|
-
"team_id": team_id,
|
|
55
|
-
"status": "deleted",
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
@bp.route("/<string:team_id>/edit", methods=["POST"])
|
|
61
|
-
@api_login_required
|
|
62
|
-
def team_edit(team_id: str):
|
|
63
|
-
payload = get_payload(request)
|
|
64
|
-
team = TeamManagerService().edit_team(
|
|
65
|
-
team_id=UUID(payload["id"]),
|
|
66
|
-
name=payload["name"],
|
|
67
|
-
members=[UUID(m) for m in payload["members"]],
|
|
68
|
-
)
|
|
69
|
-
|
|
70
|
-
return {
|
|
71
|
-
"status": "ok",
|
|
72
|
-
"response": {
|
|
73
|
-
"team_id": team_id,
|
|
74
|
-
"status": "updated",
|
|
75
|
-
"team": team,
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
@bp.route("/<string:team_id>/motd/edit", methods=["POST"])
|
|
81
|
-
@api_login_required
|
|
82
|
-
def team_edit_motd(team_id: str):
|
|
83
|
-
payload = get_payload(request)
|
|
84
|
-
TeamManagerService().edit_team_motd(
|
|
85
|
-
team_id=UUID(payload["id"]),
|
|
86
|
-
message=payload["motd"],
|
|
87
|
-
)
|
|
88
|
-
|
|
89
|
-
return {
|
|
90
|
-
"status": "ok",
|
|
91
|
-
"response": {
|
|
92
|
-
"team_id": team_id,
|
|
93
|
-
"status": "updated",
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
@bp.route("/user/<string:user_id>/teams")
|
|
99
|
-
@api_login_required
|
|
100
|
-
def user_teams(user_id: str):
|
|
101
|
-
result = TeamManagerService().get_users_teams(user_id=UUID(user_id))
|
|
102
|
-
|
|
103
|
-
return {
|
|
104
|
-
"status": "ok",
|
|
105
|
-
"response": result
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
@bp.route("/user/<string:user_id>/jobs")
|
|
110
|
-
@api_login_required
|
|
111
|
-
def user_jobs(user_id: str):
|
|
112
|
-
user = User.get(id=UUID(user_id))
|
|
113
|
-
result = list(ArgusService().get_jobs_for_user(user))
|
|
114
|
-
|
|
115
|
-
return {
|
|
116
|
-
"status": "ok",
|
|
117
|
-
"response": result
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
@bp.route("/leader/<string:user_id>/teams")
|
|
122
|
-
@api_login_required
|
|
123
|
-
def leader_teams(user_id: str):
|
|
124
|
-
result = TeamManagerService().get_teams_for_user(user_id=UUID(user_id))
|
|
125
|
-
|
|
126
|
-
return {
|
|
127
|
-
"status": "ok",
|
|
128
|
-
"response": result
|
|
129
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import logging
|
|
2
|
-
from uuid import UUID
|
|
3
|
-
from flask import (
|
|
4
|
-
Blueprint, flash, g, redirect, render_template, request, session, url_for, make_response
|
|
5
|
-
)
|
|
6
|
-
from argus.backend.controller.notifications import bp as notifications_bp
|
|
7
|
-
from argus.backend.service.argus_service import ArgusService
|
|
8
|
-
from argus.backend.models.web import WebFileStorage
|
|
9
|
-
from argus.backend.service.user import UserService, login_required
|
|
10
|
-
|
|
11
|
-
LOGGER = logging.getLogger(__name__)
|
|
12
|
-
|
|
13
|
-
bp = Blueprint('teams', __name__, url_prefix="/teams")
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
@bp.route("/")
|
|
17
|
-
@login_required
|
|
18
|
-
def index():
|
|
19
|
-
return render_template("teams.html.j2")
|
|
@@ -1,513 +0,0 @@
|
|
|
1
|
-
import logging
|
|
2
|
-
from uuid import UUID
|
|
3
|
-
from flask import (
|
|
4
|
-
Blueprint,
|
|
5
|
-
make_response,
|
|
6
|
-
redirect,
|
|
7
|
-
request,
|
|
8
|
-
send_file
|
|
9
|
-
)
|
|
10
|
-
import magic
|
|
11
|
-
|
|
12
|
-
from argus.backend.error_handlers import handle_api_exception
|
|
13
|
-
from argus.backend.models.web import ArgusTest
|
|
14
|
-
from argus.backend.service.github_service import GithubService
|
|
15
|
-
from argus.backend.service.jenkins_service import JenkinsService
|
|
16
|
-
from argus.backend.service.results_service import ResultsService
|
|
17
|
-
from argus.backend.service.testrun import TestRunService
|
|
18
|
-
from argus.backend.service.user import api_login_required
|
|
19
|
-
from argus.backend.util.common import get_payload
|
|
20
|
-
from argus.common.enums import TestInvestigationStatus, TestStatus
|
|
21
|
-
|
|
22
|
-
bp = Blueprint('testrun_api', __name__, 'testrun')
|
|
23
|
-
bp.register_error_handler(Exception, handle_api_exception)
|
|
24
|
-
LOGGER = logging.getLogger(__name__)
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
@bp.route("/test/<string:test_id>/runs")
|
|
28
|
-
@api_login_required
|
|
29
|
-
def get_runs_for_test(test_id: str):
|
|
30
|
-
limit = request.args.get("limit")
|
|
31
|
-
if not limit:
|
|
32
|
-
limit = 10
|
|
33
|
-
else:
|
|
34
|
-
limit = int(limit)
|
|
35
|
-
additional_runs = [UUID(run) for run in request.args.getlist('additionalRuns[]')]
|
|
36
|
-
service = TestRunService()
|
|
37
|
-
|
|
38
|
-
runs = service.get_runs_by_test_id(test_id=UUID(test_id), additional_runs=additional_runs, limit=limit)
|
|
39
|
-
|
|
40
|
-
return {
|
|
41
|
-
"status": "ok",
|
|
42
|
-
"response": runs
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
@bp.route("/run/<string:run_type>/<string:run_id>")
|
|
47
|
-
@api_login_required
|
|
48
|
-
def get_testrun(run_type: str, run_id: str):
|
|
49
|
-
run_id = UUID(run_id)
|
|
50
|
-
service = TestRunService()
|
|
51
|
-
test_run = service.get_run(run_type=run_type, run_id=run_id)
|
|
52
|
-
return {
|
|
53
|
-
"status": "ok",
|
|
54
|
-
"response": test_run
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
@bp.route("/run/<string:run_id>/activity")
|
|
59
|
-
@api_login_required
|
|
60
|
-
def test_run_activity(run_id: str):
|
|
61
|
-
run_id = UUID(run_id)
|
|
62
|
-
service = TestRunService()
|
|
63
|
-
activity = service.get_run_events(run_id=run_id)
|
|
64
|
-
|
|
65
|
-
return {
|
|
66
|
-
"status": "ok",
|
|
67
|
-
"response": activity
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
@bp.route("/run/<string:test_id>/<string:run_id>/fetch_results", methods=["GET"])
|
|
72
|
-
@api_login_required
|
|
73
|
-
def fetch_results(test_id: str, run_id: str):
|
|
74
|
-
tables = ResultsService().get_run_results(test_id=UUID(test_id), run_id=UUID(run_id))
|
|
75
|
-
return {
|
|
76
|
-
"status": "ok",
|
|
77
|
-
"tables": tables
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
@bp.route("/test/<string:test_id>/run/<string:run_id>/status/set", methods=["POST"])
|
|
82
|
-
@api_login_required
|
|
83
|
-
def set_testrun_status(test_id: str, run_id: str):
|
|
84
|
-
payload = get_payload(client_request=request)
|
|
85
|
-
new_status = payload.get("status")
|
|
86
|
-
if not new_status:
|
|
87
|
-
raise Exception("Status not specified in the request")
|
|
88
|
-
service = TestRunService()
|
|
89
|
-
result = service.change_run_status(
|
|
90
|
-
test_id=UUID(test_id),
|
|
91
|
-
run_id=UUID(run_id),
|
|
92
|
-
new_status=TestStatus(new_status)
|
|
93
|
-
)
|
|
94
|
-
|
|
95
|
-
return {
|
|
96
|
-
"status": "ok",
|
|
97
|
-
"response": result
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
@bp.route("/tests/<string:plugin_name>/<string:run_id>/log/<string:log_name>/download", methods=["GET"])
|
|
102
|
-
@api_login_required
|
|
103
|
-
def download_log(plugin_name: str, run_id: str, log_name: str):
|
|
104
|
-
service = TestRunService()
|
|
105
|
-
result = service.get_log(
|
|
106
|
-
plugin_name=plugin_name,
|
|
107
|
-
run_id=UUID(run_id),
|
|
108
|
-
log_name=log_name,
|
|
109
|
-
)
|
|
110
|
-
|
|
111
|
-
return redirect(result, code=302)
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
@bp.route("/tests/<string:plugin_name>/<string:run_id>/screenshot/<string:image_name>", methods=["GET"])
|
|
115
|
-
@api_login_required
|
|
116
|
-
def proxy_screenshot(plugin_name: str, run_id: str, image_name: str):
|
|
117
|
-
|
|
118
|
-
service = TestRunService()
|
|
119
|
-
result = service.proxy_stored_s3_image(
|
|
120
|
-
plugin_name=plugin_name,
|
|
121
|
-
run_id=UUID(run_id),
|
|
122
|
-
image_name=image_name,
|
|
123
|
-
)
|
|
124
|
-
|
|
125
|
-
return redirect(result, code=302)
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
@bp.route("/test/<string:test_id>/run/<string:run_id>/investigation_status/set", methods=["POST"])
|
|
129
|
-
@api_login_required
|
|
130
|
-
def set_testrun_investigation_status(test_id: str, run_id: str):
|
|
131
|
-
payload = get_payload(client_request=request)
|
|
132
|
-
new_status = payload.get("investigation_status")
|
|
133
|
-
if not new_status:
|
|
134
|
-
raise Exception("Status not specified in the request")
|
|
135
|
-
service = TestRunService()
|
|
136
|
-
result = service.change_run_investigation_status(
|
|
137
|
-
test_id=UUID(test_id),
|
|
138
|
-
run_id=UUID(run_id),
|
|
139
|
-
new_status=TestInvestigationStatus(new_status),
|
|
140
|
-
)
|
|
141
|
-
|
|
142
|
-
return {
|
|
143
|
-
"status": "ok",
|
|
144
|
-
"response": result
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
@bp.route("/test/<string:test_id>/run/<string:run_id>/assignee/set", methods=["POST"])
|
|
149
|
-
@api_login_required
|
|
150
|
-
def set_testrun_assignee(test_id: str, run_id: str):
|
|
151
|
-
payload = get_payload(client_request=request)
|
|
152
|
-
assignee = payload.get("assignee")
|
|
153
|
-
if not assignee:
|
|
154
|
-
raise Exception("Assignee not specified in the request")
|
|
155
|
-
service = TestRunService()
|
|
156
|
-
result = service.change_run_assignee(
|
|
157
|
-
test_id=UUID(test_id),
|
|
158
|
-
run_id=UUID(run_id),
|
|
159
|
-
new_assignee=UUID(assignee) if assignee != TestRunService.ASSIGNEE_PLACEHOLDER else None,
|
|
160
|
-
)
|
|
161
|
-
|
|
162
|
-
return {
|
|
163
|
-
"status": "ok",
|
|
164
|
-
"response": result
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
@bp.route("/test/<string:test_id>/run/<string:run_id>/issues/submit", methods=["POST"])
|
|
169
|
-
@api_login_required
|
|
170
|
-
def issues_submit(test_id: str, run_id: str):
|
|
171
|
-
payload = get_payload(client_request=request)
|
|
172
|
-
service = GithubService()
|
|
173
|
-
submit_result = service.submit_github_issue(
|
|
174
|
-
issue_url=payload["issue_url"],
|
|
175
|
-
test_id=UUID(test_id),
|
|
176
|
-
run_id=UUID(run_id)
|
|
177
|
-
)
|
|
178
|
-
|
|
179
|
-
return {
|
|
180
|
-
"status": "ok",
|
|
181
|
-
"response": submit_result
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
@bp.route("/issues/get", methods=["GET"])
|
|
186
|
-
@api_login_required
|
|
187
|
-
def issues_get():
|
|
188
|
-
filter_key = request.args.get("filterKey")
|
|
189
|
-
if not filter_key:
|
|
190
|
-
raise Exception("Filter key not provided in the request")
|
|
191
|
-
key_value = request.args.get("id")
|
|
192
|
-
if not key_value:
|
|
193
|
-
raise Exception("Id wasn't provided in the request")
|
|
194
|
-
key_value = UUID(key_value)
|
|
195
|
-
aggregate_by_issue = request.args.get("aggregateByIssue")
|
|
196
|
-
aggregate_by_issue = bool(int(aggregate_by_issue)) if aggregate_by_issue else False
|
|
197
|
-
service = GithubService()
|
|
198
|
-
issues = service.get_github_issues(
|
|
199
|
-
filter_key=filter_key,
|
|
200
|
-
filter_id=key_value,
|
|
201
|
-
aggregate_by_issue=aggregate_by_issue
|
|
202
|
-
)
|
|
203
|
-
|
|
204
|
-
return {
|
|
205
|
-
"status": "ok",
|
|
206
|
-
"response": issues
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
@bp.route("/issues/delete", methods=["POST"])
|
|
211
|
-
@api_login_required
|
|
212
|
-
def issues_delete():
|
|
213
|
-
payload = get_payload(client_request=request)
|
|
214
|
-
service = GithubService()
|
|
215
|
-
result = service.delete_github_issue(issue_id=payload["issue_id"], run_id=payload["run_id"])
|
|
216
|
-
|
|
217
|
-
return {
|
|
218
|
-
"status": "ok",
|
|
219
|
-
"response": result
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
@bp.route("/run/<string:run_id>/comments", methods=["GET"])
|
|
224
|
-
@api_login_required
|
|
225
|
-
def get_testrun_comments(run_id: str):
|
|
226
|
-
service = TestRunService()
|
|
227
|
-
comments = service.get_run_comments(
|
|
228
|
-
run_id=UUID(run_id)
|
|
229
|
-
)
|
|
230
|
-
|
|
231
|
-
return {
|
|
232
|
-
"status": "ok",
|
|
233
|
-
"response": comments
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
@bp.route("/comment/<string:comment_id>/get", methods=["GET"])
|
|
238
|
-
@api_login_required
|
|
239
|
-
def get_single_comment(comment_id: str):
|
|
240
|
-
service = TestRunService()
|
|
241
|
-
comment = service.get_run_comment(
|
|
242
|
-
comment_id=UUID(comment_id)
|
|
243
|
-
)
|
|
244
|
-
|
|
245
|
-
return {
|
|
246
|
-
"status": "ok",
|
|
247
|
-
"response": comment
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
@bp.route("/test/<string:test_id>/run/<string:run_id>/comments/submit", methods=["POST"])
|
|
252
|
-
@api_login_required
|
|
253
|
-
def submit_testrun_comment(test_id: str, run_id: str):
|
|
254
|
-
payload = get_payload(request)
|
|
255
|
-
service = TestRunService()
|
|
256
|
-
result = service.post_run_comment(
|
|
257
|
-
test_id=UUID(test_id),
|
|
258
|
-
run_id=UUID(run_id),
|
|
259
|
-
message=payload["message"],
|
|
260
|
-
reactions=payload["reactions"],
|
|
261
|
-
mentions=payload["mentions"],
|
|
262
|
-
)
|
|
263
|
-
|
|
264
|
-
return {
|
|
265
|
-
"status": "ok",
|
|
266
|
-
"response": result
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
@bp.route("/test/<string:test_id>/run/<string:run_id>/comment/<string:comment_id>/update", methods=["POST"])
|
|
271
|
-
@api_login_required
|
|
272
|
-
def test_run_update_comment(test_id: str, run_id: str, comment_id: str):
|
|
273
|
-
payload = get_payload(request)
|
|
274
|
-
service = TestRunService()
|
|
275
|
-
result = service.update_run_comment(
|
|
276
|
-
test_id=UUID(test_id),
|
|
277
|
-
run_id=UUID(run_id),
|
|
278
|
-
comment_id=UUID(comment_id),
|
|
279
|
-
message=payload["message"],
|
|
280
|
-
reactions=payload["reactions"],
|
|
281
|
-
mentions=payload["mentions"],
|
|
282
|
-
)
|
|
283
|
-
|
|
284
|
-
return {
|
|
285
|
-
"status": "ok",
|
|
286
|
-
"response": result
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
@bp.route("/test/<string:test_id>/run/<string:run_id>/comment/<string:comment_id>/delete", methods=["POST"])
|
|
291
|
-
@api_login_required
|
|
292
|
-
def test_run_delete_comment(test_id: str, run_id: str, comment_id: str):
|
|
293
|
-
service = TestRunService()
|
|
294
|
-
result = service.delete_run_comment(
|
|
295
|
-
test_id=UUID(test_id),
|
|
296
|
-
run_id=UUID(run_id),
|
|
297
|
-
comment_id=UUID(comment_id),
|
|
298
|
-
)
|
|
299
|
-
|
|
300
|
-
return {
|
|
301
|
-
"status": "ok",
|
|
302
|
-
"response": result
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
@bp.route("/terminate_stuck_runs", methods=["POST"])
|
|
307
|
-
@api_login_required
|
|
308
|
-
def sct_terminate_stuck_runs():
|
|
309
|
-
result = TestRunService().terminate_stuck_runs()
|
|
310
|
-
return {
|
|
311
|
-
"status": "ok",
|
|
312
|
-
"response": {
|
|
313
|
-
"total": result
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
@bp.route("/ignore_jobs", methods=["POST"])
|
|
319
|
-
@api_login_required
|
|
320
|
-
def ignore_jobs():
|
|
321
|
-
payload = get_payload(request)
|
|
322
|
-
service = TestRunService()
|
|
323
|
-
|
|
324
|
-
result = service.ignore_jobs(test_id=payload["testId"], reason=payload["reason"])
|
|
325
|
-
|
|
326
|
-
return {
|
|
327
|
-
"status": "ok",
|
|
328
|
-
"response": {
|
|
329
|
-
"affectedJobs": result
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
@bp.route("/get_runs_by_test_id_run_id", methods=["POST"])
|
|
335
|
-
@api_login_required
|
|
336
|
-
def get_runs_by_test_id_run_id():
|
|
337
|
-
payload: list[tuple[UUID, UUID]] = get_payload(request)
|
|
338
|
-
service = TestRunService()
|
|
339
|
-
|
|
340
|
-
result = service.resolve_run_build_id_and_number_multiple(payload)
|
|
341
|
-
|
|
342
|
-
return {
|
|
343
|
-
"status": "ok",
|
|
344
|
-
"response": {
|
|
345
|
-
"runs": result
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
@bp.route("/jenkins/params", methods=["POST"])
|
|
351
|
-
@api_login_required
|
|
352
|
-
def get_jenkins_job_params():
|
|
353
|
-
|
|
354
|
-
payload = get_payload(request)
|
|
355
|
-
service = JenkinsService()
|
|
356
|
-
|
|
357
|
-
result = service.retrieve_job_parameters(build_id=payload["buildId"], build_number=payload["buildNumber"])
|
|
358
|
-
|
|
359
|
-
return {
|
|
360
|
-
"status": "ok",
|
|
361
|
-
"response": {
|
|
362
|
-
"parameters": result
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
@bp.route("/jenkins/build", methods=["POST"])
|
|
368
|
-
@api_login_required
|
|
369
|
-
def build_jenkins_job():
|
|
370
|
-
|
|
371
|
-
payload = get_payload(request)
|
|
372
|
-
service = JenkinsService()
|
|
373
|
-
|
|
374
|
-
result = service.build_job(build_id=payload["buildId"], params=payload["parameters"])
|
|
375
|
-
|
|
376
|
-
return {
|
|
377
|
-
"status": "ok",
|
|
378
|
-
"response": {
|
|
379
|
-
"queueItem": result
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
@bp.route("/jenkins/queue_info")
|
|
385
|
-
@api_login_required
|
|
386
|
-
def get_queue_info():
|
|
387
|
-
queue_item = request.args.get("queueItem")
|
|
388
|
-
if not queue_item:
|
|
389
|
-
raise Exception("No queueItem provided")
|
|
390
|
-
service = JenkinsService()
|
|
391
|
-
result = service.get_queue_info(int(queue_item))
|
|
392
|
-
|
|
393
|
-
return {
|
|
394
|
-
"status": "ok",
|
|
395
|
-
"response": {
|
|
396
|
-
"queueItem": result
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
@bp.route("/jenkins/clone/targets")
|
|
402
|
-
@api_login_required
|
|
403
|
-
def get_clone_targets():
|
|
404
|
-
test_id = request.args.get("testId")
|
|
405
|
-
if not test_id:
|
|
406
|
-
raise Exception("No testId provided")
|
|
407
|
-
service = JenkinsService()
|
|
408
|
-
result = service.get_releases_for_clone(test_id)
|
|
409
|
-
|
|
410
|
-
return {
|
|
411
|
-
"status": "ok",
|
|
412
|
-
"response": {
|
|
413
|
-
"targets": result
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
@bp.route("/jenkins/clone/groups")
|
|
419
|
-
@api_login_required
|
|
420
|
-
def get_groups_for_target():
|
|
421
|
-
target_id = request.args.get("targetId")
|
|
422
|
-
if not target_id:
|
|
423
|
-
raise Exception("No targetId provided")
|
|
424
|
-
service = JenkinsService()
|
|
425
|
-
result = service.get_groups_for_release(target_id)
|
|
426
|
-
|
|
427
|
-
return {
|
|
428
|
-
"status": "ok",
|
|
429
|
-
"response": {
|
|
430
|
-
"groups": result
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
@bp.route("/jenkins/clone/create", methods=["POST"])
|
|
436
|
-
@api_login_required
|
|
437
|
-
def clone_jenkins_job():
|
|
438
|
-
|
|
439
|
-
payload = get_payload(request)
|
|
440
|
-
service = JenkinsService()
|
|
441
|
-
|
|
442
|
-
result = service.clone_job(
|
|
443
|
-
current_test_id=payload["currentTestId"],
|
|
444
|
-
new_name=payload["newName"],
|
|
445
|
-
target=payload["target"],
|
|
446
|
-
group=payload["group"],
|
|
447
|
-
advanced_settings=payload["advancedSettings"],
|
|
448
|
-
)
|
|
449
|
-
|
|
450
|
-
return {
|
|
451
|
-
"status": "ok",
|
|
452
|
-
"response": result
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
@bp.route("/jenkins/clone/build", methods=["POST"])
|
|
457
|
-
@api_login_required
|
|
458
|
-
def clone_build_jenkins_job():
|
|
459
|
-
|
|
460
|
-
payload = get_payload(request)
|
|
461
|
-
service = JenkinsService()
|
|
462
|
-
|
|
463
|
-
result = service.clone_build_job(build_id=payload["buildId"], params=payload["parameters"])
|
|
464
|
-
|
|
465
|
-
return {
|
|
466
|
-
"status": "ok",
|
|
467
|
-
"response": result
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
@bp.route("/jenkins/clone/settings")
|
|
472
|
-
@api_login_required
|
|
473
|
-
def get_clone_job_advanced_settings():
|
|
474
|
-
build_id = request.args.get("buildId")
|
|
475
|
-
if not build_id:
|
|
476
|
-
raise Exception("No testId provided")
|
|
477
|
-
service = JenkinsService()
|
|
478
|
-
result = service.get_advanced_settings(build_id)
|
|
479
|
-
|
|
480
|
-
return {
|
|
481
|
-
"status": "ok",
|
|
482
|
-
"response": result
|
|
483
|
-
}
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
@bp.route("/jenkins/clone/settings/change", methods=["POST"])
|
|
487
|
-
@api_login_required
|
|
488
|
-
def set_job_settings():
|
|
489
|
-
payload = get_payload(request)
|
|
490
|
-
service = JenkinsService()
|
|
491
|
-
test = ArgusTest.get(build_system_id=payload["buildId"])
|
|
492
|
-
result = service.adjust_job_settings(build_id=test.build_system_id,
|
|
493
|
-
plugin_name=test.plugin_name, settings=payload["settings"])
|
|
494
|
-
|
|
495
|
-
return {
|
|
496
|
-
"status": "ok",
|
|
497
|
-
"response": result
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
@bp.route("/jenkins/clone/settings/validate", methods=["POST"])
|
|
502
|
-
@api_login_required
|
|
503
|
-
def clone_validate_new_settings():
|
|
504
|
-
|
|
505
|
-
payload = get_payload(request)
|
|
506
|
-
service = JenkinsService()
|
|
507
|
-
|
|
508
|
-
result = service.verify_job_settings(build_id=payload["buildId"], new_settings=payload["newSettings"])
|
|
509
|
-
|
|
510
|
-
return {
|
|
511
|
-
"status": "ok",
|
|
512
|
-
"response": result
|
|
513
|
-
}
|