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

Git: parse short scp-like syntax into proper SSH URLs #1067

Merged
merged 1 commit into from
Nov 16, 2022

Conversation

chenbh
Copy link
Contributor

@chenbh chenbh commented Nov 10, 2022

fixes #1066

Parse all git URLs before passing to git2go. The parser will convert any short scp-like syntax to proper SSH style ones and leave all other URLs the same.

@chenbh chenbh force-pushed the convert-git-ssh-urls branch from 50c1b4a to 524058f Compare November 10, 2022 21:37
@chenbh chenbh changed the title parse short scp-like syntax into proper ssh urls Git: parse short scp-like syntax into proper SSH URLs Nov 10, 2022
Copy link
Collaborator

@tomkennedy513 tomkennedy513 left a comment

Choose a reason for hiding this comment

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

Nice!

@codecov-commenter
Copy link

codecov-commenter commented Nov 10, 2022

Codecov Report

Merging #1067 (d9c3587) into main (0800c69) will increase coverage by 0.03%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1067      +/-   ##
==========================================
+ Coverage   70.38%   70.41%   +0.03%     
==========================================
  Files         122      123       +1     
  Lines        5912     5919       +7     
==========================================
+ Hits         4161     4168       +7     
  Misses       1348     1348              
  Partials      403      403              
Impacted Files Coverage Δ
pkg/git/fetch.go 79.41% <100.00%> (ø)
pkg/git/remote_git_resolver.go 83.60% <100.00%> (ø)
pkg/git/url_parser.go 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

currently we're lelying on an underlying library (libssh2) to be able to
handle the shorter `[user@]host:path` syntax, but we should be good
citizens and convert it ourselves.

one key thing to note is that we don't convert any syntax that omits the
user (i.e. `host:path`). while git allows this and will use the current
user (i.e. cnb), this is a behaviour we don't want people to rely on.

Signed-off-by: Bohan Chen <bohanc@vmware.com>
@chenbh chenbh force-pushed the convert-git-ssh-urls branch from 524058f to d9c3587 Compare November 10, 2022 22:02
@chenbh chenbh merged commit e204363 into main Nov 16, 2022
@chenbh chenbh deleted the convert-git-ssh-urls branch November 16, 2022 18:54
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.

Build kpack controller with minimal C library dependencies
5 participants