Publish curated Unraid-AppOps-Gateway source from a506550ef83ef2d81651e37c98a89f7ee330c730
This commit is contained in:
1 parent
2facb8de34
commit
767e66921e
68 files changed
+15924
-313
No files matched your search
@@ -217,7 +217,9 @@ class GiteaActionsConnector(BaseConnector):
|
||||
"order": "asc",
|
||||
},
|
||||
)
|
||||
pending_payload = self._request(
|
||||
# Keep pending inventory in the all-or-error fetch, but it is not
|
||||
# runnable queue pressure and must not drive runner diagnostics.
|
||||
self._request(
|
||||
"/api/v1/admin/actions/jobs",
|
||||
{
|
||||
"status": "pending",
|
||||
@@ -267,9 +269,10 @@ class GiteaActionsConnector(BaseConnector):
|
||||
]
|
||||
queued_jobs = [
|
||||
item
|
||||
for payload in (queued_payload, pending_payload)
|
||||
for item in (
|
||||
payload.get("jobs") if isinstance(payload.get("jobs"), list) else []
|
||||
queued_payload.get("jobs")
|
||||
if isinstance(queued_payload.get("jobs"), list)
|
||||
else []
|
||||
)
|
||||
if isinstance(item, dict)
|
||||
]
|
||||
@@ -462,8 +465,7 @@ class GiteaActionsConnector(BaseConnector):
|
||||
"offline": sum(item["status"] != "online" for item in runners),
|
||||
},
|
||||
"queue": {
|
||||
"queued": int(queued_payload.get("total_count", 0) or 0)
|
||||
+ int(pending_payload.get("total_count", 0) or 0),
|
||||
"queued": int(queued_payload.get("total_count", 0) or 0),
|
||||
"inProgress": int(
|
||||
active_payload.get("total_count", len(active_jobs)) or 0
|
||||
),
|
||||
@@ -476,12 +478,6 @@ class GiteaActionsConnector(BaseConnector):
|
||||
if isinstance(queued_payload.get("jobs"), list)
|
||||
else []
|
||||
)
|
||||
or int(pending_payload.get("total_count", 0) or 0)
|
||||
> len(
|
||||
pending_payload.get("jobs")
|
||||
if isinstance(pending_payload.get("jobs"), list)
|
||||
else []
|
||||
)
|
||||
),
|
||||
"blockedByRunnerLabels": sorted(set(blocked_labels))[:20],
|
||||
"staleActiveRunnerLabels": sorted(set(stale_active_labels))[:20],
|
||||
|
||||
@@ -11,8 +11,22 @@ from ..core.config import settings
|
||||
from ..core.redaction import redact_message
|
||||
from .base import BaseConnector
|
||||
|
||||
|
||||
_PORTAINER_DEFAULT_TIMEOUT_SECONDS = 8.0
|
||||
_CONTROLLER_OWNED_CI_CONTAINER_NAMES = frozenset({
|
||||
'itworx-ci-checks',
|
||||
'itworx-ci-backend',
|
||||
'itworx-ci-frontend',
|
||||
'itworx-ci-security',
|
||||
'itworx-ci-browser',
|
||||
'itworx-ci-build',
|
||||
'itworx-security-runner',
|
||||
'itworx-validation-runner-2',
|
||||
'itworx-validation-runner-3',
|
||||
'itworx-docker-runner',
|
||||
'itworx-browser-runner',
|
||||
'itworx-validation-runner-burst-1',
|
||||
'gitea-runner-dind',
|
||||
})
|
||||
|
||||
|
||||
@dataclass
|
||||
@@ -213,6 +227,10 @@ class PortainerConnector(BaseConnector):
|
||||
if not selected:
|
||||
return {'status': 'not_found', 'reason': f'Container {target} not found'}
|
||||
|
||||
selected_name = str(selected.get('name', '')).strip().strip('/').lower()
|
||||
if selected_name in _CONTROLLER_OWNED_CI_CONTAINER_NAMES:
|
||||
return {'status': 'blocked', 'reason': 'controller_owned_ci_lifecycle'}
|
||||
|
||||
container_name = selected.get('id') or selected.get('name')
|
||||
if not container_name:
|
||||
return {'status': 'error', 'reason': 'Unable to resolve container identifier'}
|
||||
|
||||
Reference in new issue
Block a user