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

chore: add indy deprecation warnings #2332

Merged

Conversation

dbluhm
Copy link
Contributor

@dbluhm dbluhm commented Jul 20, 2023

This PR adds deprecation warnings when using the Indy wallet type. The newly added warnings will look like this on startup, assuming wallet type indy is used and log level is set to at least WARNING:

2023-07-20 19:34:16,917 aries_cloudagent.resolver WARNING Ledger is not configured, not loading IndyDIDResolver
2023-07-20 19:34:17,043 aries_cloudagent.indy.sdk.profile WARNING Indy wallet type is deprecated, use Askar instead; see: https://github.com/hyperledger/aries-cloudagent-python/issues/2330
2023-07-20 19:34:17,052 indy.libindy WARNING _indy_loop_callback: Function returned error
2023-07-20 19:34:18,298 indy.libindy WARNING _indy_loop_callback: Function returned error
2023-07-20 19:34:18,300 aries_cloudagent.core.conductor WARNING No ledger configured

::::::::::::::::::::::::::::::::::::::::::::::
:: Aries Cloud Agent                        ::
::                                          ::
::                                          ::
:: Inbound Transports:                      ::
::                                          ::
::   - http://0.0.0.0:3000                  ::
::                                          ::
:: Outbound Transports:                     ::
::                                          ::
::   - http                                 ::
::   - https                                ::
::                                          ::
:: Administration API:                      ::
::                                          ::
::   - http://0.0.0.0:3001                  ::
::                                          ::
::                               ver: 0.8.2 ::
::::::::::::::::::::::::::::::::::::::::::::::

Listening...

DEPRECATTION NOTICE:
        The Indy wallet type is deprecated, use Askar instead; see: https://github.com/hyperledger/aries-cloudagent-python/issues/2330

2023-07-20 19:34:18,473 aries_cloudagent.core.conductor WARNING Wallet version storage record not found.
2023-07-20 19:34:18,473 aries_cloudagent.core.conductor WARNING No upgrade from version was found from wallet or via --from-version startup argument. Defaulting to v0.7.5.
2023-07-20 19:34:18,480 indy.libindy WARNING _indy_loop_callback: Function returned error

The DEPRECATION NOTICE: The indy wallet type... lines will always be printed regardless of log level to stderr (but still only when using the indy wallet type).

The lines added to the profile will ensure warnings are logged whenever a new sub-wallet is created in addition to the main wallet when operating without multi-tenancy. The warnings.warn lines show up in different circumstances from the logging.warning depending on how you're using ACA-Py. I really wanted something attention grabbing though so I added the print_notices to be printed immediately following the banner.

Open to suggestions on what should be included in the warning or if we should point people to somewhere other than #2330.

@dbluhm dbluhm force-pushed the chore/indy-deprecation-warning branch from cae6d7a to 06263f8 Compare July 20, 2023 19:40
@@ -1,25 +1,25 @@
"""Utilities related to logging."""
import asyncio
from datetime import datetime, timedelta
Copy link
Contributor

@andrewwhitehead andrewwhitehead Jul 20, 2023

Choose a reason for hiding this comment

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

These imports ought to be grouped to avoid re-ordering...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've considered adding isort or similar to pre-commit hooks and our format checks lol so it's handled automatically like black for formatting.

@WadeBarnes
Copy link
Contributor

I would be inclined to format the deprecation notice in a more attention grabbing fashion such as this (which is also keeping the formatting consistent with the start-up banner):

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: ⚠ DEPRECATION NOTICE: ⚠                                                                                                         ::
:: -------------------------------------------------------------------------------------------------------------------------------- ::
:: - The Indy wallet type is deprecated, use Askar instead; see: https://github.com/hyperledger/aries-cloudagent-python/issues/2330 ::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

= Unicode character code U+26A0

@WadeBarnes
Copy link
Contributor

WadeBarnes commented Jul 21, 2023

The link to the issue seems fine, but it should include an explicit example of what needs to change; startup parameter --wallet-type indy ==> --wallet-type askar. That issue also gives us a central place to add any additional links to supporting documentation as it becomes available.

@swcurran
Copy link
Contributor

We also are going to add a document about how to migrate, and I’d like to use that as the target of the link — on the aca-py.org site. I’ll use the text that you put together the other day Wade about updating to Askar, along with some additional context.

@dbluhm
Copy link
Contributor Author

dbluhm commented Jul 21, 2023

The warning now looks like:

2023-07-21 14:47:11,390 aries_cloudagent.resolver WARNING Ledger is not configured, not loading IndyDIDResolver
2023-07-21 14:47:11,513 aries_cloudagent.indy.sdk.profile WARNING Indy wallet type is deprecated, use Askar instead; see: https://github.com/hyperledger/aries-cloudagent-python/issues/2330
2023-07-21 14:47:11,518 indy.libindy WARNING _indy_loop_callback: Function returned error
2023-07-21 14:47:12,742 indy.libindy WARNING _indy_loop_callback: Function returned error
2023-07-21 14:47:12,743 aries_cloudagent.core.conductor WARNING No ledger configured

::::::::::::::::::::::::::::::::::::::::::::::
::            Aries Cloud Agent             ::
::                                          ::
::                                          ::
:: Inbound Transports:                      ::
::                                          ::
::   - http://0.0.0.0:3000                  ::
::                                          ::
:: Outbound Transports:                     ::
::                                          ::
::   - http                                 ::
::   - https                                ::
::                                          ::
:: Administration API:                      ::
::                                          ::
::   - http://0.0.0.0:3001                  ::
::                                          ::
::                               ver: 0.8.2 ::
::::::::::::::::::::::::::::::::::::::::::::::

Listening...

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::                             ⚠ DEPRECATION NOTICE: ⚠                              ::
:: -------------------------------------------------------------------------------- ::
:: The Indy wallet type is deprecated, use Askar instead; see:                      ::
:: https://github.com/hyperledger/aries-cloudagent-python/issues/2330               ::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

2023-07-21 14:47:12,870 aries_cloudagent.core.conductor WARNING Wallet version storage record not found.
2023-07-21 14:47:12,871 aries_cloudagent.core.conductor WARNING No upgrade from version was found from wallet or via --from-version startup argument. Defaulting to v0.7.5.
2023-07-21 14:47:12,877 indy.libindy WARNING _indy_loop_callback: Function returned error

Happy to adjust the text whenever the document goes live!

@swcurran
Copy link
Contributor

How about we assume that the link: https://aca-py.org/main/deploying/IndySDKtoAskarMigration/ is the link and I will make sure that the link exists by the time in conjunction with the merge?

Do we want to put this into 0.9.0-rc0, or hold for 0.9.0-rc1/0.9.0 final (whichever comes first). I’m fine either way.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Copy link
Contributor

@swcurran swcurran left a comment

Choose a reason for hiding this comment

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

Ready to go when the tests complete.

@swcurran swcurran merged commit 6bd7994 into openwallet-foundation:main Jul 21, 2023
@dbluhm dbluhm deleted the chore/indy-deprecation-warning branch January 30, 2024 21:31
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.

4 participants