Skip to content

v1.34.0 - #616

Merged
sywhang merged 5 commits into
thriftrw:masterfrom
amolmejari2:amol.mejari/release
Jan 13, 2026
Merged

sywhang merged 5 commits into
thriftrw:masterfrom
amolmejari2:amol.mejari/release

Conversation

@amolmejari2

Copy link
Copy Markdown
Contributor

Added

  • Added an option union-decode-relaxed which enables a flexible union decoding
    mode that permits unknown values and returns an empty union struct in such cases.

Atygayev and others added 5 commits July 9, 2025 12:22
Adds an option union-decode-relaxed which enables a flexible union decoding mode that permits unknown values and returns an empty union struct in such cases.

Context

Currently, thriftrw-go generated code deserialize unknown Enum values correctly by preserving them and passing them to the client for appropriate handling. However, for Unions, thriftrw-go generated code fails to deserialize unknown cases gracefully, leading to runtime errors and service outages when new fields are introduced on the server side.

This change introduces an opt-in mechanism in thriftrw-go generated code to allow unknown field in Union deserialization. It ensures backward compatibility in evolving schemas, complies with the Robustness Principle, and defers handling decisions to the caller.
@CLAassistant

CLAassistant commented Jan 13, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@codecov

codecov Bot commented Jan 13, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 13.50482% with 538 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.82%. Comparing base (93c59eb) to head (ed70421).
⚠️ Report is 32 commits behind head on master.

Files with missing lines Patch % Lines
...tests/union_decode_relaxed/union_decode_relaxed.go 10.81% 502 Missing and 34 partials ⚠️
gen/generator.go 80.00% 1 Missing ⚠️
main.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #616      +/-   ##
==========================================
+ Coverage   68.01%   69.82%   +1.80%     
==========================================
  Files         142      142              
  Lines       23878    28159    +4281     
==========================================
+ Hits        16241    19661    +3420     
- Misses       4577     5360     +783     
- Partials     3060     3138      +78     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sywhang
sywhang merged commit 5ccc409 into thriftrw:master Jan 13, 2026
3 of 4 checks passed
@amolmejari2
amolmejari2 deleted the amol.mejari/release branch January 13, 2026 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants