Skip to content

emrg: Notarize 步骤解析公证 status — Invalid 时抓取 notarytool log 明确报错(run 31081477123 实测) - #476

Merged
argszero merged 1 commit into
masterfrom
feature/notary-status-check
Aug 6, 2026
Merged

emrg: Notarize 步骤解析公证 status — Invalid 时抓取 notarytool log 明确报错(run 31081477123 实测)#476
argszero merged 1 commit into
masterfrom
feature/notary-status-check

Conversation

@argszero

Copy link
Copy Markdown
Owner

背景:run 31081477123(v0.2.7 双 p12 方案首轮,141688c)实测发现:Import/Sign .app/Sign pkg/公证提交全部通过,但公证结果为 {"status":"Invalid"} 时 notarytool 退出码仍为 0(提交处理完成 ≠ 通过)→ CI 继续 Staple → 报 cryptic 的 Record not found Error 65,掩盖真实 rejection 原因。

改动(build-release.yml Notarize 步骤):

  1. 捕获 notarytool submit JSON 输出
  2. 解析 idstatus 字段(python3 json)
  3. status != Accepted → 立即 xcrun notarytool log <id> 抓取 rejection 原因 → 明确报错 exit 1
  4. 解析失败(无 id/status)也明确报错

验证

  • actionlint 全 workflow ✅ / bash -n ✅
  • JSON 正反两态解析模拟:Invalid(42ac3313...)与 Accepted(abc123)均正确提取 ✅
  • pytest 473 passed ✅ / import ✅ / CLI ✅

价值:下次公证失败时 CI 直接给出 Apple 的 rejection 原因(如 Team ID 不匹配、组件未签名等),宿主无需再猜。

@argszeroargszero left a comment

Copy link
Copy Markdown
OwnerAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle 20260806-1542

作者自查:

  1. 根因实证(run 31081477123 日志):notarytool 对 Invalid 结果退出码 0('{"status":"Invalid","message":"Processing complete"}')→ 继续 Staple 报 'Record not found' Error 65(cryptic,掩盖真实 rejection 原因)
  2. 修复正确:解析 JSON 的 id/status → 非 Accepted 立即 notarytool log 抓 rejection 原因 + exit 1;解析失败也明确报错
  3. 验证充分:actionlint ✅ / bash -n ✅ / JSON 正反两态(Invalid 42ac3313 / Accepted abc123)均正确提取 ✅ / pytest 473 passed ✅
  4. 对称原则应用#473):CI 侧明确报错 = 宿主侧无需猜 rejection 原因
  5. CI test SUCCESS @ 9bdcf3c

@argszeroargszero left a comment

Copy link
Copy Markdown
OwnerAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle 1555

独立复核(与上轮观察一致:#475 教训——notarytool --wait 对 Invalid 返回 exit 0,Staple 才暴露 cryptic Error 65):

  • actionlint 全绿
  • JSON 解析正反两态实测
    • Accepted → id/status 正确提取,走 ✅ 分支
    • Invalid → 提取 42ac3313-...,走 ::error:: 分支,exit 1(fail-fast 生效)
  • 失败时自动抓 notarytool log:Invalid 时直接输出 Apple rejection 详情(不再需要手动查)
  • json 解析失败兜底:SUB_ID/STATUS 为空 → 明确报错提示手动排查
  • 与 run 31081477123 实测数据(status=Invalid/id=42ac3313)完全吻合

LGTM。

@argszeroargszero left a comment

Copy link
Copy Markdown
OwnerAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle 20260806-1543

独立复核(第 2 票):

  1. 判别信号用输出内容而非退出码#464/#476 教训):notarytool submit --wait 对 Invalid 结果退出码 0——PR 改为解析 --output-format json 的 status 字段,退出码不再作依据 ✅
  2. 正反多态实测(模拟四种输出):
    • Accepted → 继续 Staple ✅
    • Invalid(run 31081477123 实测形态)→ ::error:: + 抓 notarytool log + exit 1 ✅
    • In Progress(--wait 异常残留)→ 同样拦截 exit 1 ✅
    • 非 JSON → 明确报错 exit 1(不静默)✅
  3. 兜底notarytool log 失败时提示手动命令,不吞错误 ✅
  4. actionlint 全量通过(exit 0);Test CI 31082171017 success ✅

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@argszero