rmuslimov / jenkins.el

Jenkins plugin for emacs
79 stars 30 forks source link

Explicitly get the builds key from the job JSON #21

Closed Wilfred closed 7 years ago

Wilfred commented 7 years ago

Newer version of Jenkins include "_class" at the top level of the job JSON:

$ curl -g 'http://jenkins.example.com/job/foobar/api/json?depth=1&tree=builds[number,timestamp,result,url,building,culprits[fullName]]&pretty=true'
{
  "_class": "hudson.model.FreeStyleProject",
  "builds": [
    {
      "_class": "hudson.model.FreeStyleBuild",
      "building": false,
      "number": 8622,
      "result": "SUCCESS",
      "timestamp": 1499923920765,
      "url": "http://jenkins.example.com/job/foobar/8622/",
      "culprits": []
    },
   ...

This means that cdar does not return the correct part of the JSON. Instead, explicitly access the key we want.

rmuslimov commented 7 years ago

Thanks!