Repository navigation
[GRDM-63554] ci: item_type.sql の JSON-LD マッピングをアイテムタイプの検証・修正 - #1950
yacchin1205 wants to merge 4 commits into
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Tip 🎯 Customize your risk assessments
✅ Automatic approvals, with your rules
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Reviewer's Guide初期データとして投入される全 JSON-LD マッピングを対応するアイテムタイプに対して CI で検証し、不一致の詳細を Step Summary に表示して検出できるようにした。あわせて寄与者所属の JSON-LD パス欠落を修正しているが、現時点では既存のアイテムタイプとマッピング間の不一致が残るため、追加した検証ステップは失敗する状態である。 Sequence diagram for JSON-LD mapping validation in UI TestssequenceDiagram
participant CI as UI Tests
participant Script as validate_jsonld_mappings.py
participant App as create_app()
participant DB as ItemTypeJsonldMapping
participant Mapper as JsonLdMapper
participant Summary as Step Summary
CI->>Script: execute script
Script->>App: create_app()
Script->>DB: query active mappings
loop each mapping
Script->>Mapper: validate()
Mapper-->>Script: validation errors
end
Script->>Summary: print Markdown report
alt errors found
Script-->>CI: exit code 1
else no errors
Script-->>CI: exit code 0
end
Flow diagram for detecting item type mapping driftflowchart TD
A[install.sh loads item types and JSON-LD mappings] --> B[UI Tests run validate_jsonld_mappings.py]
B --> C[Load active ItemTypeJsonldMapping records]
C --> D["JsonLdMapper.validate() for each mapping"]
D --> E{Validation errors?}
E -->|Yes| F[Show error details in Step Summary]
F --> G[Fail CI step]
E -->|No| H[Pass CI step]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
ba51872 to
d1ee7f2
Compare
概要 (Summary)
install.shはscripts/demo/item_type.sqlからアイテムタイプと JSON-LD マッピングを一緒に投入するが、投入直後のマッピングがJsonLdMapper.validate()を通らない。カタログ.Thumbnail、カタログ.Hosting Institution、出版者情報.出版地.言語、Funding Reference.助成機関識別子.助成機関識別子URI等がアイテムタイプに無い)develop_v2.0.0→develop_v2.1.0で、item_type.sqlのアイテムタイプ(30001・30002)とプロパティは変わっておらず、マッピングだけが書き換わっている。scripts/demo/update_W2025-29.pyを適用すると通る(30001・30002 とも 0件、https://github.com/yacchin1205/weko/actions/runs/41768738790 )。ui-tests.ymlに、投入済みの全マッピングをvalidate()にかけるステップを追加した(scripts/ci/validate_jsonld_mappings.py)。エラーの内容は Step Summary に出る。不一致があればステップは失敗する。jpcoar:affiliationjpcoar:affiliationNameのドット欠落をjpcoar:affiliation.jpcoar:affiliationNameに直した(30001・30002 の本体と版履歴、計12か所)。item_type.sqlは「手で編集しないこと」とある生成ファイルだが、手で直している。validate()はマッピングのキーしか見ないため、この修正で上記の件数は変わらない。ui-tests.ymlの Python を 3.9 から 3.11 にした。ubuntu-latestが ubuntu-26.04 になり 3.9 が提供されないため、10/22 以降 UI Tests は「Set up Python」で落ちていた(例: docs: WEKO_ACCOUNTS_IDP_ENTITY_ID の docstring を SP のエンティティ ID に訂正 #1948)。他のワークフローは 3.11。関連Issue / チケット (Related Issues)
変更タイプ (Type of Change)
🤖 0. CI 自動チェック (API Inventory Drift)
🔒 1. セキュリティ & API アクセス制御チェック
🧪 2. テストコード観点チェック
🛡️ 3. データ保護 & 破壊的変更防止チェック
⚙️ 4. マイグレーション & システム影響チェック
item_type.sql以外の初期データ・マイグレーション SQL は変更していない)📚 5. ドキュメント・仕様書更新チェック (weko-document)
📋 6. 動作検証エビデンス (Verification Evidence)
テスト実行結果
この PR の UI Tests(ubuntu-26.04、Python 3.11)で、UI テストは 3 passed, 1 xfailed、追加したステップのみ上記の件数で失敗する。
🤖 Generated with Claude Code
Summary by Sourcery
Strengthen UI-test CI checks for JSON-LD mapping consistency and update the workflow’s Python runtime.
Bug Fixes:
Enhancements:
CI: