Pause AFFiNE projection in contributor docs

This commit is contained in:
virgil
2026-06-08 23:16:27 -07:00
parent 401768a552
commit b39c4b85d1
2 changed files with 23 additions and 12 deletions

View File

@@ -60,7 +60,7 @@ Commands:
status show Git status
commit commit all current changes with MESSAGE
push push current branch
wait wait for a pushed commit to reach AFFiNE
wait show AFFiNE projection state for a pushed commit
push-test prove write access with a temporary remote branch
trace show local/origin state and recent helper events
help show this help
@@ -79,8 +79,8 @@ Examples:
section0-docs push
section0-docs wait
AFFiNE is read-only for these docs. Make lasting changes in Markdown; the
AFFiNE copies are refreshed from Git.
AFFiNE is read-only for these docs. Make lasting changes in Markdown.
AFFiNE projection is currently paused until the native writer is ready.
USAGE
}
@@ -173,6 +173,8 @@ wait_for_projection() {
backend_ok="\$(printf "%s" "\$status_json" | json_get verification.backend.ok 2>/dev/null || true)"
native_ok="\$(printf "%s" "\$status_json" | json_get verification.nativeRead.ok 2>/dev/null || true)"
browser_status="\$(printf "%s" "\$status_json" | json_get verification.browserFreshness.status 2>/dev/null || true)"
writer_status="\$(printf "%s" "\$status_json" | json_get writer.status 2>/dev/null || true)"
writer_note="\$(printf "%s" "\$status_json" | json_get writer.note 2>/dev/null || true)"
readme_url="\$(printf "%s" "\$status_json" | python3 -c 'import json,sys
data=json.load(sys.stdin)
for doc in (data.get("projected") or {}).get("docs") or []:
@@ -180,7 +182,14 @@ for doc in (data.get("projected") or {}).get("docs") or []:
print(doc.get("url",""))
break' 2>/dev/null || true)"
printf " origin=%s projected=%s state=%s%s\n" "\${origin_commit:-unknown}" "\${projected_commit:-none}" "\${state:-unknown}" "\${completed_at:+ completed=\$completed_at}"
printf " writer: %s\n" "\${writer_status:-unknown}"
printf " verification: backend=%s native-read=%s browser=%s\n" "\${backend_ok:-unknown}" "\${native_ok:-unknown}" "\${browser_status:-not_verified}"
if [ "\$state" = "writer-frozen" ] || [ "\$writer_status" = "frozen" ]; then
echo "AFFiNE projection is paused. Your Git push is still the source of truth."
[ -z "\$writer_note" ] || echo "Reason: \$writer_note"
json_log "wait.writer_frozen" "\$expected"
return 2
fi
if [ "\$projected_commit" = "\$expected" ] && { [ "\$backend_ok" = "True" ] || [ "\$backend_ok" = "true" ]; } && { [ "\$native_ok" = "True" ] || [ "\$native_ok" = "true" ]; }; then
echo "Projected and verified through AFFiNE backend and native read."
[ -z "\$readme_url" ] || echo "Doc: \$readme_url"