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

Fix misleading message on generate-key #681

Merged
merged 5 commits into from
Oct 9, 2023
Merged

Conversation

angrybayblade
Copy link

@angrybayblade angrybayblade commented Oct 9, 2023

Proposed changes

Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request.

Fixes

fixes #650

Types of changes

What types of changes does your code introduce to agents-aea?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

Put an x in the boxes that apply.

  • I have read the CONTRIBUTING doc
  • I am making a pull request against the develop branch (left side). Also you should start your branch off our develop.
  • Lint and unit tests pass locally with my changes and CI passes too
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that code coverage does not decrease.
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in downstream modules

Comment on lines +278 to +285
if len(crypto_registry.supported_ids) == 0:
raise click.ClickException("No ledger installation found")

if value not in crypto_registry.supported_ids and value != self.ALL:
raise click.ClickException(
f"Invalid identifier provided `{value}`; "
f"Available ledger identifiers {crypto_registry.supported_ids}"
)
Copy link
Author

Choose a reason for hiding this comment

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

Better error messages

@codecov-commenter
Copy link

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (a69aaf3) 91.97% compared to head (ac956d0) 91.97%.
Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #681   +/-   ##
=======================================
  Coverage   91.97%   91.97%           
=======================================
  Files         371      371           
  Lines       29591    29607   +16     
=======================================
+ Hits        27216    27232   +16     
  Misses       2375     2375           
Flag Coverage Δ
unittests 91.97% <94.73%> (+<0.01%) ⬆️

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

Files Coverage Δ
aea/cli/generate_key.py 100.00% <100.00%> (ø)
aea/package_manager/base.py 100.00% <100.00%> (ø)
aea/package_manager/v1.py 98.24% <100.00%> (+0.01%) ⬆️
aea/cli/utils/click_utils.py 92.00% <90.90%> (-0.08%) ⬇️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@solarw solarw left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -259,6 +259,34 @@ def convert(self, value: str, param: Any, ctx: click.Context) -> Dependency:
raise click.ClickException(str(e)) from e


class LedgerChoice(click.ParamType):
Copy link
Collaborator

Choose a reason for hiding this comment

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

nice utility!

@angrybayblade angrybayblade merged commit 7b1ddf3 into main Oct 9, 2023
33 of 36 checks passed
@DavidMinarsch DavidMinarsch deleted the fix/misleading-message branch October 12, 2023 23:54
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.

A ledger should be installed by default OR include more helpful error messages.
4 participants