chitralverma opened a new issue, #9320:
URL: https://github.com/apache/opendal/issues/9320

   
   *Drafted with AI assistance (Claude Code, Claude Opus 5.5, effort xhigh); 
the author is accountable for it.*
   
   ### Feature Description
   
   Generate each binding's operation options (`*Options`) from 
[`core/core/src/types/options.rs`](https://github.com/apache/opendal/blob/4ae8e61222e6d282b2a1ec99db4e87dccacf5919/core/core/src/types/options.rs)
 with the shared parser in 
[`dev/src/generate/core_options.rs`](https://github.com/apache/opendal/blob/4ae8e61222e6d282b2a1ec99db4e87dccacf5919/dev/src/generate/core_options.rs),
 so new core options reach every binding without hand-copying.
   
   This is the options counterpart of #9122 (`Capability`) and #9129 
(`Metadata`). .NET already generates its options (#8440), and Java is doing so 
under #8650.
   
   ### Problem and Solution
   
   Most bindings restate each core options struct by hand, often in three or 
four places (the public type, an FFI mirror, and the conversions), and they 
have fallen behind core. Each sub-issue lists one binding's gaps, current code, 
and compatibility hazards.
   
   Each binding lands in two PRs, as Java does:
   
   1. **Generate the existing options with no API change.** The generator also 
emits the compose, restore, and deleter option types, which no operation takes 
yet (C and C++ keep them out of their public headers until step 2).
   2. **Expose the missing options,** including compose, restore, and deleter. 
Positional and layout surfaces stay append-only.
   
   Bindings:
   
   - [x] .NET: #8440
   - [ ] Java: #8650 (step 1 #9233 merged; step 2 #9234 in review, blocked by 
#9319)
   - [ ] Java: copy, rename, compose, restore, and deleter options (not covered 
by #8650)
   - [ ] Python: #PYTHON
   - [ ] Node.js: #NODEJS
   - [ ] C and Go: #C_GO
   - [ ] C++: #CPP
   - [ ] Ruby: #RUBY (API shape to be agreed first; not planned immediately)
   - [ ] OCaml: #OCAML (API shape to be agreed first; not planned immediately)
   - [ ] Zig: the `Operator` wrapper takes no options; users reach the C option 
structs through `opendal.c` (#C_GO)
   - [ ] Haskell: exposes only `WriterOption.woAppend`
   - [ ] Lua: no operation options
   - [ ] PHP: no operation options
   - [ ] Dart: no operation options
   - [ ] D: no operation options
   - [ ] Swift: no operation options
   - [ ] MoonBit: no operation options
   
   The bindings without a sub-issue are open for anyone to pick up.
   
   ### Additional Context
   
   **Shared prerequisites for step 2**
   
   - #9319: GCS write (JSON simple, JSON resumable, presigned XML) and compose 
request builders drop a requested precondition. Every binding therefore holds 
write-side `if_version_match`, `if_version_not_match`, and `if_not_changed`, 
plus compose `if_version_match` and `if_not_changed`, until the fix is on 
`main`. Copy conditions are not blocked: GCS does not advertise 
`copy_with_if_not_exists`, so the copy request builder never receives the 
combination.
   - #9316: the `checksum` fields on read, reader, stat, and write follow that 
issue.
   - `ReadOptions::limit` returns `ConfigInvalid` with a positive `chunk`, with 
`concurrent` greater than one, or on presign 
([options.rs#L234-L239](https://github.com/apache/opendal/blob/4ae8e61222e6d282b2a1ec99db4e87dccacf5919/core/core/src/types/options.rs#L234-L239),
 [RFC-7945 
Execution](https://github.com/apache/opendal/blob/4ae8e61222e6d282b2a1ec99db4e87dccacf5919/core/core/src/docs/rfcs/7945_limited_read.md#execution)).
 This is intentional; #9200 proposed lifting it and was closed as not planned. 
`ReaderOptions` has no `limit`.
   
   **CI.** The `check_generated` job in 
[`ci_odev.yml`](https://github.com/apache/opendal/blob/4ae8e61222e6d282b2a1ec99db4e87dccacf5919/.github/workflows/ci_odev.yml#L92-L141)
 already runs the Python, Node.js, C, C++, Ruby, and OCaml generators, formats 
the output, and runs `git diff --exit-code`. The binding workflows already diff 
the Python stubs, the Node.js `generated.d.ts`, and the C header. No new CI 
step is needed.
   
   **Order**
   
   1. Step 1 for Python, Node.js, C and Go, and C++ in parallel. Only the 
Python PR edits shared generator files: it retires 
`dev/src/generate/options.rs` and moves `doc_lines`, which `capability.rs`, 
`metadata.rs`, and `core_options.rs` import. The other step-1 PRs should leave 
`core_options.rs` alone and keep their assertions in their own generator tests.
   2. Step 2 for each binding once its step 1 lands, with the GCS and checksum 
fields deferred as above.
   3. Ruby and OCaml once their API shape is agreed. The remaining bindings 
whenever someone picks them up.
   
   **File collisions**
   
   - #9316 plans changes to `metadata.rs` and `core_options.rs`, which conflict 
with Python step 1. Land Python step 1 first or rebase onto it. #9316 also 
changes each binding's `Metadata` output (`opendal.h`, `generated.d.ts`, the Go 
mirrors), which overlaps with every binding's step 2.
   - C and Go share `generate -l c` and `opendal.h`, so each step is one PR for 
both.
   - Go resolves every C symbol it declares when it loads the library. A Go 
step that calls new C setters requires rebuilt `opendal-go-services` companions.
   
   Related: #9122, #9129, #8436, #8440, #8650, #9233, #9234, #9316.
   
   ### Are you willing to contribute to the development of this feature?
   
   - [x] Yes, I am willing to contribute to the development of this feature.
   


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