{"action":"created","issue":{"url":"https://api.github.com/repos/jenkinsci/workflow-cps-plugin/issues/3","repository_url":"https://api.github.com/repos/jenkinsci/workflow-cps-plugin","labels_url":"https://api.github.com/repos/jenkinsci/workflow-cps-plugin/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/jenkinsci/workflow-cps-plugin/issues/3/comments","events_url":"https://api.github.com/repos/jenkinsci/workflow-cps-plugin/issues/3/events","html_url":"https://github.com/jenkinsci/workflow-cps-plugin/pull/3","id":146994426,"number":3,"title":"[JENKINS-26156] BodyInvoker.displayName was broken","user":{"login":"jglick","id":154109,"avatar_url":"https://avatars.githubusercontent.com/u/154109?v=3","gravatar_id":"","url":"https://api.github.com/users/jglick","html_url":"https://github.com/jglick","followers_url":"https://api.github.com/users/jglick/followers","following_url":"https://api.github.com/users/jglick/following{/other_user}","gists_url":"https://api.github.com/users/jglick/gists{/gist_id}","starred_url":"https://api.github.com/users/jglick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jglick/subscriptions","organizations_url":"https://api.github.com/users/jglick/orgs","repos_url":"https://api.github.com/users/jglick/repos","events_url":"https://api.github.com/users/jglick/events{/privacy}","received_events_url":"https://api.github.com/users/jglick/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-08T17:51:38Z","updated_at":"2016-04-08T17:52:37Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/jenkinsci/workflow-cps-plugin/pulls/3","html_url":"https://github.com/jenkinsci/workflow-cps-plugin/pull/3","diff_url":"https://github.com/jenkinsci/workflow-cps-plugin/pull/3.diff","patch_url":"https://github.com/jenkinsci/workflow-cps-plugin/pull/3.patch"},"body":"[JENKINS-26156](https://issues.jenkins-ci.org/browse/JENKINS-26156)\r\n\r\nBefore:\r\n* if you passed null, or simply did not call it at all, there were body block nodes contrary to documentation\r\n* if you passed non-null, you would get an `IllegalStateException` (!)\r\n\r\nAfter:\r\n* body block nodes are created unconditionally\r\n* you may call it, with a non-null name, if you want a label on the body block\r\n\r\n@kohsuke seems to have been trying to elide body block nodes when they contribute no interesting information, as in most steps accepting a closure (`node`, say, as opposed to `retry` which _might_ have something interesting to show like a retry count). But this was never actually implemented, and seems too dangerous to try anyway. What if a step asked to elide the body block nodes but then actually called its body twice? We would get a confused flow graph.\r\n\r\nI _did_ clean up the log display a bit, from what @amuniz did in https://github.com/jenkinsci/pipeline-plugin/pull/215. Before:\r\n\r\n```\r\n[Pipeline] Some display name intended for GUI : Start\r\n[Pipeline] theActualStepName {\r\nbody text…\r\n[Pipeline] } //theActualStepName\r\n[Pipeline] Some display name intended for GUI : End\r\n```\r\n\r\nAfter:\r\n\r\n```\r\n[Pipeline] theActualStepName {\r\n[Pipeline] {\r\nbody text…\r\n[Pipeline] }\r\n[Pipeline] } // theActualStepName\r\n```\r\n\r\nWith some more work in `WorkflowRun.logNodeMessage` this could probably be improved further, to check for `BodyInvocationAction` and `LabelAction` on `BlockStartNode`s, giving us a more streamlined\r\n\r\n```\r\n[Pipeline] theActualStepName {\r\nbody text…\r\n[Pipeline] } // theActualStepName\r\n```\r\n\r\nplus some variants for bodies which are actually run >1 time and/or specify a label, but I will leave that for another day.\r\n\r\n@reviewbybees"},"comment":{"url":"https://api.github.com/repos/jenkinsci/workflow-cps-plugin/issues/comments/207536053","html_url":"https://github.com/jenkinsci/workflow-cps-plugin/pull/3#issuecomment-207536053","issue_url":"https://api.github.com/repos/jenkinsci/workflow-cps-plugin/issues/3","id":207536053,"user":{"login":"reviewbybees","id":10512980,"avatar_url":"https://avatars.githubusercontent.com/u/10512980?v=3","gravatar_id":"","url":"https://api.github.com/users/reviewbybees","html_url":"https://github.com/reviewbybees","followers_url":"https://api.github.com/users/reviewbybees/followers","following_url":"https://api.github.com/users/reviewbybees/following{/other_user}","gists_url":"https://api.github.com/users/reviewbybees/gists{/gist_id}","starred_url":"https://api.github.com/users/reviewbybees/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reviewbybees/subscriptions","organizations_url":"https://api.github.com/users/reviewbybees/orgs","repos_url":"https://api.github.com/users/reviewbybees/repos","events_url":"https://api.github.com/users/reviewbybees/events{/privacy}","received_events_url":"https://api.github.com/users/reviewbybees/received_events","type":"User","site_admin":false},"created_at":"2016-04-08T17:52:37Z","updated_at":"2016-04-08T17:52:37Z","body":"This pull request originates from a [CloudBees](https://www.cloudbees.com/) employee. At CloudBees, we require that all pull requests be reviewed by other CloudBees employees before we seek to have the change accepted. If you want to learn more about our process please see [this explanation](https://github.com/reviewbybees/about#about-reviewbybees).\n"}}