Repository navigation
[GRDM-63554] ci: item_type.sql の JSON-LD マッピングをアイテムタイプの検証・修正 - #1950
Draft
yacchin1205 wants to merge 3 commits into
Draft
yacchin1205 wants to merge 3 commits into
yacchin1205 wants to merge 3 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
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. Comment |
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
|
yacchin1205
force-pushed
the
ci/initial-data-consistency
branch
from
October 28, 2026 00:05
ba51872 to
d1ee7f2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要 (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)とプロパティは変わっておらず、マッピングだけが書き換わっている。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。[WIP] 不一致そのものは直していないので、追加したステップは現状失敗する。アイテムタイプとマッピングのどちらに合わせるべきかを相談したい。
関連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