Skip to content

fix(cli): support binary files with @ notation #2753

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

Merged
merged 1 commit into from
Jan 4, 2024
Merged

Conversation

JohnVillalovos
Copy link
Member

@JohnVillalovos JohnVillalovos commented Dec 28, 2023

Support binary files being used in the CLI with arguments using the
@ notation. For example --avatar @/path/to/avatar.png

Also explicitly catch the common FileNotFoundError and PermissionError
exceptions.

Remove the bare exception handling. We would rather have the full
traceback of any exceptions that we don't know about and add them
later if needed.

Closes: #2752

@JohnVillalovos JohnVillalovos marked this pull request as draft December 28, 2023 22:29
Copy link

codecov bot commented Dec 28, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (b8824a6) 96.47% compared to head (a4d0b78) 96.47%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2753   +/-   ##
=======================================
  Coverage   96.47%   96.47%           
=======================================
  Files          89       89           
  Lines        5814     5819    +5     
=======================================
+ Hits         5609     5614    +5     
  Misses        205      205           
Flag Coverage Δ
api_func_v4 82.36% <12.50%> (-0.06%) ⬇️
cli_func_v4 83.63% <75.00%> (+0.08%) ⬆️
unit 88.17% <75.00%> (-0.03%) ⬇️

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

Files Coverage Δ
gitlab/cli.py 100.00% <100.00%> (ø)

@JohnVillalovos JohnVillalovos force-pushed the jlvillal/issue_2752 branch 5 times, most recently from bab6802 to 08630ef Compare December 28, 2023 23:45
@JohnVillalovos JohnVillalovos changed the title wip: testing things fix(cli): support binary files with @ notation Dec 28, 2023
@JohnVillalovos JohnVillalovos marked this pull request as ready for review December 28, 2023 23:46
@JohnVillalovos JohnVillalovos requested a review from nejch December 28, 2023 23:47
Copy link
Member

@nejch nejch left a comment

Choose a reason for hiding this comment

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

@JohnVillalovos thanks a lot, looks nice! Maybe we can just add that one additional I/O error that I think we can expect to happen with OS paths?

Support binary files being used in the CLI with arguments using the
`@` notation. For example `--avatar @/path/to/avatar.png`

Also explicitly catch the common OSError exception, which is the
parent exception for things like: FileNotFoundError, PermissionError
and more exceptions.

Remove the bare exception handling. We would rather have the full
traceback of any exceptions that we don't know about and add them
later if needed.

Closes: #2752
@nejch nejch enabled auto-merge (rebase) January 4, 2024 17:02
@nejch nejch merged commit 57749d4 into main Jan 4, 2024
@nejch nejch deleted the jlvillal/issue_2752 branch January 4, 2024 17:04
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.

CLI: Reading values from files does not support binary files
2 participants