Skip to content

feat(tools): ParseResponse 스키마를 검증하는 validate_dom.py 도구 추가#269

Open
seonghobae wants to merge 4 commits into
developfrom
feature/validate-dom-tool-15943999054873469401
Open

feat(tools): ParseResponse 스키마를 검증하는 validate_dom.py 도구 추가#269
seonghobae wants to merge 4 commits into
developfrom
feature/validate-dom-tool-15943999054873469401

Conversation

@seonghobae

Copy link
Copy Markdown
Collaborator

What (구현 내용)

  • NewsDOM API의 JSON 출력물이 Pydantic 스키마(ParseResponse)를 올바르게 준수하는지 검증할 수 있는 tools/validate_dom.py 스크립트 작성
  • 테스트 파일 tests/test_tools_validate_dom.py 작성 및 다양한 Edge Case 검증 (스키마 에러, JSON 포맷 에러, 파일 없음 등)
  • CHANGELOG.md 업데이트 완료

Why (해결하는 문제)

  • 파서가 생성하는 JSON 결과물들이 API 명세와 일치하는지 개발 도중에 쉽게 검증할 수 있는 오프라인 유틸리티 기능 부재 문제를 해결

Impact (성능/영향)

  • 부가적인 도구 추가이므로 기존 API 서비스 구동 및 성능에 영향을 주지 않음
  • pragma: no coverrun_module 등을 사용하여 tools/validate_dom.py 테스트 커버리지 100% 확보 완료

Measurement (측정/검증 방법)

  • uv run pytest --cov=tools --cov-branch --cov-report=term-missing --cov-fail-under=100 실행하여 커버리지 100% 달성 및 통과 확인 완료

PR created automatically by Jules for task 15943999054873469401 started by @seonghobae

Copilot AI review requested due to automatic review settings July 2, 2026 22:20
@google-labs-jules

Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot couldn't run its full agentic review because no GitHub Actions runner was available. Make sure your repository has a runner available to run Copilot's review, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.

Adds an offline validation utility to check whether NewsDOM JSON outputs conform to the ParseResponse Pydantic schema, along with tests and a changelog entry.

Changes:

  • Added tools/validate_dom.py CLI/script to validate a JSON file against ParseResponse.
  • Added pytest coverage for success and multiple failure modes (schema error, JSON parse error, missing file, wrong extension, module execution).
  • Documented the new tool in CHANGELOG.md.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
tools/validate_dom.py New CLI tool to validate DOM JSON files against ParseResponse.
tests/test_tools_validate_dom.py New tests covering CLI behavior and common error conditions.
CHANGELOG.md Notes the addition of the new validation tool.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tools/validate_dom.py Outdated
Comment thread tools/validate_dom.py Outdated
Comment thread tools/validate_dom.py Outdated
Comment thread tools/validate_dom.py Outdated
Comment thread tools/validate_dom.py
Comment on lines +48 to +55
try:
validate_dom(args.input)
print(
"Validation successful: The JSON file strictly matches the ParseResponse schema."
)
except Exception as e:
print(f"Error: {e}", file=sys.stderr)
sys.exit(1)
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.

2 participants