Skip to content

fix(cloud): parse OpenDAL boolean properties the way object_store does - #9782

Open
jackylee-ch wants to merge 2 commits into
vortex-data:developfrom
jackylee-ch:fix/opendal-boolean-properties
Open

fix(cloud): parse OpenDAL boolean properties the way object_store does#9782
jackylee-ch wants to merge 2 commits into
vortex-data:developfrom
jackylee-ch:fix/opendal-boolean-properties

Conversation

@jackylee-ch

@jackylee-ch jackylee-ch commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

cos.rs and oss.rs compared the property string against "true" exactly, so True, 1 and
yes read as false. object_store accepts all of those for its own configuration
(config.rs, impl Parse for bool: 1/true/on/yes/y, lowercased), and so does the
allow_http sibling in hf/mod.rs — only the two OpenDAL services did not.

Values reach make_opendal_store verbatim from the caller's property map, and
warn_on_unknown_properties only warns about unknown keys, so an unusable value was silent:
skip_signature = "True" keeps signing a public bucket (403), and disable_config_load = "True"
leaves OpenDAL loading the ambient credentials the caller asked to turn off.

The new shared property_as_bool trims, lowercases, matches object_store's set, and warns
instead of answering false. goosefs has no boolean property.

Tests

cargo test --release -p vortex-cloud --features cos,oss,goosefs,hf,registry: 101 passed, 84 on
develop; feature matrix checked one flag at a time. Restoring the exact "true" compare fails
7 of the new cases.

AI assistance

Written with agentic AI assistance; I read object_store's Parse for bool in the vendored
0.13.2 source before matching it.

`cos` and `oss` compared the raw property string against `"true"`, so `True`,
`1` and `yes` — all accepted by `object_store` for its own configuration, and
by the `allow_http` sibling in this crate — read as `false` without a warning.

Add a shared `property_as_bool` next to `property_or_env` that trims, lowercases
and matches `object_store`'s set, and warns on a value that is not a boolean
instead of silently answering `false`.

Signed-off-by: jackylee-ch <qcsd2011@gmail.com>
Comment thread vortex-cloud/src/opendal/cos.rs Outdated
#[case("True")]
#[case("1")]
#[case("yes")]
fn cos_reads_disable_config_load_beyond_lowercase_true(#[case] value: &str) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's enough to only test property_as_bool not this and oss methods

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dropped both — property_as_bool covers the parsing, and the call sites are a one-line change each. 101 passed, 84 on develop.

The `property_as_bool` cases cover the parsing; the cos and oss tests only
asserted that each call site reaches it, which is a one-line change per service.

Signed-off-by: jackylee-ch <qcsd2011@gmail.com>
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.

2 participants