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(cli.admin.helpers): users can now interactively select keys on disk #712

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

Conversation

trishankatdatadog
Copy link
Contributor

Description

Users can now interactively select keys as files on disk instead of manually typing or at least pasting their entire paths.

Fixes #(issue): N/A

Types of changes

  • Bug fix (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 not to work as expected)

Additional requirements

  • Tests have been added for the bug fix or new feature
  • Docs have been added for the bug fix or new feature

Code of Conduct

By submitting this PR, you agree to follow our Code of Conduct.

  • I agree to follow this project's Code of Conduct

@trishankatdatadog trishankatdatadog changed the title Users can now interactively select keys on disk feat(cli.admin.helpers): users can now interactively select keys on disk Oct 3, 2024
@kairoaraujo
Copy link
Member

Hi @trishankatdatadog, It has very cool functionality! 🎉

To be able to merge it, we will need some extra work (sorry 😃 ):

  • We need to add the new dependency as required during installation

    dependencies = [
    "beaupy",

  • We need to work on the unit tests and also the functional tests. Mostly of our Unit Tests and Functional Tests uses "user iteration" in mocked way.

    • Unit tests are in tests/unit/
    • Functional Tests are in the umbrella repository

    I can help you with them

@trishankatdatadog
Copy link
Contributor Author

We need to work on the unit tests and also the functional tests. Mostly of our Unit Tests and Functional Tests uses "user iteration" in mocked way.

What do you need the tests to do?

@trishankatdatadog
Copy link
Contributor Author

What do you need the tests to do?

Nvm, I understood day before yesterday after some investigation: prompt_toolkit.prompt() needs patching somehow.

@trishankatdatadog
Copy link
Contributor Author

@kairoaraujo sorry, don't understand: could you tell me why 905a1d5 doesn't work?

@kairoaraujo
Copy link
Member

@kairoaraujo sorry, don't understand: could you tell me why 905a1d5 doesn't work?

See https://github.com/repository-service-tuf/repository-service-tuf-cli/pull/712/files#r1796535461

Basically when you mock, you need to add all the iterations that will call prompt_toolkit

Copy link

codecov bot commented Oct 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.23%. Comparing base (47d0a69) to head (3684eb4).
Report is 175 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (47d0a69) and HEAD (3684eb4). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (47d0a69) HEAD (3684eb4)
3 2
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #712       +/-   ##
===========================================
- Coverage   98.90%   86.23%   -12.67%     
===========================================
  Files          20       26        +6     
  Lines        1367     1395       +28     
===========================================
- Hits         1352     1203      -149     
- Misses         15      192      +177     

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


🚨 Try these New Features:

@trishankatdatadog
Copy link
Contributor Author

@kairoaraujo Sorry it took a while, but:

  1. How do you want to address coverage?
  2. I didn't want to repeat the monkeypatches, but I couldn't figure out how not to DRY here.
  3. Would you like to use prompt_toolkit for private keys too in _load_signer_from_file_prompt()?

@trishankatdatadog trishankatdatadog force-pushed the trishankatdatadog/select-file-keys branch 2 times, most recently from b0989ee to 8e23d39 Compare October 21, 2024 05:03
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.

2 participants