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

Vdrtools & Modular Libs as feature flags #763

Merged
merged 13 commits into from
Apr 10, 2023
Merged

Vdrtools & Modular Libs as feature flags #763

merged 13 commits into from
Apr 10, 2023

Conversation

gmulhearn
Copy link
Contributor

@gmulhearn gmulhearn commented Mar 1, 2023

This PR moves vdrtools & modular dependencies (indy-credx & indy-vdr) under their own separate feature flags.

The idea is that consumers who do not want to use vdrtools dependencies (e.g. using modular deps or their even own deps instead), can override the default flag and use their own Profile. This way the consumer does not have to pull in the heavy-weight deps of libvdrtools. Likewise for modular_libs.

I've kept vdrtools as the default feature for aries_vcx, as it is most likely what is currently used the most. In the future we may think about changing this

It is also enforced, that when testing with test_utils, both vdrtools and modular_libs must be enabled.

Other Changes

  • Had to move the LibIndyMocks structure out of indy. There is now a global statuscodemock for the same functionality, however in the long term, we should remove this
  • renamed modular_dependencies to modular_libs_tests to better represent that it is just a testing feature flag.

gmulhearn and others added 6 commits March 1, 2023 23:59
Signed-off-by: gmulhearn <gmulhearn@proton.me>
Signed-off-by: gmulhearn <gmulhearn@proton.me>
Signed-off-by: gmulhearn <gmulhearn@proton.me>
Signed-off-by: gmulhearn <gmulhearn@proton.me>
Signed-off-by: gmulhearn <gmulhearn@proton.me>
@codecov-commenter
Copy link

codecov-commenter commented Mar 15, 2023

Codecov Report

Merging #763 (6f489f6) into main (2f45045) will increase coverage by 7.26%.
The diff coverage is 55.00%.

@@            Coverage Diff             @@
##             main     #763      +/-   ##
==========================================
+ Coverage   46.93%   54.19%   +7.26%     
==========================================
  Files         381      381              
  Lines       32516    36850    +4334     
  Branches     7202     8307    +1105     
==========================================
+ Hits        15260    19972    +4712     
+ Misses      12491    10713    -1778     
- Partials     4765     6165    +1400     
Flag Coverage Δ
unittests-aries-vcx 54.09% <50.00%> (+7.17%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...vcx/src/common/primitives/credential_definition.rs 49.74% <0.00%> (ø)
aries_vcx/src/indy/credentials/issuer/mod.rs 55.00% <0.00%> (ø)
aries_vcx/src/indy/utils/mod.rs 65.21% <ø> (+65.21%) ⬆️
aries_vcx/src/lib.rs 100.00% <ø> (+75.00%) ⬆️
aries_vcx/src/plugins/anoncreds/indy_anoncreds.rs 79.02% <ø> (ø)
aries_vcx/src/plugins/ledger/indy_ledger.rs 61.59% <ø> (ø)
...ries_vcx/src/utils/mockdata/profile/mock_wallet.rs 21.42% <0.00%> (+2.38%) ⬆️
aries_vcx/src/utils/mod.rs 60.00% <ø> (ø)
aries_vcx/tests/test_mysql_wallet.rs 100.00% <ø> (ø)
aries_vcx/src/global/settings.rs 69.56% <50.00%> (+1.14%) ⬆️
... and 5 more

... and 121 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Signed-off-by: gmulhearn <gmulhearn@proton.me>
Signed-off-by: gmulhearn <gmulhearn@proton.me>
Signed-off-by: gmulhearn <gmulhearn@proton.me>
Signed-off-by: gmulhearn <gmulhearn@proton.me>
@gmulhearn gmulhearn changed the title Experiment - Vdrtools as a feature flag Vdrtools & Modular Dependencies as feature flags Apr 3, 2023
@gmulhearn gmulhearn changed the title Vdrtools & Modular Dependencies as feature flags Vdrtools & Modular Libs as feature flags Apr 3, 2023
Signed-off-by: gmulhearn <gmulhearn@proton.me>
@gmulhearn gmulhearn marked this pull request as ready for review April 3, 2023 08:41
@gmulhearn gmulhearn requested a review from Patrik-Stas April 3, 2023 08:41
@gmulhearn
Copy link
Contributor Author

@Patrik-Stas requested for review a bit early bcus i'm too impatient for wait for the pipeline! I will double check that it has passed later... but it should be good

@gmulhearn gmulhearn requested review from a team and removed request for a team April 4, 2023 10:02
Signed-off-by: Patrik <patrik.stas@absa.africa>
Copy link
Contributor

Choose a reason for hiding this comment

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

nice job with feature documentation

@Patrik-Stas Patrik-Stas requested review from mirgee and bobozaur April 6, 2023 08:46
@Patrik-Stas
Copy link
Contributor

@mirgee @bobozaur one of you please review and merge if you good with this

@Patrik-Stas
Copy link
Contributor

@gmulhearn another great incremental step forward!

Copy link
Contributor

@bobozaur bobozaur left a comment

Choose a reason for hiding this comment

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

I'm okay with the changes considering the goal of the PR.

I think that in the future, though, we should strive towards refactoring all this test feature flag and mocks mess outside of aries-vcx (at least it's src).

Since aries-vcx does not depend on libvdrtoola, then it shouldn't even be used. We could maybe provide a vdrtools-based wallet et al in a separate crate that can be used by consumers.

@Patrik-Stas
Copy link
Contributor

Patrik-Stas commented Apr 10, 2023

@bobozaur just some clarification

Since aries-vcx does not depend on libvdrtoola, then it shouldn't even be used.

aries-vcx does depend on libvdrtools, but the goal is to get rid of it - the feature flags are way to opt-in either vdrtools or indy-vdr+credex as implementation under the hood.

The testing feature flags are orthogonal to the changes in this pr, though I don't disagree there can be better way to test

@Patrik-Stas Patrik-Stas merged commit ae0ca7e into main Apr 10, 2023
@Patrik-Stas Patrik-Stas deleted the gm/indy-feature branch April 10, 2023 17:29
Andy-Waine pushed a commit to Andy-Waine/aries-vcx that referenced this pull request Apr 13, 2023
* Add feature flags to opt-in vdrtools or modular libs implementation

Signed-off-by: gmulhearn <gmulhearn@proton.me>
Co-authored-by: George Mulhearn <gmulhearn@anonyome.com>
Signed-off-by: Andy Waine <88730354+Andy-Waine@users.noreply.github.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.

5 participants