-
Notifications
You must be signed in to change notification settings - Fork 96
fix(ci): GitHub で回っていなかったユニットテストを回し、ローカルと経路を揃える #1911
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
Open
mhaya
wants to merge
90
commits into
develop_v2.1.0
Choose a base branch
from
fix/issue62764
base: develop_v2.1.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
90 commits
Select commit
Hold shift + click to select a range
0e1e426
docs(ci): Claudeレビューを他レビュー統合型に変える設計を追加
mhaya dfbd7f8
docs(ci): Claudeレビュー統合の実装計画を追加
mhaya c729726
test(ci): Claudeレビュー統合のテスト基盤とPR#1905のfixtureを追加
mhaya 9866bb4
docs(ci): 実装計画のfixture期待値を実データに合わせる
mhaya 1842b62
feat(ci): PRの既存レビューをGraphQLで収集するスクリプトを追加
mhaya 49ef5dc
fix(ci): レビュー出力のテストと pagination limit 検出を追加
mhaya 3971c87
docs(ci): 設計のGraphQLクエリをlast:100に修正
mhaya 1920c5a
feat(ci): 既存レビューを外部データ枠に入れた入力とプロンプトを追加
mhaya 8ddbbb0
fix(ci): 外部レビュー本文からの囲み偽造をnonceと記号無害化で防ぐ
mhaya 511b8cd
feat(ci): Claude出力の和集合と検証を行う集約スクリプトを追加
mhaya eff491e
fix(ci): 集約スクリプトのパス内重複排除と行番号検証を実装
mhaya a8daf0f
fix(ci): 行番号正規化による鍵衝突を解決
mhaya 2676d97
feat(ci): 裁定結果を集約コメントのMarkdownに描画する処理を追加
mhaya 5b69087
fix(ci): render.py の Markdown 注入を防ぐ
mhaya eebc44d
fix(ci): _cell() のバックスラッシュ回帰と改行によるブロック注入を修正
mhaya 0037c00
docs(ci): 設計に出力側のMarkdown注入対策を追記
mhaya 6fed892
feat(ci): 確度の高い修正案をinline suggestionとして投稿する処理を追加
mhaya fcba506
fix(ci): claude-fix マーカーの偽造対策と kind ガードの回帰テストを追加
mhaya 7a65b18
fix(ci): claude-fixマーカーをreplacement経由で偽造できる穴を塞ぐ
mhaya dc388bf
feat(ci): Claudeレビューを他レビュー統合型に変更
mhaya eed7d46
fix(ci): レビュー配線のレビュー指摘3件を修正
mhaya 18039e7
refactor(claude-review): _esc/_cell/_fence を mdsafe.py に集約
mhaya 7b652e9
fix(claude-review): 行頭の構造記号を無害化する(所見1/2)
mhaya f8e69b2
fix(claude-review): 壊れたパスを passes の分母に数えない(所見3)
mhaya 898a2dd
fix(claude-review): inline suggestion が無いとき「あり(inline)」と言わない(所見4)
mhaya ac7c7fb
fix(claude-review): pull_request_review系トリガに投稿者ガードを追加(所見7)
mhaya d37f173
fix(claude-review): SELF 判定が [bot] 表記のログインを見逃す穴を塞ぐ(所見8)
mhaya ec97bd5
fix(claude-review): clean_adj も空の title を弾く(所見11)
mhaya 3ddb302
fix(claude-review): @ メンションを無害化する(所見12)
mhaya d050edf
docs(claude-review): 計画・設計書の陳腐化した記述を修正(所見5/6)
mhaya aedf9a0
add operations.md
mhaya 30ffff9
fix(claude-review): PR #1907 のレビュー指摘に対応する
mhaya 0abf5f2
chore(claude-review): api-inventory 側のワークフロー複製を消す
mhaya d9c2f09
fix
mhaya 16bcc28
fix(tools): enrich_git.py を列名対応にし、更新手順へ組み込む
mhaya bef273c
fix(tools): snapshot.py / fixtures.py が $WEKO_WEB_CONTAINER を見ていない
mhaya b5db8a4
feat(api-inventory): ソース由来の経路検知を足し、ツールの単体テストを置く
mhaya 8bc6bff
ci: GitHub で回っていなかったユニットテストを回す
mhaya a0d1dc0
ci: ローカルと CI で同じ経路を通す仕組みを入れる
mhaya e3c2709
ci: ローカル実行を CPU アーキで分岐させない
mhaya 186965c
test: CI で初めて走ったユニットテストの失敗を直す (第1弾)
mhaya 9b275e7
test: CI で初めて走ったユニットテストの失敗を直す (第2弾)
mhaya 25b8441
test: weko-itemtypes-ui の register ACL / 重複マッピング判定を直す
mhaya 4739b9f
test: CI で初めて走ったユニットテストの失敗を直す (第3弾)
mhaya c376d3d
test: CI で初めて走ったユニットテストの失敗を直す (第4弾)
mhaya a977b71
test: CI で初めて走ったユニットテストの失敗を直す (第5弾)
mhaya 2dcbf6a
test: CI で初めて走ったユニットテストの失敗を直す (第6弾)
mhaya dc6cb9a
test: CI で初めて走ったユニットテストの失敗を直す (第7弾)
mhaya 60f77b3
test: CI で初めて走ったユニットテストの失敗を直す (第8弾)
mhaya 43163f7
test: CI で初めて走ったユニットテストの失敗を直す (第9弾)
mhaya 73cc411
test: 残りのユニットテスト失敗を直し、ジョブの制限時間を実測に合わせる
mhaya 029cd9c
ci: 5時間かかるモジュールをテスト本数で分割して回す
mhaya 932b822
ci: 分割の偏りに合わせて分割数と制限時間を見直す
mhaya 66fc1d8
test: weko-search-ui の NDL JaLC まわりの期待値を実挙動に合わせる
mhaya fdb8688
test: weko-workflow の残り 15 本を直す
mhaya 413212a
test: weko-workflow [8/8] が 120 分で打ち切られていた原因を潰す
mhaya 4666e2c
test: weko-deposit [8/8] が 120 分で打ち切られていた原因を潰す
mhaya de4c4de
ci: テストのタイムアウトを実際に効かせる
mhaya bda3865
test: weko-deposit の失敗を直す (1/2)
mhaya a526ab6
test: weko-deposit の失敗を直す (2/2)
mhaya cbca401
test: weko-deposit の残り 3 本を直す
mhaya bdb83b2
test: weko-records-ui の 5 本を直す
mhaya 10f0e74
test: weko-search-ui の 10 本を直す
mhaya 4429780
test: weko-search-ui の最後の1本 (test_check_jsonld_import_items) を直す
mhaya 2e15e48
test: CI に残っていた5本を直す
mhaya 82baabf
test: test_function_issue35902 の比較を並び順に依存させない
mhaya b8c8110
test: weko-search-ui [6/6] の 3 本を直す
mhaya 2869ce2
test: 時刻依存と werkzeug 依存の2本を直す
mhaya 2dd1dcc
test: 共有された WEKO_SEARCH_KEYWORDS_DICT の破壊を止める
mhaya 0d076a9
test: create_export_all_data のレコード数を減らす
mhaya 235f472
docs: issues.md を Redmine Textile に変換する
mhaya a4c050d
f
mhaya 8dcaa1e
test: xfail のうち2件がテスト側の問題だったので直す
mhaya b4f5ac8
test: 各モジュールの tox 依存に pypdfium2 を足す
mhaya 2916a9b
test: v2.1.0 の変更で壊れた fixture を直す
mhaya 63d24b9
test: invenio-communities のキャッシュ先に CACHE_REDIS_URL を指定する
mhaya 8b67e7d
test: weko-records に残った v2.1.0 由来の失敗を直す
mhaya bb24d13
test: weko-workspace の Mapping.create を create_or_update に直す
mhaya 635d8f4
test: Mapping の delete / revert を v2.1.0 の挙動に合わせる
mhaya 6feaee6
test: v2.1.0 由来の残り41件を xfail で受け止め、棚卸しを残す
mhaya 179ffc2
fix(demo): item_type.sql をデータのみのダンプに変え、生成方法を直す
mhaya d0a4d10
fix(demo): setval を「ID のリザーブ」として扱う
mhaya 15f5242
test(ui): インデックス更新の完了を DOM のアラートで待つ
mhaya 5c18b41
test(ui): アイテム登録で開くのは File セクション (File Information ではない)
mhaya 165f745
test(ui): 配列型の File セクションは入れ子の2枚を開く
mhaya 8d006a5
test(ui): File パネルは開閉状態を見て段階的に開く
mhaya e979cef
test(ui): GakuNin RDM の URL を設定から読む
mhaya 247fae3
test(ui): インデックス公開設定が反映されたことまで確認する
mhaya b4f8e6d
test(ui): 匿名取得が失敗したとき遷移先と本文を出す
mhaya fd5747a
test(ui): グループ未設定のインデックスが誰にも見えない件を xfail で記録する
mhaya File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| # WEKO3 リポジトリ(RCOSDP/weko)の .github/workflows/ に配置する。 | ||
| # | ||
| # 台帳ツールの単体テスト。**Docker も実機も台帳も要らない**ので数秒で終わる。 | ||
| # api-inventory-drift.yml(実機を起こして突き合わせる。60分枠)とは役割が違う: | ||
| # | ||
| # このワークフロー … 台帳を作る側(スクリプト・手順書)が壊れていないか | ||
| # drift ワークフロー … 台帳の中身が実機とずれていないか | ||
| # | ||
| # ツールが壊れたまま drift だけ回すと、検知器が黙って死んでいても緑で通る。 | ||
| # 先にこちらを通すこと。Secret も不要なので fork からの PR でも動く。 | ||
|
|
||
| name: API Inventory Tests | ||
|
|
||
| # 対象は tools/api-inventory/ だけなので、そこを触ったときだけ回す。 | ||
| # push と pull_request でパスの並びを揃えること(片方だけ古びると、 | ||
| # 「PR では回るが push では回らない」といった説明のつかない差になる)。 | ||
| on: | ||
| pull_request: | ||
| paths: &paths | ||
| - 'tools/api-inventory/**' | ||
| - '.github/workflows/api-inventory-tests.yml' | ||
| push: | ||
| branches: ['**'] | ||
| paths: *paths | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| unit: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.11' | ||
|
|
||
| - name: Install pytest | ||
| run: python3 -m pip install --disable-pip-version-check pytest | ||
|
|
||
| - name: Run unit tests | ||
| working-directory: tools/api-inventory | ||
| run: python3 -m pytest -q | ||
|
|
||
| # 台帳が無くても、ソースからの経路検知そのものは動く。 | ||
| # 検知件数が 0 に落ちていれば、検知器が壊れている。 | ||
| - name: Smoke check the static detector | ||
| run: | | ||
| set -o pipefail | ||
| python3 tools/api-inventory/scripts/detect_routes.py \ | ||
| --weko-root "$PWD" --summary-only | tee /tmp/detect.md | ||
| python3 - <<'PY' | ||
| import re, sys | ||
| text = open('/tmp/detect.md', encoding='utf-8').read() | ||
| total = int(re.search(r'\*\*計\*\* \| \*\*(\d+)\*\*', text).group(1)) | ||
| print(f'detections={total}') | ||
| # 経路が数百ある前提のリポジトリ。2桁に落ちたら検知器の故障を疑う。 | ||
| sys.exit(0 if total >= 300 else 1) | ||
| PY | ||
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
issue (bug_risk): GitHub Actions rejects these workflow files because its workflow parser does not support YAML anchors and aliases. The
API Inventory Testsworkflow therefore fails validation and never starts, so neither the 107 unit tests nor the smoke check runs.Suggested fix: Spell out the
pathslist separately forpull_requestandpush, or generate/synchronize the workflow files outside GitHub Actions rather than using YAML anchors.