-
Notifications
You must be signed in to change notification settings - Fork 391
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
[JENKINS-61193] Export no_proxy hosts when using HTTP proxy #516
base: master
Are you sure you want to change the base?
Conversation
You're not supposed to make the list of non proxy hosts hard coded, these should be retrieved from the configuration on the proxy object.
The proxy object is of type hudson.ProxyConfiguration. This class already has some utility methods to retrieve the no proxy hosts as a list of Patterns but that is not usable here. |
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.
Must use the values of NO_PROXY as provided by the Jenkins interface. Must have automated tests that show the NO_PROXY setting is honored.
Thanks @codingtim for the help. @MarkEWaite can you tell me whether I should make automated test for checking if the no proxy hosts have been added as no_proxy in the environment variable or something else. |
How will I check whether the NO_PROXY setting is being honored ? Do I have to make some http request to no_proxy host ? |
I should have been more clear when I said "NO_PROXY is honored". In this case, I think the reasonable effort task is to place a As far as I understand it, there are many different ways to configure proxies and each has its own set of common mistakes and challenges. We can't test more than the most basic "is it set" functionality in the test automation. |
I wanted to ask one more question, like why we are not putting the proxy settings in global |
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.
I have made the required changes in new commit.
Silence a spotbugs warning.
JENKINS-61193 - Export no_proxy hosts when using HTTP proxy
I have added an ArrayList containing all the hosts which don't need any proxy. Then at the time of setting environment variables for proxy I have also set the hosts(e.g. 169.254.169.254) which will not require any proxy.
Checklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. This is simply a reminder of what we are going to look for before merging your code.Types of changes
What types of changes does your code introduce? Put an
x
in the boxes that applyFurther comments
If this is a relatively large or complex change, start the discussion by explaining why you chose the solution you did and what alternatives you considered.