mirror of
https://git.openapi.site/https://github.com/desirecore/market.git
synced 2026-12-05 10:39:20 +08:00
feat(catalog): 已有自动草稿 PR 按最新 main 重审通过后自动转 Ready (#419)
## 概述 / Summary 增强每日 `Upstream Health` 工作流中的 `propose_upstream_updates.py`:当已有自动生成的 **Draft PR** 按最新 `main` 规则与 `special-review.v1.json` 重新审核通过时,自动同步 `main`、运行全部仓库校验、刷新机器审计回执并解除 Draft(`gh pr ready`)。 ### 安全边界(绝不误伤人工 PR) 1. **仅处理自动草稿**:必须同时满足 `isDraft == true`、目标分支与当前 `updates/<id>-<head[:12]>` 完全一致,且 PR 上所有提交与改动文件均来自自动提案器(或普通 `Merge branch 'main'`)。若检测到任何人工提交或额外文件,立即跳过保留原样。 2. **绝不 rebase / force-push**:使用普通 `git merge --no-edit <main_sha>` 同步主干;遇到合并冲突直接保持 Draft。 3. **强制重跑全部仓库校验**:推送与 `gh pr ready` 前强制执行 `validate_catalog_metadata.py --require-complete`、`validate-i18n.py`、`translate.py --check`(及合集的 `gen-collection-children.py --check`),任意校验失败立即中止并保留 Draft;清理过期的 `docs/update-reviews/<id>-*.json` 阻断记录。 ## 变更 / Changes - `scripts/catalog/propose_upstream_updates.py`:新增 `_is_automated_draft_only` 与 `promote_verified_draft_pr`,并在已有 PR 重审通过分支挂钩 - `scripts/catalog/test_propose_upstream_updates.py`:新增 3 项单测覆盖自动转 Ready、人工修改保护与校验失败拦截 - `docs/verified-update-automation.md`:同步更新自动草稿重审转 Ready 的行为说明 ## 验证 / Validation - `uv run --offline --quiet scripts/catalog/test_propose_upstream_updates.py` - `uv run --offline --quiet scripts/catalog/validate_catalog_metadata.py --require-complete` - `uv run --offline --quiet scripts/i18n/validate-i18n.py` - `uv run --offline --quiet scripts/i18n/translate.py --check` - `git diff --check`
This commit is contained in:
1 parent
4a027f0db1
commit
2d96fc9c41
3 files changed
+219
-3
No files matched your search
@@ -102,7 +102,12 @@ be reviewed/merged separately by a maintainer.
|
||||
Daily discovery remains 09:23 Asia/Singapore (GitHub can delay execution). Git
|
||||
and configured-source publishers each have a five-candidate cap. An existing
|
||||
open PR for a skill is preserved, not overwritten; the same closed candidate is
|
||||
not recreated. Discovery/audit/validation failures retain old admission and
|
||||
not recreated. When an existing **bot-authored Draft PR** for the exact same
|
||||
target SHA passes fresh re-audit under updated `main` policy/special-review
|
||||
records (with zero manual human commits/files on the draft branch), the proposer
|
||||
merges `main` normally (no rebase/force-push), re-runs all catalog/i18n
|
||||
validators, updates the receipt/body, and marks the PR Ready (`gh pr ready`).
|
||||
Discovery/audit/validation failures retain old admission and
|
||||
become drafts/manual findings. Nothing automatically promotes listing-only.
|
||||
|
||||
## Offline checks
|
||||
|
||||
Reference in new issue
Block a user