JENKINS-58753: Jenkins proxy settings support. #4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These changes should fix the issue found here
I have added a new setting to afford the use of the proxy configuration in Jenkins (advanced tab of the plugins manager page, programmatically via
hudson.ProxyConfiguration
).I refactored the existing
io.jenkins.plugins.zoom.ZoomNotifyClient
class to be able to reuse most of the code without any functional changes. In other words, if the Jenkins proxy is not configured at all, not configured correctly, or the new setting prevents the configuration from being used, the plugin behaves exactly as it did before.Since proxy settings may be set at both via JVM args and via the Jenkins configuration, the new setting is useful to force the new behavior off.
The new proxy behaviour is also slightly less performant than the existing behavior because
(a) proxy settings are checked on every invocation
(b) a new httpClient is created for every proxied request.
Both are by design. This is so that a restart is not needed when proxy settings are modified, and also because the proxy configuration must be set via the httpclient builder.
If you feel this code is ok, please merge it for the next version. I have tested it internally and it is working great for me.