argus-alm 0.14.2__py3-none-any.whl → 0.15.1__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 +21 -0
- argus/backend/.gitkeep +0 -0
- argus/backend/__init__.py +0 -0
- argus/backend/cli.py +57 -0
- argus/backend/controller/__init__.py +0 -0
- argus/backend/controller/admin.py +20 -0
- argus/backend/controller/admin_api.py +355 -0
- argus/backend/controller/api.py +589 -0
- argus/backend/controller/auth.py +67 -0
- argus/backend/controller/client_api.py +109 -0
- argus/backend/controller/main.py +316 -0
- argus/backend/controller/notification_api.py +72 -0
- argus/backend/controller/notifications.py +13 -0
- argus/backend/controller/planner_api.py +194 -0
- argus/backend/controller/team.py +129 -0
- argus/backend/controller/team_ui.py +19 -0
- argus/backend/controller/testrun_api.py +513 -0
- argus/backend/controller/view_api.py +188 -0
- argus/backend/controller/views_widgets/__init__.py +0 -0
- argus/backend/controller/views_widgets/graphed_stats.py +54 -0
- argus/backend/controller/views_widgets/graphs.py +68 -0
- argus/backend/controller/views_widgets/highlights.py +135 -0
- argus/backend/controller/views_widgets/nemesis_stats.py +26 -0
- argus/backend/controller/views_widgets/summary.py +43 -0
- argus/backend/db.py +98 -0
- argus/backend/error_handlers.py +41 -0
- argus/backend/events/event_processors.py +34 -0
- argus/backend/models/__init__.py +0 -0
- argus/backend/models/argus_ai.py +24 -0
- argus/backend/models/github_issue.py +60 -0
- argus/backend/models/plan.py +24 -0
- argus/backend/models/result.py +187 -0
- argus/backend/models/runtime_store.py +58 -0
- argus/backend/models/view_widgets.py +25 -0
- argus/backend/models/web.py +403 -0
- argus/backend/plugins/__init__.py +0 -0
- argus/backend/plugins/core.py +248 -0
- argus/backend/plugins/driver_matrix_tests/controller.py +66 -0
- argus/backend/plugins/driver_matrix_tests/model.py +429 -0
- argus/backend/plugins/driver_matrix_tests/plugin.py +21 -0
- argus/backend/plugins/driver_matrix_tests/raw_types.py +62 -0
- argus/backend/plugins/driver_matrix_tests/service.py +61 -0
- argus/backend/plugins/driver_matrix_tests/udt.py +42 -0
- argus/backend/plugins/generic/model.py +86 -0
- argus/backend/plugins/generic/plugin.py +15 -0
- argus/backend/plugins/generic/types.py +14 -0
- argus/backend/plugins/loader.py +39 -0
- argus/backend/plugins/sct/controller.py +224 -0
- argus/backend/plugins/sct/plugin.py +37 -0
- argus/backend/plugins/sct/resource_setup.py +177 -0
- argus/backend/plugins/sct/service.py +682 -0
- argus/backend/plugins/sct/testrun.py +288 -0
- argus/backend/plugins/sct/udt.py +100 -0
- argus/backend/plugins/sirenada/model.py +118 -0
- argus/backend/plugins/sirenada/plugin.py +16 -0
- argus/backend/service/admin.py +26 -0
- argus/backend/service/argus_service.py +696 -0
- argus/backend/service/build_system_monitor.py +185 -0
- argus/backend/service/client_service.py +127 -0
- argus/backend/service/event_service.py +18 -0
- argus/backend/service/github_service.py +233 -0
- argus/backend/service/jenkins_service.py +269 -0
- argus/backend/service/notification_manager.py +159 -0
- argus/backend/service/planner_service.py +608 -0
- argus/backend/service/release_manager.py +229 -0
- argus/backend/service/results_service.py +690 -0
- argus/backend/service/stats.py +610 -0
- argus/backend/service/team_manager_service.py +82 -0
- argus/backend/service/test_lookup.py +172 -0
- argus/backend/service/testrun.py +489 -0
- argus/backend/service/user.py +308 -0
- argus/backend/service/views.py +219 -0
- argus/backend/service/views_widgets/__init__.py +0 -0
- argus/backend/service/views_widgets/graphed_stats.py +180 -0
- argus/backend/service/views_widgets/highlights.py +374 -0
- argus/backend/service/views_widgets/nemesis_stats.py +34 -0
- argus/backend/template_filters.py +27 -0
- 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 +79 -0
- argus/backend/tests/conftest.py +180 -0
- argus/backend/tests/results_service/__init__.py +0 -0
- argus/backend/tests/results_service/test_best_results.py +178 -0
- argus/backend/tests/results_service/test_cell.py +65 -0
- argus/backend/tests/results_service/test_chartjs_additional_functions.py +259 -0
- argus/backend/tests/results_service/test_create_chartjs.py +220 -0
- argus/backend/tests/results_service/test_result_metadata.py +100 -0
- argus/backend/tests/results_service/test_results_service.py +203 -0
- argus/backend/tests/results_service/test_validation_rules.py +213 -0
- argus/backend/tests/view_widgets/__init__.py +0 -0
- argus/backend/tests/view_widgets/test_highlights_api.py +532 -0
- argus/backend/util/common.py +65 -0
- argus/backend/util/config.py +38 -0
- argus/backend/util/encoders.py +56 -0
- argus/backend/util/logsetup.py +80 -0
- argus/backend/util/module_loaders.py +30 -0
- argus/backend/util/send_email.py +91 -0
- argus/client/base.py +1 -3
- argus/client/driver_matrix_tests/cli.py +17 -8
- argus/client/generic/cli.py +4 -2
- argus/client/generic/client.py +1 -0
- argus/client/generic_result.py +48 -9
- argus/client/sct/client.py +1 -3
- argus/client/sirenada/client.py +4 -1
- argus/client/tests/__init__.py +0 -0
- argus/client/tests/conftest.py +19 -0
- argus/client/tests/test_package.py +45 -0
- argus/client/tests/test_results.py +224 -0
- argus/common/sct_types.py +3 -0
- argus/common/sirenada_types.py +1 -1
- {argus_alm-0.14.2.dist-info → argus_alm-0.15.1.dist-info}/METADATA +43 -19
- argus_alm-0.15.1.dist-info/RECORD +122 -0
- {argus_alm-0.14.2.dist-info → argus_alm-0.15.1.dist-info}/WHEEL +2 -1
- argus_alm-0.15.1.dist-info/entry_points.txt +3 -0
- argus_alm-0.15.1.dist-info/top_level.txt +1 -0
- argus_alm-0.14.2.dist-info/RECORD +0 -20
- argus_alm-0.14.2.dist-info/entry_points.txt +0 -4
- {argus_alm-0.14.2.dist-info → argus_alm-0.15.1.dist-info/licenses}/LICENSE +0 -0
|
@@ -0,0 +1,129 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
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")
|
|
@@ -0,0 +1,513 @@
|
|
|
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
|
+
}
|