Closed wdbaruni closed 2 weeks ago
The changes in this pull request involve a comprehensive transition from the ncl
package to the envelope
package across multiple files. This includes updating method signatures, changing message types, and modifying how messages are created and handled within various components such as message handlers, dispatchers, and test suites. The updates affect both the logic of message processing and the associated metadata handling, ensuring a consistent use of the envelope
package throughout the codebase.
File Path | Change Summary |
---|---|
pkg/compute/message_handler.go | Updated MessageHandler methods to use envelope.Message instead of ncl.Message . Changed metadata key retrieval to envelope.KeyMessageType . Modified error handling for unexpected payload types. |
pkg/compute/watchers/ncl_dispatcher.go | Altered NCLDispatcher to utilize envelope.Message . Updated message creation in HandleEvent to use envelope.NewMessage . Added import for envelope package. |
pkg/compute/watchers/ncl_dispatcher_test.go | Changed test suite to handle *envelope.Message instead of *ncl.Message . Updated serializer and registry to use envelope methods. |
pkg/lib/envelope/README.md | Added documentation for the Envelope Library, detailing its features and usage. |
pkg/lib/envelope/errors.go | Changed package name from ncl to envelope . Added new error constants and retained existing error types. |
pkg/lib/envelope/interface.go | Introduced MessageSerializer and PayloadSerializer interfaces for handling message serialization. |
pkg/lib/envelope/json.go | Added JSON serialization types and methods for handling messages in JSON format. |
pkg/lib/envelope/json_test.go | Introduced unit tests for JSON serialization functionalities. |
pkg/lib/envelope/message.go | Added EncodedMessage and Message types for structured message handling. |
pkg/lib/envelope/message_test.go | Updated package name to envelope and retained test suite structure for message functionalities. |
pkg/lib/envelope/metadata.go | Defined Metadata type and methods for managing message metadata. |
pkg/lib/envelope/proto.go | Introduced ProtoMessageSerializer for Protocol Buffers serialization. |
pkg/lib/envelope/proto_test.go | Added test suite for ProtoMessageSerializer . |
pkg/lib/envelope/registry.go | Refactored MessageSerDeRegistry to Registry with updated methods for message handling. |
pkg/lib/envelope/registry_test.go | Updated test suite to reflect changes in registry implementation. |
pkg/lib/envelope/serializer.go | Renamed and refactored serialization logic to use envelope types. |
pkg/lib/envelope/serializer_test.go | Updated test suite for the new serializer implementation. |
pkg/lib/envelope/utils_test.go | Added utility types for testing within the envelope package. |
pkg/lib/envelope/version.go | Changed package name from ncl to envelope , retaining constants and methods. |
pkg/lib/envelope/version_test.go | Updated package name and retained test suite for schema version constants. |
pkg/lib/ncl/README.md | Modified documentation for clarity and conciseness. |
pkg/lib/ncl/checkpointer.go | Updated Checkpoint method to accept *envelope.Message . |
pkg/lib/ncl/constants.go | Added new constants for metadata keys. |
pkg/lib/ncl/filter.go | Updated ShouldFilter method to accept *envelope.Metadata . |
pkg/lib/ncl/message.go | Deleted file containing Message and Metadata implementations. |
pkg/lib/ncl/message_serde.go | Deleted file for JSON serializer/deserializer for messages. |
pkg/lib/ncl/message_serde_test.go | Deleted test suite for message serializers. |
pkg/lib/ncl/publisher.go | Updated publisher struct to use envelope types for message serialization. |
pkg/lib/ncl/publisher_test.go | Modified test suite to align with the new message handling logic. |
pkg/lib/ncl/raw_message_serde.go | Deleted file for raw message serialization. |
pkg/lib/ncl/raw_message_serde_test.go | Deleted test suite for raw message serialization. |
pkg/lib/ncl/subscriber.go | Updated subscriber struct to use envelope types for message deserialization. |
pkg/lib/ncl/subscriber_test.go | Modified test suite to reflect changes in message handling. |
pkg/lib/ncl/types.go | Updated method signatures to use envelope.Message and envelope.Metadata . |
pkg/lib/ncl/utils_test.go | Updated test handler to process *envelope.Message . |
pkg/node/compute.go | Updated NewComputeNode to accept *envelope.Registry . |
pkg/node/heartbeat/client.go | Changed message creation in SendHeartbeat to use envelope.NewMessage . |
pkg/node/heartbeat/heartbeat_test.go | Updated test suite to use envelope.Registry . |
pkg/node/heartbeat/server.go | Modified message handling methods to use envelope.Message . |
pkg/node/ncl.go | Updated CreateMessageSerDeRegistry to return *envelope.Registry . |
pkg/node/requester.go | Updated NewRequesterNode to accept *envelope.Registry . |
pkg/orchestrator/message_handler.go | Updated MessageHandler methods to use envelope.Message . |
pkg/orchestrator/message_handler_test.go | Modified tests to use envelope package for message handling. |
pkg/orchestrator/watchers/ncl_dispatcher.go | Updated dispatcher methods to create messages with envelope.NewMessage . |
pkg/orchestrator/watchers/ncl_dispatcher_test.go | Changed test suite to handle *envelope.Message . |
In the meadow where messages hop,
Theenvelope
now takes the top.
With each new type, the code does dance,
A leap to clarity, a joyful chance!
Fromncl
toenvelope
, we cheer,
For messages bright, let’s all draw near! 🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
In preparation to utilize JetStream in NCL, it was needed to decouple non-message passing related logic from NCL, mainly message serialization and encoding logic, which is now moved to its own envelope library, which can be used by job store and other components as well to encode entries
Summary by CodeRabbit
New Features
envelope
package for message handling, enhancing serialization and deserialization processes.Bug Fixes
Documentation
Tests
envelope.Message
type and associated methods, ensuring compatibility with the updated message handling framework.