zsy056 opened a new pull request, #3689:
URL: https://github.com/apache/thrift/pull/3689

   ## Summary
   
   - add `--audit-allow-optional-field-removal` so explicit optional fields can 
be removed when intentionally enabled
   - add `--audit-allow-required-field-to-default` so required fields can move 
to default requiredness when intentionally enabled
   - keep default-field removal, required-field removal, default-to-required, 
and required-to-optional changes rejected
   - move configurable audit coverage into standalone `.thrift` fixtures
   - register the audit suite with both Automake and CMake, and exercise it in 
GitHub Actions
   
   ## Compatibility validation
   
   Generated separate C++ bindings for required and default requiredness and 
tested both directions with the binary protocol:
   
   - required writer -> default-requiredness reader: value `8675309` recovered
   - default-requiredness writer -> required reader: value `8675309` recovered
   - both serialized payloads were identical (8 bytes)
   
   This confirms that removing explicit `required` while retaining default 
requiredness is wire-compatible for this transition.
   
   ## Regression proof
   
   In a disposable WSL2 checkout, I temporarily weakened the optional-removal 
guard so the option also allowed removal of a default-requiredness field. The 
registered CMake `ThriftAuditTest` failed on the intended negative case:
   
   ```
   TEST FAILURE: default field removal remains rejected by optional removal 
option: expected exit code 2, got 0
   ```
   
   After restoring the committed implementation, the same test passed.
   
   ## Validation
   
   - CMake build and full `ctest`: 18/18 passed
   - rebased-head CMake `ThriftAuditTest`: passed
   - Autotools top-level `make check`: passed, including `test/audit`
   - `perl -c test/audit/thrift_audit_test.pl`: passed
   - `git diff --check`: passed
   
   ## Checklist
   
   - [ ] Apache Jira ticket (not created for this contribution)
   - [x] Single commit
   - [x] No default audit behavior changed; compatibility allowances require 
explicit options
   - [x] Test coverage added with standalone Thrift files
   
   ## AI assistance
   
   Generated-by: OpenAI Codex (GPT-5)


-- 
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]

Reply via email to