Please let me suggest a patch as attached for jenkins_build_get to get jenkins build object. Also I put a function url($foo) before each jenkins_request is called because Jenkins uses a job name with spaces as a part of URI.

CommentFileSizeAuthor
jenkins-20131127a.patch1.75 KByas

Comments

yas’s picture

Title: URL encoding » jenkins_build_get function
skwashd’s picture

Status: Needs review » Fixed

Thanks for the patch.

I've applied a modified version of it. jenkins_build_get returns boolean like all the other functions, if you want to access the json, you need to grab it from the $response which you pass in by reference.

I didn't apply the url() calls. Relative paths are treated as internal drupal paths by url(), this can lead to unexpected behaviour - for example someone has a job content type and they're using path aliases. I did call rawurlencode() on the $path argument based into jenkins_request(), which should deal with the problem.

Please only include one feature per issue/patch. It makes it easier to track changes.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.