Publish curated ITWorx_MCP_Hub source from 6c7434368ce2a594005983c5a6601a31a639e7f1
This commit is contained in:
1 parent
77946d62c4
commit
6d40ab975c
86 files changed
+6784
-1478
No files matched your search
@@ -777,9 +777,7 @@ class GiteaClient:
|
||||
),
|
||||
)
|
||||
|
||||
def reopen_pull_request(
|
||||
self, repository: RegisteredRepository, index: int
|
||||
) -> dict[str, Any]:
|
||||
def reopen_pull_request(self, repository: RegisteredRepository, index: int) -> dict[str, Any]:
|
||||
return cast(
|
||||
dict[str, Any],
|
||||
self._request(
|
||||
@@ -822,9 +820,7 @@ class GiteaClient:
|
||||
return self._merge_strategy_key
|
||||
payload = self._request(self._path("version"))
|
||||
version = payload.get("version") if isinstance(payload, dict) else None
|
||||
legacy_match = re.fullmatch(
|
||||
r"1\.(14|25|26|27)(?:\.\d+)?(?:[-+].*)?", str(version or "")
|
||||
)
|
||||
legacy_match = re.fullmatch(r"1\.(14|25|26|27)(?:\.\d+)?(?:[-+].*)?", str(version or ""))
|
||||
modern_match = re.fullmatch(r"(28)(?:\.\d+){1,2}(?:[-+].*)?", str(version or ""))
|
||||
if legacy_match is None and modern_match is None:
|
||||
raise GiteaError(
|
||||
@@ -835,9 +831,7 @@ class GiteaClient:
|
||||
),
|
||||
)
|
||||
self._merge_strategy_key = (
|
||||
"Do"
|
||||
if legacy_match is not None and legacy_match.group(1) in {"14", "25"}
|
||||
else "do"
|
||||
"Do" if legacy_match is not None and legacy_match.group(1) in {"14", "25"} else "do"
|
||||
)
|
||||
return self._merge_strategy_key
|
||||
|
||||
@@ -1053,14 +1047,19 @@ class GiteaClient:
|
||||
payload = payload.get("workflow_runs") or payload.get("runs")
|
||||
return self._as_list(payload)
|
||||
|
||||
def rerun_action_run(
|
||||
self, repository: RegisteredRepository, run_id: int
|
||||
) -> dict[str, Any]:
|
||||
def rerun_action_run(self, repository: RegisteredRepository, run_id: int) -> dict[str, Any]:
|
||||
return cast(
|
||||
dict[str, Any],
|
||||
self._request(
|
||||
self._path("repos", repository.owner, repository.name,
|
||||
"actions", "runs", str(run_id), "rerun"),
|
||||
self._path(
|
||||
"repos",
|
||||
repository.owner,
|
||||
repository.name,
|
||||
"actions",
|
||||
"runs",
|
||||
str(run_id),
|
||||
"rerun",
|
||||
),
|
||||
method="POST",
|
||||
),
|
||||
)
|
||||
|
||||
@@ -100,10 +100,12 @@ class AuditEvent(BaseModel):
|
||||
matched_rule_ids=trace.matched_rule_ids,
|
||||
policy_trace=tuple(item.model_dump(mode="json") for item in trace.steps),
|
||||
arguments_hash=hashlib.sha256(raw).hexdigest(),
|
||||
sanitized_arguments=sanitize_arguments({
|
||||
**dict(context.arguments),
|
||||
**({"_result": result_summary} if result_summary else {}),
|
||||
}),
|
||||
sanitized_arguments=sanitize_arguments(
|
||||
{
|
||||
**dict(context.arguments),
|
||||
**({"_result": result_summary} if result_summary else {}),
|
||||
}
|
||||
),
|
||||
duration_ms=min(120_000, int((time.monotonic() - started) * 1000)),
|
||||
outcome=outcome,
|
||||
error_code=error_code,
|
||||
|
||||
@@ -117,7 +117,11 @@ class Governance:
|
||||
) -> None:
|
||||
self.audit.append(
|
||||
AuditEvent.from_context(
|
||||
context, trace, outcome=outcome, started=started, error_code=error_code,
|
||||
context,
|
||||
trace,
|
||||
outcome=outcome,
|
||||
started=started,
|
||||
error_code=error_code,
|
||||
result_summary=result_summary,
|
||||
)
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user