-
Notifications
You must be signed in to change notification settings - Fork 0
Add minimal problem schema + CI smoke set + schema warnings #52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Chore: 問題のYAML構文/メタ検証とインデックス生成のワークフロー追加
- problems/schema/problem.schema.json(最小スキーマ) - scripts/validate_yaml.py で jsonschema による警告検証 - ci/smoke-set.yaml を追加(CLI-001/WEB-001/NET-001) - docs/SMOKE-SET.md を追加 - CIで jsonschema をインストール
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a minimal problem schema validation system with JSON Schema, adds CI smoke testing capabilities, and implements a gradual enforcement approach for schema compliance. The changes focus on establishing basic validation infrastructure while maintaining backward compatibility.
- Introduces minimal JSON Schema for problem structure validation with warning-based enforcement
- Adds CI smoke test set containing three core problems (CLI-001, WEB-001, NET-001) for quick validation
- Implements validation and index building scripts with graceful error handling
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/validate_yaml.py | Core validation script that checks YAML syntax and schema compliance with warnings |
| scripts/build_index.py | Generates problem index JSON for downstream consumption |
| problems/schema/problem.schema.json | Minimal JSON schema defining required problem structure |
| problems/expert/RTC-001.yaml | Resolves merge conflicts in WebRTC problem definition |
| docs/SMOKE-SET.md | Documentation for CI smoke test functionality |
| ci/smoke-set.yaml | Configuration file listing problems for smoke testing |
| .github/workflows/validate-problems.yml | CI workflow for automated problem validation and indexing |
Comments suppressed due to low confidence (1)
problems/expert/RTC-001.yaml:1
- This file contains unresolved Git merge conflict markers. The conflict should be fully resolved by removing all merge markers and ensuring only one clean version of the content remains.
# Req2Run Problem: WebRTC Video Conferencing Server
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| try: | ||
| import jsonschema | ||
| except Exception: |
Copilot
AI
Sep 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Catching generic Exception is too broad. Should catch specific ImportError to match the pattern used for PyYAML import above.
| except Exception: | |
| except ImportError: |
| except Exception: | ||
| pass |
Copilot
AI
Sep 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Silent exception handling makes debugging difficult. Consider logging the error or at least catching specific exceptions like yaml.YAMLError or FileNotFoundError.
| except Exception: | |
| pass | |
| except yaml.YAMLError as e: | |
| print(f"YAML error in file {path}: {e}", file=sys.stderr) | |
| except FileNotFoundError as e: | |
| print(f"File not found: {path}: {e}", file=sys.stderr) | |
| except Exception as e: | |
| print(f"Error processing file {path}: {e}", file=sys.stderr) |
概要
[-V VALIDATOR] [--base-uri BASE_URI] [--version]
schema
JSON Schema Validation CLI
positional arguments:
schema the path to a JSON Schema to validate with (i.e.
schema.json)
options:
-h, --help show this help message and exit
-i INSTANCES, --instance INSTANCES
a path to a JSON instance (i.e. filename.json) to
validate (may be specified multiple times). If no
instances are provided via this option, one will be
expected on standard input.
-F ERROR_FORMAT, --error-format ERROR_FORMAT
the format to use for each validation error message,
specified in a form suitable for str.format. This
string will be passed one formatted object named
'error' for each ValidationError. Only provide this
option when using --output=plain, which is the
default. If this argument is unprovided and
--output=plain is used, a simple default
representation will be used.
-o {plain,pretty}, --output {plain,pretty}
an output format to use. 'plain' (default) will
produce minimal text with one line for each error,
while 'pretty' will produce more detailed human-
readable output on multiple lines.
-V VALIDATOR, --validator VALIDATOR
the fully qualified object name of a validator to use,
or, for validators that are registered with
jsonschema, simply the name of the class.
--base-uri BASE_URI a base URI to assign to the provided schema, even if
it does not declare one (via e.g. $id). This option
can be used if you wish to resolve relative references
to a particular URI (or local path)
--version show program's version number and exit を導入
方針