Skip to content

Conversation

@ootakazuhiko
Copy link
Collaborator

概要

  • 最小の問題スキーマ(JSON Schema)を追加し、構造チェックを警告として実行
  • CI 向けスモークセット を追加(CLI-001/WEB-001/NET-001)
  • を追加(下流が参照可能)
  • ワークフローに usage: jsonschema [-h] [-i INSTANCES] [-F ERROR_FORMAT] [-o {plain,pretty}]
    [-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 を導入

方針

  • 現段階では 構文エラーのみFail。スキーマ逸脱は警告にとどめ、段階的に強化します
  • これにより既存の問題群に大きな破壊なく導入が可能

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 をインストール
Copilot AI review requested due to automatic review settings September 8, 2025 21:16
Copy link

Copilot AI left a 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:
Copy link

Copilot AI Sep 8, 2025

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.

Suggested change
except Exception:
except ImportError:

Copilot uses AI. Check for mistakes.
Comment on lines 26 to 27
except Exception:
pass
Copy link

Copilot AI Sep 8, 2025

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.

Suggested change
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)

Copilot uses AI. Check for mistakes.
@ootakazuhiko ootakazuhiko merged commit c14e9c5 into main Sep 8, 2025
5 of 13 checks passed
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