aglinxinyuan opened a new pull request, #9265:
URL: https://github.com/apache/texera/pull/9265
### What changes were proposed in this PR?
Consolidates nineteen single-line case classes defining WebSocket control
requests and collaboration messages into their respective base trait definition
files:
-
`amber/src/main/scala/org/apache/texera/web/model/websocket/request/TexeraWebSocketRequest.scala`:
Consolidates `HeartBeatRequest`, `RetryRequest`, `SkipTupleRequest`,
`WorkflowCheckpointRequest`, `WorkflowKillRequest`, `WorkflowPauseRequest`, and
`WorkflowResumeRequest` (7 standalone files deleted).
-
`amber/src/main/scala/org/apache/texera/web/model/collab/request/CollabWebSocketRequest.scala`:
Consolidates `AcquireLockRequest`, `CommandRequest`, `HeartBeatRequest`,
`RestoreVersionRequest`, `TryLockRequest`, and `WIdRequest` (6 standalone files
deleted).
-
`amber/src/main/scala/org/apache/texera/web/model/collab/event/CollabWebSocketEvent.scala`:
Consolidates `CommandEvent`, `LockGrantedEvent`, `LockRejectedEvent`,
`ReleaseLockEvent`, `RestoreVersionEvent`, and `WorkflowAccessEvent` (6
standalone files deleted).
Deletes 19 redundant source files and their duplicate license headers (-396
net lines in production code). Adds `CollabWebSocketMessageSpec` pinning the
polymorphic serialization wire contract across all collaboration requests and
events.
| Surface | Pinned |
| --- | --- |
| Package namespaces | `org.apache.texera.web.model.websocket.request`,
`org.apache.texera.web.model.collab.request`,
`org.apache.texera.web.model.collab.event` unchanged |
| Class names & signatures | All 19 case class names, field names, and types
identical |
| Jackson polymorphic wire mappings | `@JsonTypeInfo` and `@JsonSubTypes`
discriminator resolutions preserved |
| Public API & imports | Unchanged; existing import sites continue to
resolve identically |
### Any related issues?
Closes #9264.
### How was this PR tested?
- **Tests passed**:
```bash
sbt "WorkflowExecutionService/testOnly
org.apache.texera.web.model.websocket.request.TexeraWebSocketRequestSpec
org.apache.texera.web.model.collab.CollabWebSocketMessageSpec
org.apache.texera.web.resource.CollaborationResourceSpec
org.apache.texera.web.WebsocketInputSpec"
```
- `TexeraWebSocketRequestSpec`: 12/12 passed
- `CollabWebSocketMessageSpec`: 11/11 passed (positive zero-arg subtypes,
payload roundtrips, unknown type ID rejection, missing type rejection)
- `CollaborationResourceSpec`: 28/28 passed
- `WebsocketInputSpec`: 6/6 passed
- Total: 57/57 tests succeeded.
- **Code formatting & linting**:
```bash
sbt "WorkflowExecutionService/scalafmtCheck"
"WorkflowExecutionService/Test/scalafmtCheck"
sbt "WorkflowExecutionService/scalafix --check"
"WorkflowExecutionService/Test/scalafix --check"
```
All passed cleanly.
- **Net change**: 23 files changed, +140 / -418 (net -278 lines overall;
production code net -396 lines).
### Was this PR authored or co-authored using generative AI tooling?
No.
--
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]