mirror of
https://git.openapi.site/https://github.com/desirecore/market.git
synced 2026-12-05 14:19:28 +08:00
## 问题与结果 / Problem and outcome 原流程每周检查上游并更新跟踪 Issue,更新候选的版本、来源和审核记录仍需人工准备。本 PR 增加以下处理: | 项目 | 本 PR 的行为 | | --- | --- | | 1. 检查与候选 | 每天检查上游;每轮最多处理 5 个去重的 Skill 更新候选。自动核验仅接受固定 Git 快照,并要求旧快照已有许可和准入证据。 | | 2. 核验范围 | 比较实际安装范围、根目录及嵌套许可证/Notice、结构化依赖、名称简介、兼容性声明和合集成员。包自身版本可以递增;依赖或脚本声明变化须人工复核。核验阶段不执行上游代码。 | | 3. 核验通过 | 同步 entry 和 sidecar 的来源 ref、可确认的上游版本;写入机器审核身份、真实日期和 `upstream-audit.v1.json`,将证据绑定到来源 URL、新旧 ref、内容路径、许可摘要和检查结果。目录、本地化、翻译新鲜度及适用的合集校验通过后,才创建普通 PR。 | | 4. 无法确认或校验失败 | 保留旧审核记录,创建带具体原因的草稿;不会将旧审核标记为新快照已通过。缺失版本不编造,版本回退被阻止,未知发布日期保持未知。 | | 5. 重复与失败处理 | 保留已有更新 PR 和 hold 决策;同一快照已有关闭 PR 时不重复创建。提交、推送或 PR API 失败时保留覆盖报告,并以失败退出。所有更新均不自动合并。 | | 6. 覆盖报告 | 为顶层 Skill、合集子项和内置内容输出更新状态或阻碍原因。当前 145 个顶层条目加 302 个子项,共 447 条库存记录;这不是 447 次运行验收。ZIP/Web 仅收录条目保持准入阻碍,缺新版发现依据时明确说明。 | 机器核验仅确认有限范围的来源、许可与结构化元数据一致性。非结构化依赖、行为变化、实际运行和安全性仍需结合差异人工复核;不代表上游背书。 The weekly issue-only check becomes a daily pipeline with at most five deduplicated Skill candidates per run. Eligible immutable Git snapshots receive bounded source/license/structured-metadata verification and explicit machine receipts. Catalog and localization checks must pass before a normal PR is created; blocked candidates remain drafts with the old review intact. Existing proposals and holds are preserved, failures retain coverage reports, and nothing auto-merges or claims runtime/security certification. ## Copilot 审核邀请:改动与当前状态 / Copilot review invitation 1. **原失败原因**:旧邀请任务使用 `pull_request` 上下文,请求审核时返回 `403 Resource not accessible by integration`。[失败记录](https://github.com/desirecore/market/actions/runs/41067055993/job/124101102218)属于旧提交 `732cc2a`。 2. **本 PR 的改动**:邀请流程改用 `pull_request_target` 和受信任的 base 上下文,仅调用 PR 元数据 API,不检出或执行 PR 代码。返回 422 时,必须确认当前 head 已有 Copilot 审核记录,才能按已审核处理;其他错误仍失败。 3. **生效范围**:该流程监听 opened、reopened、ready_for_review,未监听 synchronize。邀请修正需合入默认分支后,再在适用事件上验证;本 PR 的推送不能证明新邀请流程已在线生效。 4. **当前实际审核状态**:截至下方验证快照,没有审核记录,也没有待处理审核邀请。`Wait for Copilot review` 运行成功,但日志显示等待约 8 分钟后超时,按现有规则放行,**不代表 Copilot 已审核**。该等待规则未在本 PR 中修改。[等待任务日志](https://github.com/desirecore/market/actions/runs/41309461885/job/124856608594) The old invitation failed with HTTP 403. This PR moves metadata-only invitation requests to the trusted base context and verifies a current-head review before treating HTTP 422 as already reviewed. The change still needs post-merge validation on a supported event. There are currently no submitted or pending review requests; the green waiting job reflects timeout fallback, not an actual Copilot review. ## 验证快照 / Validation snapshot 验证对应提交:`24183e240c945fd72cd0c8a6b10730b18db6d1f3`,2026-11-01。 - **已修复的 CI 错误**:`test_audit_skill_update.py` 曾向 `validate_sidecar` 传入空校验器字典,触发 `KeyError: 'skill'`。现加载真实 Skill client schema,并在两处调用中传入 `ClientEntryValidator`;原测试断言保持不变。 - **本地测试**:自动核验 15、候选发布 9、目录校验器 62、合集生成器 10、上游检查 47、审核邀请流程 1、i18n 校验器 19、Office launcher 11,共 **174 项通过**。 - **本地数据检查**:目录和 i18n 校验均为 0 errors、103 条既有 warnings;翻译新鲜度与 diff 空白检查通过。 - **GitHub CI**:[`i18n Validate`](https://github.com/desirecore/market/actions/runs/41309461898)全部通过,包括目录、翻译新鲜度和联网合集检查;[`i18n Auto-Translate`](https://github.com/desirecore/market/actions/runs/41309461185)成功;[`Wait for Copilot review`](https://github.com/desirecore/market/actions/runs/41309461885)成功,但属于上述超时放行。 - **合并状态**:GitHub 返回 `mergeable: true`、`mergeStateStatus: CLEAN`;当前提交没有失败检查。PR 尚未合并。 - **尚未做的验证**:未触发真实定时更新批次、未批量创建新版 PR、未执行上游代码;新邀请流程权限和真实审核仍待验证。 All 174 local tests pass. Catalog/localization validation reports zero errors and 103 existing warnings. Current-head CI is green, including generated collection checks; GitHub reports CLEAN. Copilot review itself, the revised invitation's online permissions, and a real scheduled publication batch remain unverified. ## 发布前提与关联改动 / Operation and related changes - Actions 自动创建 PR 需要仓库设置允许;本 PR 未调整仓库管理员设置。 - 默认 `GITHUB_TOKEN` 创建的 PR 通常不会触发其他工作流,因此发布候选前会执行目录和本地化检查;合并前仍需核对实际检查与审核结果。 - 客户端同版本内容交付及 Kimi 独立官方包维护:[desirecore#5526](https://github.com/desirecore/desirecore/pull/5526);关联文档:[desirecore-docs#864](https://github.com/desirecore/desirecore-docs/pull/864)。这些链接表示关联范围,不表示本 PR 合并即可发布客户端能力。
98 lines
3.5 KiB
YAML
98 lines
3.5 KiB
YAML
name: i18n Validate
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
validate:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 15
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Detect relevant changes
|
|
id: changes
|
|
env:
|
|
EVENT_NAME: ${{ github.event_name }}
|
|
BASE_SHA: ${{ github.event.pull_request.base.sha }}
|
|
HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
|
|
PUSH_BEFORE: ${{ github.event.before }}
|
|
PUSH_AFTER: ${{ github.event.after }}
|
|
run: |
|
|
set -e
|
|
case "$EVENT_NAME" in
|
|
pull_request)
|
|
git fetch --no-tags --depth=1 origin "$BASE_SHA" 2>/dev/null || true
|
|
range="${BASE_SHA}...${HEAD_SHA}"
|
|
;;
|
|
push)
|
|
if [ -n "$PUSH_BEFORE" ] && [ "$PUSH_BEFORE" != "0000000000000000000000000000000000000000" ]; then
|
|
range="${PUSH_BEFORE}...${PUSH_AFTER}"
|
|
else
|
|
# initial push or unknown before — assume relevant
|
|
echo "relevant=true" >> "$GITHUB_OUTPUT"
|
|
exit 0
|
|
fi
|
|
;;
|
|
*)
|
|
echo "relevant=true" >> "$GITHUB_OUTPUT"
|
|
exit 0
|
|
;;
|
|
esac
|
|
changed=$(git diff --name-only "$range" || true)
|
|
if echo "$changed" | grep -qE '^(skills/|agents/|teams/|schemas/|manifest\.json$|categories\.json$|scripts/i18n/|scripts/catalog/|scripts/office/|scripts/gen-collection-children\.py$|\.github/workflows/auto-request-copilot-review\.yml$)'; then
|
|
echo "relevant=true" >> "$GITHUB_OUTPUT"
|
|
else
|
|
echo "relevant=false" >> "$GITHUB_OUTPUT"
|
|
fi
|
|
|
|
- name: Install uv
|
|
if: steps.changes.outputs.relevant == 'true'
|
|
uses: astral-sh/setup-uv@v3
|
|
|
|
- name: Run validator unit tests
|
|
if: steps.changes.outputs.relevant == 'true'
|
|
run: uv run --quiet scripts/i18n/test_validate_i18n.py
|
|
|
|
- name: Run Office launcher contract tests
|
|
if: steps.changes.outputs.relevant == 'true'
|
|
run: python3 -B scripts/office/test_runtime_launcher.py
|
|
|
|
- name: Run catalog validator unit tests
|
|
if: steps.changes.outputs.relevant == 'true'
|
|
run: |
|
|
uv run --quiet scripts/catalog/test_validate_catalog_metadata.py
|
|
uv run --quiet scripts/catalog/test_collection_generator.py
|
|
uv run --quiet scripts/catalog/test_check_upstream_health.py
|
|
uv run --quiet scripts/catalog/test_propose_upstream_updates.py
|
|
uv run --quiet scripts/catalog/test_audit_skill_update.py
|
|
uv run --quiet scripts/catalog/test_review_workflow.py
|
|
|
|
- name: Validate catalog metadata
|
|
if: steps.changes.outputs.relevant == 'true'
|
|
run: uv run --quiet scripts/catalog/validate_catalog_metadata.py --require-complete
|
|
|
|
- name: Validate i18n
|
|
if: steps.changes.outputs.relevant == 'true'
|
|
run: uv run --quiet scripts/i18n/validate-i18n.py
|
|
|
|
- name: Check for stale translations
|
|
if: steps.changes.outputs.relevant == 'true'
|
|
run: uv run --quiet scripts/i18n/translate.py --check
|
|
|
|
- name: Check generated collection children
|
|
if: steps.changes.outputs.relevant == 'true'
|
|
run: uv run --quiet scripts/gen-collection-children.py --check
|
|
|
|
- name: Skip notice
|
|
if: steps.changes.outputs.relevant != 'true'
|
|
run: echo "No i18n-relevant changes; validation skipped."
|