Closed hackerwins closed 4 months ago
The recent changes enhance XML style attribute handling, improve internal data conversion functions, update OpenAPI specifications for better consistency, and introduce new tests for deep copy functionality. The modifications ensure more robust and flexible handling of document attributes, streamline API documentation, and improve test coverage for the system's core components.
File(s) | Change Summary |
---|---|
api/converter/converter_test.go |
Added style attributes to XML elements, removed a style attribute, updated XML output, and added assertions for these changes. |
api/converter/from_pb.go |
Introduced fromRHT function for converting api.NodeAttr to crdt.RHT . |
api/converter/to_bytes.go |
Added toRHT function for converting crdt.RHT to map[string]*api.NodeAttr and updated toTreeNode function to use it. |
api/docs/yorkie/v1/resources.openapi.yaml , api/docs/yorkie/v1/yorkie.openapi.yaml |
Updated descriptions, URL structures, and schema references for better consistency and readability. |
api/yorkie/v1/resources.proto |
Added is_removed boolean field to NodeAttr message. |
pkg/document/crdt/rht.go |
Added IsRemoved and SetInternal methods, modified Nodes and DeepCopy methods. |
pkg/document/crdt/rht_test.go |
Added TestRHT_DeepCopy function, modified TestRHT_Remove function with new test cases and expectations. |
sequenceDiagram
participant Client
participant API
participant Converter
participant CRDT
Client->>API: Request to modify XML styles
API->>Converter: Convert request data
Converter->>CRDT: Apply style changes
CRDT-->>Converter: Return updated tree
Converter-->>API: Return updated XML
API-->>Client: Send updated XML response
In the land of code, where changes flow,
Styles and attributes now brightly glow.
With tests that dive so deep and true,
Yorkie's docs get a fresh review.
The CRDT trees stand tall and proud,
As Yorkie's updates shout aloud. π³β¨
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?
Attention: Patch coverage is 78.78788%
with 7 lines
in your changes missing coverage. Please review.
Project coverage is 50.67%. Comparing base (
4a47984
) to head (5c4b736
).
Files | Patch % | Lines |
---|---|---|
api/converter/from_pb.go | 58.33% | 3 Missing and 2 partials :warning: |
pkg/document/crdt/rht.go | 81.81% | 2 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
What this PR does / why we need it:
This commit addresses the missing
isRemoved
encoding in the RHT. Similar to other CRDTs like ElementRHT, including tombstone nodes likeisRemoved
during encoding is crucial. However, the RHT did not include tombstone nodes in its encoding, leading to inconsistencies in snapshots.Which issue(s) this PR fixes:
Address https://github.com/yorkie-team/yorkie/issues/889 Address https://github.com/yorkie-team/yorkie/issues/869
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
Additional documentation:
Checklist:
Summary by CodeRabbit
New Features
is_removed
in theNodeAttr
message for better attribute management.RHT
type with comprehensive testing.Bug Fixes
Documentation
Tests
RHT
deep copy and enhanced existing tests forRHT
removal operations.