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

lab mr create: Check file exists (-F/-f options) #743

Merged
merged 1 commit into from
Sep 22, 2021

Conversation

prarit
Copy link
Collaborator

@prarit prarit commented Sep 22, 2021

Currently, when the file specified with the -F or -f options does not
exist, lab outputs a very generic error that is not helpful to users

[prarit@prarit kernel-test]$ ~/git-kernel/github/lab/lab mr create
2021/09/22 07:14:40 ERROR: mr_create.go:289: empty MR message

Check to see if the file exists and report a better error if the file is
not present. For example,

[prarit@prarit kernel-test]$ ~/git-kernel/github/lab/lab mr create -F /tmp/non-existent.file
2021/09/22 07:15:02 ERROR: mr_create.go:244: file /tmp/non-existent.file cannot be found

Fixes #742

Signed-off-by: Prarit Bhargava prarit@redhat.com

Currently, when the file specified with the -F or -f options does not
exist, lab outputs a very generic error that is not helpful to users

[prarit@prarit kernel-test]$ ~/git-kernel/github/lab/lab mr create
2021/09/22 07:14:40 ERROR: mr_create.go:289: empty MR message

Check to see if the file exists and report a better error if the file is
not present.  For example,

[prarit@prarit kernel-test]$ ~/git-kernel/github/lab/lab mr create -F /tmp/non-existent.file
2021/09/22 07:15:02 ERROR: mr_create.go:244: file /tmp/non-existent.file cannot be found

Fixes zaquestion#742

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
@codecov
Copy link

codecov bot commented Sep 22, 2021

Codecov Report

Merging #743 (da3273b) into master (527e709) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #743   +/-   ##
=======================================
  Coverage   54.61%   54.62%           
=======================================
  Files          77       77           
  Lines        5597     5598    +1     
=======================================
+ Hits         3057     3058    +1     
  Misses       2257     2257           
  Partials      283      283           
Impacted Files Coverage Δ
cmd/mr_create.go 75.22% <100.00%> (+0.11%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 527e709...da3273b. Read the comment docs.

@prarit prarit merged commit 4bbfcbd into zaquestion:master Sep 22, 2021
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.

Raise an error (or a warning) if a provided file is inaccessible
2 participants