argus-alm 0.12.1__tar.gz → 0.12.2__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.1 → argus_alm-0.12.2}/PKG-INFO +1 -1
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/controller/testrun_api.py +52 -0
- argus_alm-0.12.2/argus/backend/service/jenkins_service.py +63 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/client/driver_matrix_tests/client.py +2 -2
- {argus_alm-0.12.1 → argus_alm-0.12.2}/pyproject.toml +1 -1
- {argus_alm-0.12.1 → argus_alm-0.12.2}/LICENSE +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/README.md +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/__init__.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/.gitkeep +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/__init__.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/cli.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/controller/__init__.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/controller/admin.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/controller/admin_api.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/controller/api.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/controller/auth.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/controller/client_api.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/controller/main.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/controller/notification_api.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/controller/notifications.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/controller/team.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/controller/team_ui.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/db.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/error_handlers.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/events/event_processors.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/models/__init__.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/models/web.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/plugins/__init__.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/plugins/core.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/plugins/driver_matrix_tests/controller.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/plugins/driver_matrix_tests/model.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/plugins/driver_matrix_tests/plugin.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/plugins/driver_matrix_tests/raw_types.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/plugins/driver_matrix_tests/service.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/plugins/driver_matrix_tests/udt.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/plugins/generic/model.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/plugins/generic/plugin.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/plugins/generic/types.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/plugins/loader.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/plugins/sct/controller.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/plugins/sct/plugin.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/plugins/sct/resource_setup.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/plugins/sct/service.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/plugins/sct/testrun.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/plugins/sct/types.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/plugins/sct/udt.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/plugins/sirenada/model.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/plugins/sirenada/plugin.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/plugins/sirenada/types.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/service/admin.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/service/argus_service.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/service/build_system_monitor.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/service/client_service.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/service/event_service.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/service/notification_manager.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/service/release_manager.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/service/stats.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/service/team_manager_service.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/service/testrun.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/service/user.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/template_filters.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/util/common.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/util/config.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/util/encoders.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/util/enums.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/util/logsetup.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/util/module_loaders.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/util/send_email.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/client/__init__.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/client/base.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/client/generic/cli.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/client/generic/client.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/client/sct/client.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/client/sct/types.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/client/sirenada/client.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/db/.gitkeep +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/db/argus_json.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/db/cloud_types.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/db/config.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/db/db_types.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/db/interface.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/db/testrun.py +0 -0
- {argus_alm-0.12.1 → argus_alm-0.12.2}/argus/db/utils.py +0 -0
|
@@ -6,6 +6,7 @@ from flask import (
|
|
|
6
6
|
)
|
|
7
7
|
|
|
8
8
|
from argus.backend.error_handlers import handle_api_exception
|
|
9
|
+
from argus.backend.service.jenkins_service import JenkinsService
|
|
9
10
|
from argus.backend.service.testrun import TestRunService
|
|
10
11
|
from argus.backend.service.user import api_login_required
|
|
11
12
|
from argus.backend.util.common import get_payload
|
|
@@ -285,3 +286,54 @@ def ignore_jobs():
|
|
|
285
286
|
"affectedJobs": result
|
|
286
287
|
}
|
|
287
288
|
}
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
@bp.route("/jenkins/params", methods=["POST"])
|
|
292
|
+
@api_login_required
|
|
293
|
+
def get_jenkins_job_params():
|
|
294
|
+
|
|
295
|
+
payload = get_payload(request)
|
|
296
|
+
service = JenkinsService()
|
|
297
|
+
|
|
298
|
+
result = service.retrieve_job_parameters(build_id=payload["buildId"], build_number=payload["buildNumber"])
|
|
299
|
+
|
|
300
|
+
return {
|
|
301
|
+
"status": "ok",
|
|
302
|
+
"response": {
|
|
303
|
+
"parameters": result
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
@bp.route("/jenkins/build", methods=["POST"])
|
|
309
|
+
@api_login_required
|
|
310
|
+
def build_jenkins_job():
|
|
311
|
+
|
|
312
|
+
payload = get_payload(request)
|
|
313
|
+
service = JenkinsService()
|
|
314
|
+
|
|
315
|
+
result = service.build_job(build_id=payload["buildId"], params=payload["parameters"])
|
|
316
|
+
|
|
317
|
+
return {
|
|
318
|
+
"status": "ok",
|
|
319
|
+
"response": {
|
|
320
|
+
"queueItem": result
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
@bp.route("/jenkins/queue_info")
|
|
326
|
+
@api_login_required
|
|
327
|
+
def get_queue_info():
|
|
328
|
+
queue_item = request.args.get("queueItem")
|
|
329
|
+
if not queue_item:
|
|
330
|
+
raise Exception("No queueItem provided")
|
|
331
|
+
service = JenkinsService()
|
|
332
|
+
result = service.get_queue_info(int(queue_item))
|
|
333
|
+
|
|
334
|
+
return {
|
|
335
|
+
"status": "ok",
|
|
336
|
+
"response": {
|
|
337
|
+
"queueItem": result
|
|
338
|
+
}
|
|
339
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
from typing import Any, TypedDict
|
|
2
|
+
import xml.etree.ElementTree as ET
|
|
3
|
+
import jenkins
|
|
4
|
+
import logging
|
|
5
|
+
|
|
6
|
+
from flask import current_app, g
|
|
7
|
+
|
|
8
|
+
LOGGER = logging.getLogger(__name__)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class Parameter(TypedDict):
|
|
12
|
+
_class: str
|
|
13
|
+
name: str
|
|
14
|
+
description: str
|
|
15
|
+
value: Any
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class JenkinsService:
|
|
19
|
+
RESERVED_PARAMETER_NAME = "requested_by_user"
|
|
20
|
+
|
|
21
|
+
def __init__(self) -> None:
|
|
22
|
+
self._jenkins = jenkins.Jenkins(url=current_app.config["JENKINS_URL"],
|
|
23
|
+
username=current_app.config["JENKINS_USER"],
|
|
24
|
+
password=current_app.config["JENKINS_API_TOKEN"])
|
|
25
|
+
|
|
26
|
+
def retrieve_job_parameters(self, build_id: str, build_number: int) -> list[Parameter]:
|
|
27
|
+
job_info = self._jenkins.get_build_info(name=build_id, number=build_number)
|
|
28
|
+
raw_config = self._jenkins.get_job_config(name=build_id)
|
|
29
|
+
config = ET.fromstring(raw_config)
|
|
30
|
+
parameter_defs = config.find("*//parameterDefinitions")
|
|
31
|
+
if parameter_defs:
|
|
32
|
+
descriptions = {
|
|
33
|
+
define.findtext("name"): f"{define.findtext('description', '')}" + f" (default: <span class=\"fw-bold\">{define.findtext('defaultValue')}</span>)" if define.findtext('defaultValue') else ""
|
|
34
|
+
for define in parameter_defs.iterfind("hudson.model.StringParameterDefinition")
|
|
35
|
+
}
|
|
36
|
+
else:
|
|
37
|
+
descriptions = {}
|
|
38
|
+
params = next(a for a in job_info["actions"] if a.get("_class", "#NONE") == "hudson.model.ParametersAction")["parameters"]
|
|
39
|
+
params = [param for param in params if param["name"] != self.RESERVED_PARAMETER_NAME]
|
|
40
|
+
for idx, param in enumerate(params):
|
|
41
|
+
params[idx]["description"] = descriptions.get(param["name"], "")
|
|
42
|
+
|
|
43
|
+
return params
|
|
44
|
+
|
|
45
|
+
def build_job(self, build_id: str, params: dict, user_override: str = None):
|
|
46
|
+
queue_number = self._jenkins.build_job(build_id, {
|
|
47
|
+
**params,
|
|
48
|
+
self.RESERVED_PARAMETER_NAME: g.user.username if not user_override else user_override
|
|
49
|
+
})
|
|
50
|
+
return queue_number
|
|
51
|
+
|
|
52
|
+
def get_queue_info(self, queue_item: int):
|
|
53
|
+
build_info = self._jenkins.get_queue_item(queue_item)
|
|
54
|
+
LOGGER.info("%s", build_info)
|
|
55
|
+
executable = build_info.get("executable")
|
|
56
|
+
if executable:
|
|
57
|
+
return executable
|
|
58
|
+
else:
|
|
59
|
+
return {
|
|
60
|
+
"why": build_info["why"],
|
|
61
|
+
"inQueueSince": build_info["inQueueSince"],
|
|
62
|
+
"taskUrl": build_info["task"]["url"],
|
|
63
|
+
}
|
|
@@ -110,8 +110,8 @@ class ArgusDriverMatrixClient(ArgusClient):
|
|
|
110
110
|
raw_cases.append({
|
|
111
111
|
"name": case.attrib["name"],
|
|
112
112
|
"status": status,
|
|
113
|
-
"time": float(case.attrib
|
|
114
|
-
"classname": case.attrib
|
|
113
|
+
"time": float(case.attrib.get("time", 0.0)),
|
|
114
|
+
"classname": case.attrib.get("classname", ""),
|
|
115
115
|
"message": message,
|
|
116
116
|
})
|
|
117
117
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/plugins/driver_matrix_tests/controller.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{argus_alm-0.12.1 → argus_alm-0.12.2}/argus/backend/plugins/driver_matrix_tests/raw_types.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|