Make CI runnable again: bump deprecated actions and decouple make test from the schema download - #56
Conversation
Both CI jobs currently fail two seconds after starting, before any build
step runs:
##[error]This request has been automatically failed because it uses a
deprecated version of `actions/cache: v2`.
GitHub has closed down actions/cache v1 and v2 and now auto-fails runs
that reference them at action-download time, so the workflow cannot get
as far as `make test` or the bazel e2e target.
Bump actions/cache to v4 to unblock that, and bump the remaining actions
still on the Node 12 runtime at the same time:
- actions/checkout v2 -> v4
- actions/setup-node v2.1.4 -> v4
- haskell/actions/setup v1 -> haskell-actions/setup v2 (repository moved)
Tool versions are left as they are (GHC 8.8.3, stack 2.5.1, Node 12.x) so
this change is limited to action versions. haskell-actions/setup v2 still
exposes the stack-path output the cache step depends on.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P8rZakwAiz1jpViUX34x1Z
With the deprecated actions bumped, the Haskell job now reaches `make test` and fails there instead: `make test` depends on the `schema` target, which fetches the EDItEUR archives, and editeur.org now answers bazel's request with `202 Accepted` instead of the zip. The test suite does not need those archives. Everything under test/ reads fixtures/test_*.xsd; the only reader of ./schema is schemaRoot in src/Lib.hs, which is the code-generation path. The dependency was an over-specification that tied the whole feedback loop for the parser to the availability of an external service. Drop it from `test` and keep it on `build`, where generating code really does need the schema. This does not fix the 202 itself: generation and tracking new schema releases still need the download. Also introduce docs/adr/ to record decisions like this one, with a template, an index, and the two decisions made here. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P8rZakwAiz1jpViUX34x1Z
make test from the schema download
レビュー: 要修正 (changes needed)Actions のバンプ (1 つ目のコミット) は妥当で、 必須1.
2. ADR-0002 の中心的な記述が事実と異なる
推奨3. ADR-0001 が「決定」した内容がこの PR で実施されていない
4. #55 の AGENTS.md との記述の食い違い
5. v4 系は「非推奨解消」になりきっていない / renovate PR と衝突する
任意6. デバッグの残骸 — 7. cache の path に 8. 9. 10. ADR-0002 の引用の精度 — 引用されている WARNING 行は実ログの短縮版です (実際は 検証したことと、その方法検証できたこと
検証できなかったこと
Generated by Claude Code |
The previous commit dropped the `schema` prerequisite from `make test` on the claim that nothing under test/ reads schema/. That claim was wrong, and review caught it: fixtures/test_mixed_html.xsd included ../schema/v2/ONIX_XHTML_Subset.xsd directly. Xsd.getSchema follows includes recursively and resolves that relative path with readFile, which throws when the file is absent, and schema/ is gitignored — so on a clean checkout the suite would have failed instead of running. Commit 9352123 confirms the dependency was deliberate: it added `test: schema` in the same change that deleted the vendored 2_1_rev03_schema/ tree and repointed this fixture at ../schema/v2/. Rather than restore the prerequisite, move what the fixture needs into the repository. test_mixed_html_xhtml_subset.xsd declares the 40 element names the fixture refers to, each as a mixed complex type. That is the property the assertions actually rest on: TestModel expects Model.collectElements to come back empty, and that filter keeps only elements with complexMixed = False, so the test means "XHTML elements do not leak into models". Deleting the include instead would have made the assertion vacuous. The stand-in is written here rather than copied from the EDItEUR distribution, so it raises no redistribution question. ADR-0002 is rewritten around what is actually true, including why the dependency was real and why a stand-in is enough. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P8rZakwAiz1jpViUX34x1Z
|
レビューありがとうございます。必須の 2 件はご指摘のとおりで、こちらの誤りでした。 修正を 5af27c0 で push しました。 必須 1・2:
|
Keeps this stacked branch's CI running the corrected test suite. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P8rZakwAiz1jpViUX34x1Z
BZL_BIN used `:=`, so `$(shell npx bazel info bazel-bin)` ran while make parsed the file — on every target, `make test` included. The Haskell job runs `make test` without ever installing node_modules, so that expansion just fails there. Measured in this environment: `make -n test` took 18.1s and printed a bazel download error before doing anything, and 0.011s with the assignment deferred to `=`. Nothing outside the schema recipes reads BZL_BIN, so deferring it costs nothing. Also drop the `ls -lah` step that printed the stack tool path; it was debugging output for the cache setup, not a check anything depends on. Both spotted in review of this PR. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P8rZakwAiz1jpViUX34x1Z
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P8rZakwAiz1jpViUX34x1Z
Both jobs on this branch die before running anything, on the actions/cache@v2 deprecation that #56 fixes. #56 is green, so port it here rather than wait for it to merge. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P8rZakwAiz1jpViUX34x1Z
* Add AGENTS.md describing repository values and workflows Document the two things this repository exists for: following the ONIX spec while keeping backward compatibility, and growing the set of target languages through code generation. Covers the schema -> XSD parser -> intermediate representation -> mustache pipeline, the make/bazel commands, how to bump an EDItEUR schema release, a step-by-step procedure for adding a new target language, the fixture- driven test convention, and which paths are generated and must not be hand-edited. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P8rZakwAiz1jpViUX34x1Z * Align AGENTS.md with the CI and ADR changes `make test` no longer depends on the schema download, so the command table said something that is about to stop being true. Also point at ADR-0003 where `make schema` is described, since that is the command that is currently broken. Add the rule that came out of getting this wrong once: a fixture must not include anything outside fixtures/. Xsd.getSchema follows xs:include recursively, so a single `../schema/` reference puts the whole suite back on editeur.org's availability, which is exactly what test_mixed_html.xsd did. Add a section on recording design decisions as ADRs, with the criteria for what warrants one, so the reference from docs/adr/README.md is reciprocated. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P8rZakwAiz1jpViUX34x1Z --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Both .gitignore additions are kept: node_modules/ from the npm work on main, /third_party/distdir/ from this branch's ADR. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P8rZakwAiz1jpViUX34x1Z
CI が 2 段階で壊れていたので、両方を直して「テストが実際に走る」状態まで戻します。
1 段目: 廃止されたアクションによる即死
両ジョブがジョブ開始 2 秒、ビルドが 1 行も走る前に失敗していました。
GitHub 側で
actions/cacheの v1/v2 が廃止され、アクションのダウンロード段階で自動的に失敗します。あわせて Node 12 ランタイムのままだったものも上げました。actions/cachev2 → v4 (2 箇所、直接の原因)actions/checkoutv2 → v4actions/setup-nodev2.1.4 → v4haskell/actions/setupv1 →haskell-actions/setupv2 (リポジトリ移管済み)ツールのバージョン (GHC 8.8.3 / stack 2.5.1 / Node 12.x) は変更していません。今回の変更をアクションのバージョンだけに限定し、切り分けを容易にするためです。
haskell-actions/setupv2 もキャッシュステップが参照するstack-pathoutput を提供しています。結果:
Test e2eが緑になりました。ログ上も実際にビルドとテストが走っています (//e2e/go:snapshot_test PASSED,Executed 1 out of 1 test: 1 test passes)。2 段目:
make testが editeur.org に依存していた1 段目を直すと、
Test haskell codesはmake testまで到達して、今度はそこで失敗しました。make testがschemaターゲット (EDItEUR の zip をダウンロードして展開する) に依存していたためです。再実行しても同じ結果でした。ここで、テストは
schema/を読んでいません。test/配下が読むのはfixtures/test_*.xsdだけで、./schemaを参照するのはsrc/Lib.hsのschemaRoot(コード生成の実行時パス) のみです。つまりこの依存は事実の反映ではなく過剰指定で、パーサのロジックに対するフィードバックループ全体を外部サービスの可用性に縛り付けていました。testからschema依存を外し、build側には残しています (生成には実際にスキーマの実体が要るため、こちらは本物の依存)。スコープ外
この PR は 202 の問題そのものを解決しません。コード生成と、最新スキーマへの追従は引き続きダウンロードを必要とします。そちらは取得方法の設計判断が要るため、別途 ADR と PR で扱います。
ADR
この種の判断を残す場所として
docs/adr/を用意し、テンプレートと索引、今回の 2 件を記録しました。確認
usesの置換内容を確認済みtest/が./schemaを参照していないことを grep で確認済み (参照はsrc/Lib.hs:82のみ)🤖 Generated with Claude Code
https://claude.ai/code/session_01P8rZakwAiz1jpViUX34x1Z