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

Modifying callable to have proxy information #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JonathanKershaw
Copy link

Fixes an issue where the Callable cannot look up http proxy details from jenkins to download the latest script when the job is running on an agent. This is because the download utility (DetectDownloadManager) uses the JenkinsProxyHelper utility which uses Jenkins.getInstanceOrNull() which will fail if not run on jenkins master. In line with the docs for this method (https://javadoc.jenkins-ci.org/jenkins/model/Jenkins.html#getInstanceOrNull--) the plugin should ensure that the Callable has all the things it needs when it is sent over the remoting channel so that it does not need to refer to Jenkins. I have modified the code to take the proxy info and store it in the Callable. This depends on a separate pull request to integration-rest (blackducksoftware/integration-rest#14) to make ProxyInfo and Credentials serializable (which simply involves adding that interface to them both).

Open to ideas on different approaches - a possible extension could be to have environment variable(s) to set specific proxy details on a given agent.

Have tested on our jenkins setup and it is now able to use the proxy details to download the latest script when running on our agent where previously the download failed.

this way it doesn't need to look up the info from the Jenkins singleton
which doesn't work when the job is running on an agent.
@rottebds
Copy link
Contributor

Thank you for your PR @JonathanKershaw, this issue has been slated for the next release version of Synopsys Detect for Jenkins which is to be planned.

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.

2 participants