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

[DRAFT] Make ChecksumMismatch prettier, CLI and __str__ #27

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

relrod
Copy link
Member

@relrod relrod commented Oct 8, 2022

DRAFT for these reasons:

  • This needs to be tested with AWX (since it uses our ChecksumMismatch#__str__ in its output)
  • I would like to add tests for the new CLI output/truncation stuff.

Change:

  • [checksum] Make ChecksumMismatch carry differences as a class parameter so that when things like the CLI render it, they can use that information.

  • [checksum] Make ChecksumMismatch implement __str__ and give a pretter error. AWX currently uses str(exc) to render the errors, so this is a UX improvement there as well.

  • [cli] Make the UI show these errors nicer as well. Now it will truncate the listing of files by default to avoid flooding the user's screen if they forgot (for example) to exclude their .git directory. A new flag, --no-truncate, is added to disable this truncation. Also, now the files are listed out in a readable way, one per line, rather than as a literal Python dictionary representation.

Test Plan:

  • Updated tests for the new __str__ output

Signed-off-by: Rick Elrod [email protected]

Change:
- [checksum] Make ChecksumMismatch carry differences as a class parameter
  so that when things like the CLI render it, they can use that information.

- [checksum] Make ChecksumMismatch implement __str__ and give a pretter
  error. AWX currently uses str(exc) to render the errors, so this is a UX
  improvement there as well.

- [cli] Make the UI show these errors nicer as well. Now it will truncate the
  listing of files by default to avoid flooding the user's screen if they
  forgot (for example) to exclude their .git directory. A new flag,
  --no-truncate, is added to disable this truncation. Also, now the files are
  listed out in a readable way, one per line, rather than as a literal Python
  dictionary representation.

Test Plan:
- Updated tests for the new __str__ output

Signed-off-by: Rick Elrod <[email protected]>
Signed-off-by: Rick Elrod <[email protected]>
@djyasin djyasin self-assigned this Oct 14, 2022
@relrod
Copy link
Member Author

relrod commented Oct 26, 2022

I think once this lands, I will plan to cut a 0.2 (or maybe a 1.0.0).

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.

None yet

2 participants