eemario opened a new pull request, #1486:
URL: https://github.com/apache/flink-agents/pull/1486

   Partially addresses #1460. Class-level lifecycle metadata and its 
interaction with individual options are follow-up work depending on #1459.
   
   ### Purpose of change
   
   Resource authors can describe a configuration option, mark it required, and 
restrict its values in Java and Python. Both the option declaration and the 
typed read path use the same validation rule.
   
   ### Behavioral Semantics
   
   - A non-null default must match the declared type and satisfy the rule. A 
required option rejects every non-null default, including zero, false, and the 
empty string.
   - An option accepts one constraint. `AllowedValues` accepts a nonempty 
collection of strings, integers (Java `Integer` or `Long`), or members of one 
enum. `NumericRange` supports inclusive lower and upper bounds, together or 
individually.
   - `AgentConfiguration.get(option)` resolves the configured value or default, 
applies the existing conversion where applicable, and validates the result. A 
missing required value or a value outside the rule raises an error identifying 
the key. An absent optional value with no default returns `null` / `None`. 
String-key getters retain their existing conversion behavior.
   - Python options can carry separate versions for becoming stable and 
becoming deprecated.
   
   ### Tests
   
   | Contract | Coverage |
   | --- | --- |
   | Default validation, required options, allowed types, enum subsets, range 
bounds and numeric precision | Java `ConfigOptionContractTest` and Python 
`test_config_option.py` |
   | Validation of configured and missing values during typed reads | Java 
`AgentConfigurationTest` and Python `test_configuration.py` |
   | Equivalent metadata and validation outcomes across languages | 
`check_java_python_config_options_parity.py` against the rebuilt Java API JAR |
   | Stability and deprecation versions | Lifecycle tests in 
`test_config_option.py` |
   
   Local verification passed for the Java API and plan suites (1,809 tests 
reported, 21 skipped), Python non-integration tests (1,920 passed, 18 skipped), 
the configuration parity script, Spotless, Ruff and the Git whitespace check. 
External-service integration tests and the full end-to-end suite were outside 
this verification.
   
   <details>
   <summary>Declaration and parity checks</summary>
   
   Construction validates non-null defaults without dispatching to a subclass 
override. Allowed choices are copied at declaration time. The parity script 
reads Java metadata through the Python gateway and exercises shared validation 
cases, including errors that must name the option key.
   
   </details>
   
   ### API
   
   Java adds `ConfigOption.builder(key, type)`, `ValueConstraint`, 
`AllowedValues`, and `NumericRange`. Python adds keyword-only declaration 
fields and the two rule types. Existing three-argument declarations remain 
valid when their defaults match the declared type. Both languages expose option 
validation.
   
   ### Documentation
   
   - [x] `doc-needed`
   - [ ] `doc-not-needed`
   - [ ] `doc-included`
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   - [x] Yes
   - [ ] No
   
   Generated-by: Codex CLI 0.171.0-alpha.13.2 (GPT-6)


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