Ok, after seeing how many users of JobDSL are being caught by this, I am inclined to thing we critically need to throw an exception in setOwner if id==null even if this risks breaking existing job-dsl scripts as anything else will risk rebuild storms after job-dsl overwrites the configuration which IMHO would help users fix the bug in their job-dsl scripts rather than mask it further down in the weeds. We cannot make this change cleanly, however, as this change will cause BlueOcean to blow up. I think a hack-fix may be required until BlueOcean is fixed... namely we create the ISE and walk the stack to see if BlueOcean is in the stack-trace... if we see BlueOcean (by String classname) then we Log the exception at SEVERE and set the id to blueocean otherwise we throw. That would be my suggestion, but we should assess any alternatives as the stack walking is certainly a bad code smell... even if a non-performance critical code path... and we need to assess what would happen if job-dsl blows up... does it delete the job or leave it alone? |