aglinxinyuan opened a new pull request, #5699: URL: https://github.com/apache/texera/pull/5699
### What changes were proposed in this PR? Pin behavior of three previously-uncovered storage-layer model classes in `common/workflow-core`. No production-code changes. | Spec | Source class | Tests | | --- | --- | --- | | `OperatorResultMetadataSpec` | `OperatorResultMetadata` | 7 | | `WorkflowResultStoreSpec` | `WorkflowResultStore` | 7 | | `OnDatasetSpec` | `OnDataset` | 6 | All three spec files follow the `<srcClassName>Spec.scala` one-to-one convention. **Behavior pinned — `OperatorResultMetadata`** | Surface | Contract | | --- | --- | | `OperatorResultMetadata()` | defaults to `tupleCount == 0` and `changeDetector == ""` | | Custom-constructor values | preserved on both fields | | Equality | case-class equality compares both fields (differing values break it) | | `hashCode` | matches across equal instances | | `copy` | replaces only the field supplied, preserves the rest | **Behavior pinned — `WorkflowResultStore`** | Surface | Contract | | --- | --- | | `WorkflowResultStore()` | defaults `resultInfo` to `Map.empty` | | Custom map | every `(OperatorIdentity, OperatorResultMetadata)` entry preserved; missing keys read as `None` | | Equality | value-based on the inner Map; differing inner metadata breaks equality | | `copy(resultInfo = …)` | replaces the map without mutating the original (immutable case-class contract) | | `WorkflowResultStore()` vs `WorkflowResultStore(Map.empty)` | equal | **Behavior pinned — `OnDataset`** | Surface | Contract | | --- | --- | | `getRepositoryName` / `getVersionHash` / `getFileRelativePath` | return the value supplied by the concrete impl, verbatim | | Empty strings | passed through (no validation imposed by the trait) | | Distinct impls | return their own values (no leakage) | | `case _: OnDataset` | matches a concrete impl | | `case _: OnDataset` (sanity) | does NOT match an unrelated type like `String` | `OnDataset` is a trait; the spec exercises it through a minimal test-only concrete subclass. ### Any related issues, documentation, discussions? Closes #5696. ### How was this PR tested? Pure unit-test additions; verified locally with: - `sbt "WorkflowCore/testOnly org.apache.texera.amber.core.storage.result.OperatorResultMetadataSpec org.apache.texera.amber.core.storage.result.WorkflowResultStoreSpec org.apache.texera.amber.core.storage.model.OnDatasetSpec"` — 20 tests, all green - `sbt scalafmtCheckAll` — clean - CI to confirm ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Code (Opus 4.7 [1M context]) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
