Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CapabilityCheckLayer #5219

Closed
Xuanwo opened this issue Oct 21, 2024 · 3 comments · Fixed by #5352
Closed

Add CapabilityCheckLayer #5219

Xuanwo opened this issue Oct 21, 2024 · 3 comments · Fixed by #5352
Labels
core help wanted Extra attention is needed

Comments

@Xuanwo
Copy link
Member

Xuanwo commented Oct 21, 2024

          Hi, this PR suggests that we consider introducing a layer to handle unsupported behaviors. Not all users and use cases are concerned about whether services support versioning; they might simply want to write code consistently and return it as is if not supported.

We have similar code here:

fn new_unsupported_error(&self, op: impl Into<&'static str>) -> Error {
let scheme = self.meta.scheme();
let op = op.into();
Error::new(
ErrorKind::Unsupported,
format!("service {scheme} doesn't support operation {op}"),
)
.with_operation(op)
}

I think we can create a new layer called CapabilityCheckLayer. By default, opendal will not perform any capability checks. Users can enable CapabilityCheckLayer to ensure the features they use are supported and behave as expected.

CapabilityCheckLayer may have different modes:

  • Default: just bypass all checks, like the opendal default behavior.
  • Correctness: only check capability that affected correctness, for example, write with if none match, read with version.
  • All: check all capabilities.

Originally posted by @Xuanwo in #5145 (comment)

@Xuanwo
Copy link
Member Author

Xuanwo commented Oct 21, 2024

Hello, @meteorgan, are you interested in helping with the implementation? I believe we should transfer most of the check code to the new layer instead.

@Xuanwo Xuanwo added help wanted Extra attention is needed core labels Oct 21, 2024
@meteorgan
Copy link
Contributor

Hello, @meteorgan, are you interested in helping with the implementation? I believe we should transfer most of the check code to the new layer instead.

Yes, I'd love to. I'm still working on other projects, but I can start this one later this week.

@Xuanwo
Copy link
Member Author

Xuanwo commented Oct 22, 2024

Yes, I'd love to. I'm still working on other projects, but I can start this one later this week.

Greatly appreciated. Thank you in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core help wanted Extra attention is needed
Projects
None yet
2 participants