core: script resource DTO の Java serialization 契約を固定する

Open
#1,525 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Active
Tech stack
java
Domain
backend

Research direction

Read the seven DTO files listed in the issue and add ScriptDtoResourceSerializationCompatibilityTest.java under the specified test path. First capture serialization fixtures from the current master and record the baseline before editing production files. Verify fixture deserialization, serialized field metadata and representative values, plus TimeWindow clone and containment behavior; finish when the focused tests and full core module test pass within the stated file and diff limits.

Written by the indexing model from the issue text.

Description

area: core priority: low status: ready

概要

script.object の DTO は外部 script との serialization boundary です。特に TimeWindow の clone / containment と Row の raw List は利用側に見える契約です。
互換性を確かめずに field や generic 宣言を変えると、既存 script data の deserialize や実行に失敗する可能性があります。
この issue では残る7 DTO の Java-serialization compatibility と固有の挙動を固定します。Refs #1442。

作業手順

  1. 変更前に modules/microproject_core/src/test/java/com/microproject/script/object/ScriptDtoResourceSerializationCompatibilityTest.java を追加し、現行 master の7 DTO から生成した Java-serialization fixture を test resources に固定する。source edit 前に deserialize / round-trip の baseline を記録する。
  2. 次の7 production files だけを整理し、FQCN、serialVersionUID、serialized field 名・宣言型・erased type を維持する。
    • modules/microproject_core/src/main/java/com/microproject/script/object/LiteResource.java — UID と field layout を保つ。
    • modules/microproject_core/src/main/java/com/microproject/script/object/LiteResourcePool.java — UID と field layout を保つ。
    • modules/microproject_core/src/main/java/com/microproject/script/object/LiteUser.java — UID と field layout を保つ。
    • modules/microproject_core/src/main/java/com/microproject/script/object/ReportData.java — UID と field data shape を保つ。
    • modules/microproject_core/src/main/java/com/microproject/script/object/Row.java — ReportData と別の契約である raw List を維持する。型付き List へ変更しない。
    • modules/microproject_core/src/main/java/com/microproject/script/object/TimeWindow.java — UID、millisecond values、clone / containment 結果を維持する。
    • modules/microproject_core/src/main/java/com/microproject/script/object/ValueBar.java — UID と w / ct fields を保持し、参照0を理由に削除しない。
  3. Compatibility test は固定 fixture を deserialize し、代表値、ObjectStreamClass UID と fields (name / type / type string) を比較する。TimeWindow の clone と境界を含む contains を検証し、新旧 DTO の保存・再読込も確認する。test source と fixture を合わせて追加物は2 files 以内。
  4. 合計10 files 以下、差分400行未満とする。

検証

.\gradlew.bat :microproject_core:test --tests "com.microproject.script.object.ScriptDtoResourceSerializationCompatibilityTest" --console=plain
.\gradlew.bat :microproject_core:test --tests "com.microproject.script.object.TimeIntervalsTest" --console=plain
.\gradlew.bat :microproject_core:test --console=plain
git diff --check

完了条件

  • 指定7 DTO の FQCN、UID、serialized field 名・宣言型・erased type が固定 fixture の記録と一致する。
  • fixture の deserialize と変更後の DTO の保存・再読込が通り、代表値が維持される。
  • Row の field は raw List contract を維持し、ReportData の field data shape と混同されない。
  • TimeWindow の clone は独立した同値 window を返し、既存の containment boundary 結果を維持する。
  • ValueBar が残り、w / ct fields と UID を維持する。
  • focused serialization / TimeIntervals tests と core module 全体が成功する。
  • 合計10 files 以下、差分400行未満で、git diff --check が空。

範囲外

  • script DTO の public API、field shape、serialization compatibility の変更。
  • Bar / Link / LiteField / LiteProject / LiteTask(別 issue)。
  • ValueBar を参照数だけで削除すること。
Dominant language
Java
Stars
2
Forks
1
Avg merge
4h 52m
Merged PRs (30d)
349

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from tetsuji16/microProject

All issues in tetsuji16/microProject

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.