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

Put rvps dependencies behind rvps-builtin feature flag #550

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

cdrappi
Copy link

@cdrappi cdrappi commented Oct 30, 2024

First of all thank you for building and maintaining such a wonderful suite of libraries! CoCo has been immensely valuable for our team and we appreciate all of the work that the community has put into these projects

Problem

Currently if you run build without the rvps-builtin feature, it fails:

cargo build --no-default-features --features restful-bin,rvps-grpc

This is because the reference-value-provider-service dependency is not included under this feature set (requires rvps-builtin), yet it is used outside of that flag

Proposed solution

This change tucks usage of rvps behind that flag, so the above built command will complete successfully

@cdrappi cdrappi requested a review from a team as a code owner October 30, 2024 19:30
Signed-off-by: Ubuntu <azureuser@tdx-base-test.3z0tm1yprcsefaq3x0wq2wcmyg.cx.internal.cloudapp.net>
Signed-off-by: Ubuntu <azureuser@tdx-base-test.3z0tm1yprcsefaq3x0wq2wcmyg.cx.internal.cloudapp.net>
#[cfg(not(feature = "rvps-builtin"))]
{
return "LocalFs".into()
}
Copy link
Author

Choose a reason for hiding this comment

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

unclear what the correct thing to do is here

Copy link
Member

Choose a reason for hiding this comment

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

hmm I think the best solution here would be to get rid of these default functions entirely and change the config struct to have Optional fields. Then we can use unwrap_or to swap in the default values as needed (i.e. inside of the RVPS module). That's slightly more work but I think it will untangle the dependencies.

Copy link
Member

Choose a reason for hiding this comment

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

The configuration part about RVPS seem not good here. If remote_addr is set, the store_type is actually not useful. It might be better to not have useless fields that can be set. Let me make a fix to cover this. I made a PR #553

Copy link
Member

Choose a reason for hiding this comment

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

I would have settled for a simpler fix but #553 seems good at first glance.

Copy link
Member

@fitzthum fitzthum left a comment

Choose a reason for hiding this comment

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

Good spotting. The current implementation isn't quite right.

#[cfg(not(feature = "rvps-builtin"))]
{
return "LocalFs".into()
}
Copy link
Member

Choose a reason for hiding this comment

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

hmm I think the best solution here would be to get rid of these default functions entirely and change the config struct to have Optional fields. Then we can use unwrap_or to swap in the default values as needed (i.e. inside of the RVPS module). That's slightly more work but I think it will untangle the dependencies.

@Xynnn007
Copy link
Member

Thanks @cdrappi for raising this up. The current RVSP config is not implemented well as it does not have an explicit field to specify whether a local one or a remote one to use. Probably we need to tidy things up.

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.

3 participants