Skip to content

confluence-mdx: reverse-sync push 안전장치를 추가합니다#958

Merged
jk-kim0 merged 9 commits intomainfrom
jk/rewrite-pr-955
Mar 31, 2026
Merged

confluence-mdx: reverse-sync push 안전장치를 추가합니다#958
jk-kim0 merged 9 commits intomainfrom
jk/rewrite-pr-955

Conversation

@jk-kim0
Copy link
Copy Markdown
Contributor

@jk-kim0 jk-kim0 commented Mar 30, 2026

Summary

  • 버전 충돌 감지: Confluence API 409 응답을 PushConflictError로 처리합니다
  • 원본 백업: push 전 현재 XHTML을 reverse-sync.backup.xhtml에 저장합니다
  • 확인 프롬프트: push 전 y/N 확인, --yes 플래그로 스킵 가능합니다
  • 배치 push: verify 전체 완료 후 요약 → 확인 → 일괄 push로 변경합니다
  • 비대화형 환경에서 --yes 없이 push 시 에러로 종료합니다
  • --failures-only early-break를 push 모드에서 비활성화합니다
  • _clean_reverse_sync_artifacts()에서 backup 파일을 보존합니다
  • --failures-only JSON 필터에 push conflict/error도 포함합니다

변경 파일

  • confluence-mdx/bin/reverse_sync/confluence_client.pyget_page_body() 추가
  • confluence-mdx/bin/reverse_sync_cli.py — push 안전장치 전체 구현
  • confluence-mdx/tests/test_reverse_sync_cli.py — 84개 테스트 (신규 12개)

Test plan

  • python3 -m pytest tests/test_reverse_sync_cli.py — 84 passed
  • python3 -m pytest tests/ --ignore=tests/test_unused_attachments.py — 891 passed

Debate Review Summary

CC-Codex debate review 7라운드 완료. 미해결 issue 0건.

  • isu_001 [accepted] _print_results가 push conflict/error를 미반영 — R1 Codex 제기, R1 CC accept, R1 반영
  • isu_002 [withdrawn] push 모드 --failures-only --limit early-break 비활성화 — R3 Codex 제기, R3 CC rebut (의도적 설계), R3 Codex withdraw
  • isu_003 [accepted] 단일 파일 push 확인 프롬프트에 frontmatter title 표시 — R5 Codex 제기, R5 CC accept, R5 반영

🤖 Generated with Claude Code

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
querypie-docs Ready Ready Preview, Comment Mar 31, 2026 6:06am

Request Review

- 버전 충돌 감지: Confluence API 409 응답을 PushConflictError로 처리합니다
- 원본 백업: push 전 현재 XHTML을 reverse-sync.backup.xhtml에 저장합니다
- 확인 프롬프트: push 전 y/N 확인, --yes 플래그로 스킵 가능합니다
- 배치 push: verify 전체 완료 후 요약 → 확인 → 일괄 push로 변경합니다

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jk-kim0 jk-kim0 force-pushed the jk/rewrite-pr-955 branch from 1fc9b01 to 20fc5fd Compare March 30, 2026 19:25
@jk-kim0 jk-kim0 changed the title confluence-mdx: rewrite PR 955 with sentence-break regression test confluence-mdx: reverse-sync push 안전장치를 추가합니다 Mar 30, 2026
@jk-kim0 jk-kim0 marked this pull request as ready for review March 30, 2026 19:26
- 배치 push에서 conflict/error 발생 시 exit 1로 종료합니다
- _clean_reverse_sync_artifacts()에서 backup.xhtml을 보존합니다

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Ctrl-C 시 exit 0이 아닌 130으로 종료되도록 수정합니다.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
CI/자동화에서 --yes 없이 push 실행 시 silent skip 대신 exit 1로 처리합니다.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
push 시 모든 파일을 검증한 후 일괄 push하도록 보장합니다.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jk-kim0
Copy link
Copy Markdown
Contributor Author

jk-kim0 commented Mar 31, 2026

[debate-review][sha:20fc5fd75759988d03c9931c50532ddeaf13681e] 10라운드 후 합의에 도달하지 못했습니다.

Manual review required.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jk-kim0
Copy link
Copy Markdown
Contributor Author

jk-kim0 commented Mar 31, 2026

[debate-review][sha:96062a3c3c64748fad798da060c862f4e9812843] 7라운드 만에 합의에 도달했습니다.

Debate Summary

  • isu_001 [accepted] _print_results가 push conflict/error를 미반영 — R1 Codex 제기, R1 CC accept, R1 반영
  • isu_002 [withdrawn] push 모드 --failures-only --limit early-break 비활성화 — R3 Codex 제기, R3 CC rebut, R3 Codex withdraw
  • isu_003 [accepted] 단일 파일 push 확인 프롬프트에 frontmatter title 표시 — R5 Codex 제기, R5 CC accept, R5 반영

Applied Fixes

  • confluence-mdx/bin/reverse_sync_cli.py:492 - (reported by codex, applied by codex) 배치 push는 r['push']['status']에 conflict/error를 기록하도록 바뀌었는데, _print_results()는 여전히 verify status만으로 필터링·배지·요약을 계산합니다. 그 결과 reverse-sync push --branch --failures-only의 텍스트 출력에서는 push 충돌이 아예 숨겨지고, 일반 출력에서도 실제로는 push 실패한 페이지가 PASS로 집계되어 exit code 1과 모순됩니다. 새 push 실패 상태를 텍스트 출력 경로에도 반영해야 합니다.
  • confluence-mdx/bin/reverse_sync_cli.py:1006 - (reported by codex, applied by codex) 단일 파일 push 확인 프롬프트는 result['title']를 기대하지만 _do_verify()/run_verify() 결과에는 그 필드가 없어서 실제로는 항상 page_id를 제목 자리에 다시 출력합니다.

Withdrawn Findings

  • confluence-mdx/bin/reverse_sync_cli.py:800 - push 모드에서는 if not push 조건 때문에 --failures-only와 함께 준 --limit가 완전히 무시됩니다. reverse-sync push --branch ... --failures-only --limit 1 --yes는 1건만 다루는 대신 브랜치 전체를 검증하고 모든 pass 문서를 push할 수 있어, 사용자가 명시한 처리 한도를 깨고 대량 반영을 유발합니다.
    Reason: PR 설계와 스펙이 push 모드에서 verify 전체 완료 후 일괄 push를 요구하므로, --failures-only --limit의 early-break를 끄는 현재 동작은 의도된 변경입니다.

@jk-kim0 jk-kim0 self-assigned this Mar 31, 2026
CI 환경에 Confluence 인증 정보가 없어 _ensure_confluence_config()가
sys.exit(1)을 호출하던 문제를 수정합니다.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jk-kim0 jk-kim0 merged commit f0d7ba0 into main Mar 31, 2026
7 checks passed
@jk-kim0 jk-kim0 deleted the jk/rewrite-pr-955 branch March 31, 2026 06:09
Sign up for free to 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