停止/删除改为纯本地操作,页面不再查询 Gitea

停止只在本平台标记已取消、删除只删本地记录,均不再调用 GitHub/Gitea 的查询或取消接口,操作秒响应;构建状态完全以工作流结束回调为准,未收到回调的在途任务由纯本地 6 小时超时兜底。

移除上一版的 Gitea 网页登录取消、网页账密配置项、runs 批量状态查询及两后端 get_run/cancel_run 接口,消除页面加载时的远程等待。
This commit is contained in:
naeeo
2026-09-30 09:20:28 +08:00
parent c8f41a34c0
commit 6e5754fb59
7 changed files with 49 additions and 541 deletions
-23
View File
@@ -18,13 +18,6 @@ class DispatchResult:
html_url: str = '' # 平台上的运行详情页地址
@dataclass
class RunInfo:
finished: bool # 是否已进入终态
status: str = '' # 终态结论:success/failure/cancelled/skipped;未结束为进行中状态
html_url: str = ''
# rdgen 目标平台 -> 工作流文件名(两平台同名)
WORKFLOW_FILES = {
'windows': 'generator-windows.yml',
@@ -57,22 +50,6 @@ class BuildBackend:
"""触发工作流。inputs 为完整输入字典(GitHub/Gitea 均为 {ref, inputs})。"""
raise NotImplementedError
def get_run(self, run_id, *, timeout=12):
"""查询单次运行;网络异常或非 200 返回 None(调用方按「仍在进行」处理)。"""
raise NotImplementedError
def get_runs_batch(self, run_ids, *, timeout=12):
"""批量查询多个运行,返回 {str(run_id): RunInfo}。
列表页一次刷新多个在途任务时使用;平台不支持或查询失败返回 None,
调用方退化为逐个 get_run。返回字典中缺失的 id 由调用方逐个兜底。
"""
return None
def cancel_run(self, run_id, *, timeout=15):
"""请求平台取消一次运行;成功无返回,已结束时抛 BackendError(kind='finished')。"""
raise NotImplementedError
def log_url(self, run_id) -> str:
raise NotImplementedError