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: better error message for invalid repo URL #9513

Conversation

crenshaw-dev
Copy link
Collaborator

@crenshaw-dev crenshaw-dev commented May 25, 2022

Right now a bad repo URL gives a weird error message about the temp directory root being the same as the repo root.

This change throws a better error message that explains why the hypothetical repo root would be the same as /tmp - because URL validation failed and the validator returned an empty string.

Opened because of this question: https://cloud-native.slack.com/archives/C01TSERG0KZ/p1653498323603809

Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>
@codecov
Copy link

codecov bot commented May 25, 2022

Codecov Report

Merging #9513 (407e745) into master (7005453) will increase coverage by 0.01%.
The diff coverage is 80.00%.

@@            Coverage Diff             @@
##           master    #9513      +/-   ##
==========================================
+ Coverage   45.86%   45.88%   +0.01%     
==========================================
  Files         221      221              
  Lines       26309    26312       +3     
==========================================
+ Hits        12067    12072       +5     
+ Misses      12586    12585       -1     
+ Partials     1656     1655       -1     
Impacted Files Coverage Δ
util/git/client.go 48.65% <80.00%> (+0.52%) ⬆️
util/settings/settings.go 48.16% <0.00%> (ø)
util/git/git.go 81.81% <0.00%> (+6.06%) ⬆️

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 7005453...407e745. Read the comment docs.

@crenshaw-dev crenshaw-dev requested a review from leoluz May 25, 2022 19:10
Copy link
Member

@jannfis jannfis left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@jannfis
Copy link
Member

jannfis commented May 30, 2022

There seems to be a conflict.

Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>
@crenshaw-dev crenshaw-dev merged commit 66efffb into argoproj:master Jun 2, 2022
@crenshaw-dev crenshaw-dev deleted the better-invalid-ssh-repo-url-error-message branch June 2, 2022 20:39
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