mirror of
https://github.com/Yuyi-Oak/BlueArchiveToolkit.git
synced 2026-09-18 07:24:55 +08:00
feat(bat): 补全工作流校验与调度过滤
新增 parse clear-cache 和 i18n validate,补齐 schedule 的作用域过滤与单轮执行上限,并将列表过滤参数暴露给 bat-api dashboard。同步 RPC、OpenAPI、用户文档和回归测试。 Refs #43
This commit is contained in:
@@ -52,6 +52,16 @@ bat parse run \
|
||||
|
||||
解析结果会刷新 `official-parse-cache.json`、`official-textunit-index.json` 和翻译队列。`--force` 忽略已有解析缓存,但仍要求输入 release 已通过官方下载 manifest 校验。
|
||||
|
||||
清理当前 release 的可再生解析缓存和离线翻译队列:
|
||||
|
||||
```bash
|
||||
bat parse clear-cache \
|
||||
--resource-root /tmp/bat-resources/versions/<release-id> \
|
||||
--force
|
||||
```
|
||||
|
||||
该命令不会删除 `translation-tasks.sqlite`;worker 状态必须通过任务接口单独维护。
|
||||
|
||||
批量 UnityFS 重打包使用 JSON spec。spec 的 `schema_version` 当前为 `1`,支持 `text_asset`、`string_field` 和受支持的语义 `field` 操作:
|
||||
|
||||
```bash
|
||||
@@ -81,6 +91,17 @@ bat i18n set \
|
||||
|
||||
也可以使用 `--translated-file` 读取 UTF-8 文本。工作台会保存 source text、release ID、TextUnit 目标和人工译文;发布前会重新读取当前 TextUnit 索引,拒绝过期 release、source text 或 patch 目标。
|
||||
|
||||
发布前可只做工作台审计:
|
||||
|
||||
```bash
|
||||
bat i18n validate \
|
||||
--resource-root /tmp/bat-resources/versions/<release-id> \
|
||||
--translation-file /tmp/bat-workbench.json
|
||||
```
|
||||
|
||||
报告会区分未审核、原文未变化、可直接 `i18n publish` 的 TextAsset,以及必须使用
|
||||
`parse repack` 的 TypeTree/嵌套 archive 条目。
|
||||
|
||||
发布汉化 release:
|
||||
|
||||
```bash
|
||||
@@ -123,7 +144,12 @@ bat res schedule run --state-dir /tmp/bat-schedule
|
||||
|
||||
`parse schedule add` 默认动作是 `run`,`i18n schedule add` 默认动作也是 `run`;可以用 `--schedule-action repack` 或 `--schedule-action publish` 选择对应动作。`--schedule-count` 限定执行次数,省略表示周期无限执行;没有 `--schedule-every` 的计划执行一次后自动停用。
|
||||
|
||||
`schedule update` 可以用 `--schedule-clear-every` 将周期计划改为单次计划;`schedule remove` 会删除计划。`schedule run --force` 会忽略到期时间立即执行指定计划。
|
||||
`res/parse/i18n schedule list` 默认只显示对应一级命令的计划;也可以用
|
||||
`--schedule-id`、`--schedule-enabled` 或 `--schedule-disabled` 过滤。计划删除和执行
|
||||
会校验一级命令作用域,避免误操作其他工作流。`schedule update` 可以用
|
||||
`--schedule-clear-every` 将周期计划改为单次计划;`schedule remove` 会删除计划。
|
||||
`schedule run --force` 会忽略到期时间立即执行指定计划,`--schedule-max-runs N`
|
||||
限制本轮最多执行 N 个到期计划。
|
||||
|
||||
## bat-api 调度接口
|
||||
|
||||
@@ -137,10 +163,12 @@ dashboard 通过 `bat-api` 转发到 Rust `bat.sock`,不维护第二份计划
|
||||
|
||||
`bat-api` 对应接口为 `GET /admin/schedules` 和
|
||||
`POST /admin/control/schedule-add|schedule-update|schedule-remove|schedule-run`,
|
||||
均要求配置 `BAT_API_AUTH_TOKEN` 并携带管理 token。请求字段沿用 Rust
|
||||
均要求配置 `BAT_API_AUTH_TOKEN` 并携带管理 token。列表接口支持 `id`、`group`、
|
||||
`enabled` query 过滤;请求字段沿用 Rust
|
||||
contract:`id`、`group`、`action`、`args`、`next_run_unix_seconds`、
|
||||
`delay_seconds`、`every_seconds`、`count`、`clear_args`、`clear_every`、
|
||||
`enabled`;`schedule.run` 额外接受 `force`。
|
||||
`enabled`;`schedule.list` 额外接受 `id`、`group`、`enabled` 过滤,
|
||||
`schedule.run` 额外接受 `group`、`force` 和 `max_runs`。
|
||||
|
||||
## 边界
|
||||
|
||||
|
||||
Reference in New Issue
Block a user