The GitHub Actions job "npm_and_yarn in /javascript for glob - Update 
#1193637361" on fory.git/main has failed.
Run started by GitHub user dependabot[bot] (triggered by dependabot[bot]).

Head commit for run:
db57e1b9332ac9f66bb61f731cbf3de211b29ddd / Shawn Yang <[email protected]>
feat(java/python/rust/go/c++): align nullable meta for xlang struct fields 
serialization  (#3093)

## Why?

The cross-language (xlang) struct serialization had inconsistent
nullable and ref flag handling across different language implementations
(Java, Rust, C++, Go, Python). This caused:

1. **Schema hash mismatches**: Different languages computed different
fingerprints for the same struct schema, causing version compatibility
issues
2. **Ref flag inconsistency**: Some languages wrote ref flags for
non-nullable fields while others didn't
3. **Null handling bugs**: Null entries in maps were not properly
handled in some implementations

## What does this PR do?

### Core Protocol Alignment

**Unified nullable semantics across all languages:**
- In xlang mode, fields are **non-nullable by default** (except
`Optional` types and boxed primitives)
- Ref flags are **only written when `nullable=true`** - non-nullable
fields skip the ref flag entirely
- This matches the xlang protocol specification and ensures consistent
wire format

**Key changes per language:**

| Language | Changes |
|----------|---------|
| **Java** | New `Fingerprint.java` for consistent struct fingerprint
computation; updated serializers for xlang nullable defaults |
| **Rust** | Simplified `field_need_write_ref_into()` to only check
nullable flag |
| **C++** | Updated `field_is_nullable` logic; fixed map null entry
handling; aligned struct/ext skip logic |
| **Go** | Updated codegen encoder/decoder for nullable handling; new
pointer utilities |
| **Python** | Updated typedef encoder/decoder; aligned struct
serialization |

### Code Refactoring (Java)

- Extracted `FieldInfo` and `FieldTypes` from `ClassDef.java` (reduced
from ~900 lines to ~3 lines)
- Added logging infrastructure (`ForyLogger`, `LogLevel`, `Logger`,
`Slf4jLogger`)
- Enhanced `TypeRef` with additional type utilities
- Updated `TypeResolver` with improved type handling

### Bug Fixes

- **C++ map serializer**: Fixed null entry handling - now properly
inserts entries with default-constructed keys/values instead of skipping
- **C++ skip logic**: Fixed `skip_struct` and `skip_ext` to handle
different struct type categories correctly (COMPATIBLE_STRUCT,
NAMED_COMPATIBLE_STRUCT, NAMED_STRUCT, STRUCT)
- **C++ enum handling**: Fixed enum field nullability in xlang mode

### CI Improvements

- Added dedicated `python_xlang` job for Python cross-language testing
- Removed unnecessary bazel setup from Java CI jobs (not needed for Java
tests)

### Test Updates

- Updated cross-language tests in all languages to use non-nullable
defaults
- Changed `std::optional<T>` to `T` in C++ test structs to match xlang
semantics
- Added comprehensive xlang test coverage for Java, Rust, C++, Go,
Python

## Related issues

#1017 
#2982 
#2906 

## Does this PR introduce any user-facing change?

- [x] Does this PR introduce any public API change?
- In xlang mode, struct fields are now non-nullable by default. Users
who relied on implicit nullability should add explicit
`@ForyField(nullable = true)` or use `Optional<T>` types.
- [x] Does this PR introduce any binary protocol compatibility change?
- Yes, the ref flag behavior has changed for xlang mode. Non-nullable
fields no longer write ref flags. This is a breaking change for existing
xlang serialized data.

## Benchmark

N/A (Protocol alignment, no performance-related changes)

Report URL: https://github.com/apache/fory/actions/runs/20589216200

With regards,
GitHub Actions via GitBox


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to