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

feat: add feature flag to enable/disable support for Anoncred (backend job and API) #1491 #1492

Merged
merged 6 commits into from
Jan 13, 2025

Conversation

FabioPinheiro
Copy link
Contributor

Add a configuration feature flag to enable or disable support for certain type of credentials like Anomcred

…d job)

Signed-off-by: FabioPinheiro <fabiomgpinheiro@gmail.com>
@FabioPinheiro FabioPinheiro requested a review from a team as a code owner January 9, 2025 12:06
Copy link
Contributor

github-actions bot commented Jan 9, 2025

Unit Test Results

104 files  ±0  104 suites  ±0   20m 17s ⏱️ + 3m 1s
882 tests ±0  874 ✅ ±0  8 💤 ±0  0 ❌ ±0 
889 runs  ±0  881 ✅ ±0  8 💤 ±0  0 ❌ ±0 

Results for commit df14758. ± Comparison against base commit 37a8f41.

♻️ This comment has been updated with latest results.

@coveralls
Copy link

coveralls commented Jan 9, 2025

Coverage Status

coverage: 48.691% (+0.05%) from 48.642%
when pulling df14758 on feat/feat_flag_for_anomcred
into 37a8f41 on main.

Signed-off-by: FabioPinheiro <fabiomgpinheiro@gmail.com>
@github-actions github-actions bot added the pollux label Jan 9, 2025
@FabioPinheiro FabioPinheiro changed the title feat: add feature flag to enable/disable support for Anomcred (backend job) #1491 feat: add feature flag to enable/disable support for Anomcred (backend job and API) #1491 Jan 10, 2025
Signed-off-by: Fabio Pinheiro <fabiomgpinheiro@gmail.com>
@yshyn-iohk
Copy link
Member

Good job, @FabioPinheiro

What do you think about using the feature flags in the ZIO layer bootstrapping logic instead of in the business logic.
I afraid, that it might be harder to test the logic and additional feature flags might make the code hard to maintain.

Signed-off-by: FabioPinheiro <fabiomgpinheiro@gmail.com>
@FabioPinheiro
Copy link
Contributor Author

Good job, @FabioPinheiro

What do you think about using the feature flags in the ZIO layer bootstrapping logic instead of in the business logic. I afraid, that it might be harder to test the logic and additional feature flags might make the code hard to maintain.

I did exactly that discussion with @mineme0110 yesterday. We are slightly in favor of being in the ZIO environment. But to keep consistent, I decided to pass the flags as arguments (as it was already done in most places)

@FabioPinheiro
Copy link
Contributor Author

So now the integration tests are failing as expected. How can we fix this?
The easier way is to add the configuration to behave us before. What about the new expected behavior but he default?

Present Proof Protocol #1.Holder presents anoncreds credential proof to verifier FAILED
    java.lang.AssertionError at LastResponseInteraction.kt:33

@mineme0110
Copy link
Contributor

So now the integration tests are failing as expected. How can we fix this? The easier way is to add the configuration to behave us before. What about the new expected behavior but he default?

Present Proof Protocol #1.Holder presents anoncreds credential proof to verifier FAILED
    java.lang.AssertionError at LastResponseInteraction.kt:33

can we not run integration test with flag enabled

@yshyn-iohk
Copy link
Member

I agree with @mineme0110.
Let's keep the e2e tests with all flags (it should be possible to set the corresponding env variables)
At the same time, we need to add negative use cases that prove disabling logic works well.

@FabioPinheiro
Copy link
Contributor Author

So that is the "easier way". Although I have no idea how to configure the integration test

Signed-off-by: FabioPinheiro <fabiomgpinheiro@gmail.com>
@amagyar-iohk amagyar-iohk changed the title feat: add feature flag to enable/disable support for Anomcred (backend job and API) #1491 feat: add feature flag to enable/disable support for Anoncred (backend job and API) #1491 Jan 13, 2025
Signed-off-by: Allain Magyar <allain.magyar@iohk.io>
Copy link
Contributor

Integration Test Results

20 files  ±0  20 suites  ±0   2s ⏱️ -1s
55 tests ±0  55 ✅ ±0  0 💤 ±0  0 ❌ ±0 
97 runs  ±0  97 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit df14758. ± Comparison against base commit 37a8f41.

@FabioPinheiro FabioPinheiro merged commit 54b7b5b into main Jan 13, 2025
14 checks passed
@FabioPinheiro FabioPinheiro deleted the feat/feat_flag_for_anomcred branch January 13, 2025 17:13
| - Support for the credential type JWT VC is ${if (flags.enableJWT) "ENABLED" else "DISABLED"}
| - Support for the credential type SD JWT VC is ${if (flags.enableSDJWT) "ENABLED" else "DISABLED"}
| - Support for the credential type Anoncred is ${if (flags.enableAnoncred) "ENABLED" else "DISABLED"}
|""")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TODO I'm forgot to call the margin method...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants