-
Notifications
You must be signed in to change notification settings - Fork 897
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
Allow users to specify a proxy for git repositories #19132
Conversation
1898b8a
to
59f9cd2
Compare
59f9cd2
to
465053a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor change requested (just for the PR description):
Possibly include a brief mention as to why we are using our own fork of rugged
instead of waiting for upstream to merge, just so this is searchable in the future and there is place documented as to the origination of this decision being made. I understand why, but other possibly doing some "git
spelunking" in the future might not, and not everyone will be searching commit messages for this info either.
Woops... my guess is this was my PR... 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since I think I know the answer to the two questions I asked, I am going to just approve this PR.
Looks good to me. Nice work!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM...just need to clean up the rubocops.
This gives us the proxy_url option for clone_at and other remote operations https://bugzilla.redhat.com/show_bug.cgi?id=1735712
465053a
to
ad9b2b2
Compare
Just waiting on rubocops and the "Test this for real" |
Status here is I'm trying to test this with something similar to the ssh tunnel proxies described in the original proxy BZ https://bugzilla.redhat.com/show_bug.cgi?id=1475954 I was able to get the proxy info saved, but didn't provide a scheme which caused a segfault. Probably need a check for a valid url in the rugged code. After getting past that, the request out to the proxy failed and hung on the first call. Still trying to work out what's happening there. |
I was able to get this to work by setting up a simple squid proxy server. The ssh (socks5) version isn't going to work for a variety of reasons. But while testing that I noticed that the ssh-style repo urls raise an interesting error when we provide a proxy:
Assuming we're not going to hold this for authentication support, I figure we should only use the proxy for http(s) based repos, right? |
This uses the new rugged proxy options for remote operations https://bugzilla.redhat.com/show_bug.cgi?id=1735712
This parallels the data migration in ManageIQ/manageiq-schema#406 https://bugzilla.redhat.com/show_bug.cgi?id=1735712
ad9b2b2
to
12fd936
Compare
This commit also adds a path setting to the proxy url because without it the url validation was failing in libgit2. It wants at least a trailing slash. https://bugzilla.redhat.com/show_bug.cgi?id=1735712
These are the only ones supported in libgit2 (at least as of 0.28.2) ref: https://github.com/libgit2/libgit2/blob/v0.28.2/src/netops.c#L151-L169 https://bugzilla.redhat.com/show_bug.cgi?id=1735712
This causes an authentication error. Specifically: Rugged::SshError (authentication required but no callback set) https://bugzilla.redhat.com/show_bug.cgi?id=1735712
6330383
to
b1a6d95
Compare
Checked commits carbonin/manageiq@c6bce7a~...b1a6d95 with ruby 2.4.6, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0 |
Removed WIP. This does what I feel like is the MVP to satisfy the regression in the timeframe we have. Follow-up work to here and rugged itself would be needed to support credentials and ssh-style repo urls. |
Yeah, we can support proxy + https right now...I'm not sure what callback they are looking for that we haven't already provided. |
Allow users to specify a proxy for git repositories (cherry picked from commit cdbb3e7) https://bugzilla.redhat.com/show_bug.cgi?id=1735712
Ivanchuk backport details:
|
This PR uses my changes to rugged (libgit2/rugged#808) to allow users to configure a git repository proxy url.
This also builds on ManageIQ/manageiq-schema#406 which moved the embedded ansible proxy options to a top level setting so it could apply to all git repositories. We did this because it made it much easier to get the proxy options to the worktree instance from the GitRepository model. Without the settings change we would have to make the proxy settings conditional on whether or not the git repository instance existed because it was part of an embedded ansible configuration script source.
Plus automate domains get proxy support for free 😄
https://bugzilla.redhat.com/show_bug.cgi?id=1735712
TODO: