feat(tools): ParseResponse 스키마를 검증하는 validate_dom.py 도구 추가#269
feat(tools): ParseResponse 스키마를 검증하는 validate_dom.py 도구 추가#269seonghobae wants to merge 4 commits into
Conversation
|
👋 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
There was a problem hiding this comment.
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.pyCLI/script to validate a JSON file againstParseResponse. - 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.
| 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) |
What (구현 내용)
ParseResponse)를 올바르게 준수하는지 검증할 수 있는tools/validate_dom.py스크립트 작성tests/test_tools_validate_dom.py작성 및 다양한 Edge Case 검증 (스키마 에러, JSON 포맷 에러, 파일 없음 등)CHANGELOG.md업데이트 완료Why (해결하는 문제)
Impact (성능/영향)
pragma: no cover및run_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