{"action":"created","comment":{"url":"https://api.github.com/repos/jenkinsci/workflow-plugin/pulls/comments/40889116","id":40889116,"diff_hunk":"@@ -0,0 +1,55 @@\n+/*\n+ * The MIT License\n+ *\n+ * Copyright (c) 2015, CloudBees, Inc.\n+ *\n+ * Permission is hereby granted, free of charge, to any person obtaining a copy\n+ * of this software and associated documentation files (the \"Software\"), to deal\n+ * in the Software without restriction, including without limitation the rights\n+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n+ * copies of the Software, and to permit persons to whom the Software is\n+ * furnished to do so, subject to the following conditions:\n+ *\n+ * The above copyright notice and this permission notice shall be included in\n+ * all copies or substantial portions of the Software.\n+ *\n+ * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n+ * THE SOFTWARE.\n+ */\n+\n+package org.jenkinsci.plugins.workflow.job.console;\n+\n+import java.io.IOException;\n+import java.io.OutputStream;\n+\n+import hudson.console.LineTransformationOutputStream;\n+\n+/**\n+ * It transforms workflow metadata log messages through {@link WorkflowRunConsoleNote}.\n+ */\n+public class WorkflowMetadataConsoleFilter extends LineTransformationOutputStream {\n+\n+    private final OutputStream out;\n+\n+    public WorkflowMetadataConsoleFilter(OutputStream out) {\n+        this.out = out;\n+    }\n+\n+    @Override\n+    protected void eol(byte[] b, int len) throws IOException {\n+        new WorkflowRunConsoleNote().encodeTo(out);","path":"job/src/main/java/org/jenkinsci/plugins/workflow/job/console/WorkflowMetadataConsoleFilter.java","position":45,"original_position":45,"commit_id":"df501b674492ba6aeb5fded0a38391926c3e2b6d","original_commit_id":"df501b674492ba6aeb5fded0a38391926c3e2b6d","user":{"login":"tfennelly","id":429311,"avatar_url":"https://avatars.githubusercontent.com/u/429311?v=3","gravatar_id":"","url":"https://api.github.com/users/tfennelly","html_url":"https://github.com/tfennelly","followers_url":"https://api.github.com/users/tfennelly/followers","following_url":"https://api.github.com/users/tfennelly/following{/other_user}","gists_url":"https://api.github.com/users/tfennelly/gists{/gist_id}","starred_url":"https://api.github.com/users/tfennelly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tfennelly/subscriptions","organizations_url":"https://api.github.com/users/tfennelly/orgs","repos_url":"https://api.github.com/users/tfennelly/repos","events_url":"https://api.github.com/users/tfennelly/events{/privacy}","received_events_url":"https://api.github.com/users/tfennelly/received_events","type":"User","site_admin":false},"body":"Do you need to create a new `WorkflowRunConsoleNote` for each line? Would one per `WorkflowMetadataConsoleFilter` not work?","created_at":"2015-10-01T08:23:23Z","updated_at":"2015-10-01T08:23:23Z","html_url":"https://github.com/jenkinsci/workflow-plugin/pull/215#discussion_r40889116","pull_request_url":"https://api.github.com/repos/jenkinsci/workflow-plugin/pulls/215","_links":{"self":{"href":"https://api.github.com/repos/jenkinsci/workflow-plugin/pulls/comments/40889116"},"html":{"href":"https://github.com/jenkinsci/workflow-plugin/pull/215#discussion_r40889116"},"pull_request":{"href":"https://api.github.com/repos/jenkinsci/workflow-plugin/pulls/215"}}},"pull_request":{"url":"https://api.github.com/repos/jenkinsci/workflow-plugin/pulls/215","id":46196381,"html_url":"https://github.com/jenkinsci/workflow-plugin/pull/215","diff_url":"https://github.com/jenkinsci/workflow-plugin/pull/215.diff","patch_url":"https://github.com/jenkinsci/workflow-plugin/pull/215.patch","issue_url":"https://api.github.com/repos/jenkinsci/workflow-plugin/issues/215","number":215,"state":"open","locked":false,"title":"[JENKINS-30088] Clean up step display in logs","user":{"login":"amuniz","id":1017585,"avatar_url":"https://avatars.githubusercontent.com/u/1017585?v=3","gravatar_id":"","url":"https://api.github.com/users/amuniz","html_url":"https://github.com/amuniz","followers_url":"https://api.github.com/users/amuniz/followers","following_url":"https://api.github.com/users/amuniz/following{/other_user}","gists_url":"https://api.github.com/users/amuniz/gists{/gist_id}","starred_url":"https://api.github.com/users/amuniz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amuniz/subscriptions","organizations_url":"https://api.github.com/users/amuniz/orgs","repos_url":"https://api.github.com/users/amuniz/repos","events_url":"https://api.github.com/users/amuniz/events{/privacy}","received_events_url":"https://api.github.com/users/amuniz/received_events","type":"User","site_admin":false},"body":"[JENKINS-30088](https://issues.jenkins-ci.org/browse/JENKINS-30088)\r\nNote that the first point described in the JIRA issue is fixed in https://github.com/jenkinsci/workflow-plugin/pull/211 which is more focused on the Snippet Generator clean up.\r\n\r\nA screenshot showing how the logs are printed given the following script:\r\n\r\n```\r\nnode {\r\n  echo 'Starting!'\r\n  stage 'Checkout'\r\n  git 'https://github.com/amuniz/maven-helloworld.git'\r\n  stage 'Building'\r\n  sh 'uname -a'\r\n  ws('other-ws') {\r\n    echo 'This is another workspace'\r\n  }\r\n  stage 'Release'\r\n  echo 'Releasing...'\r\n}\r\n```\r\n\r\n<img width=\"1057\" alt=\"workflow-logs\" src=\"https://cloud.githubusercontent.com/assets/1017585/10145771/6d2b0ff4-6625-11e5-81b1-f24d8b58b0d4.png\">\r\n\r\nI'm not an UX expert, so any comment on how _metadata_ log lines and the _rest of the build log_ could live better together will be welcome!\r\n\r\n@reviewbybees ","created_at":"2015-09-28T19:18:19Z","updated_at":"2015-10-01T08:23:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bbce02d88cd6a4b2d53f0261089b575c7b310acf","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jenkinsci/workflow-plugin/pulls/215/commits","review_comments_url":"https://api.github.com/repos/jenkinsci/workflow-plugin/pulls/215/comments","review_comment_url":"https://api.github.com/repos/jenkinsci/workflow-plugin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jenkinsci/workflow-plugin/issues/215/comments","statuses_url":"https://api.github.com/repos/jenkinsci/workflow-plugin/statuses/df501b674492ba6aeb5fded0a38391926c3e2b6d","head":{"label":"amuniz:JENKINS-30088","ref":"JENKINS-30088","sha":"df501b674492ba6aeb5fded0a38391926c3e2b6d","user":{"login":"amuniz","id":1017585,"avatar_url":"https://avatars.githubusercontent.com/u/1017585?v=3","gravatar_id":"","url":"https://api.github.com/users/amuniz","html_url":"https://github.com/amuniz","followers_url":"https://api.github.com/users/amuniz/followers","following_url":"https://api.github.com/users/amuniz/following{/other_user}","gists_url":"https://api.github.com/users/amuniz/gists{/gist_id}","starred_url":"https://api.github.com/users/amuniz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amuniz/subscriptions","organizations_url":"https://api.github.com/users/amuniz/orgs","repos_url":"https://api.github.com/users/amuniz/repos","events_url":"https://api.github.com/users/amuniz/events{/privacy}","received_events_url":"https://api.github.com/users/amuniz/received_events","type":"User","site_admin":false},"repo":{"id":38357312,"name":"workflow-plugin","full_name":"amuniz/workflow-plugin","owner":{"login":"amuniz","id":1017585,"avatar_url":"https://avatars.githubusercontent.com/u/1017585?v=3","gravatar_id":"","url":"https://api.github.com/users/amuniz","html_url":"https://github.com/amuniz","followers_url":"https://api.github.com/users/amuniz/followers","following_url":"https://api.github.com/users/amuniz/following{/other_user}","gists_url":"https://api.github.com/users/amuniz/gists{/gist_id}","starred_url":"https://api.github.com/users/amuniz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amuniz/subscriptions","organizations_url":"https://api.github.com/users/amuniz/orgs","repos_url":"https://api.github.com/users/amuniz/repos","events_url":"https://api.github.com/users/amuniz/events{/privacy}","received_events_url":"https://api.github.com/users/amuniz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/amuniz/workflow-plugin","description":"Jenkins workflow plugin","fork":true,"url":"https://api.github.com/repos/amuniz/workflow-plugin","forks_url":"https://api.github.com/repos/amuniz/workflow-plugin/forks","keys_url":"https://api.github.com/repos/amuniz/workflow-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/amuniz/workflow-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/amuniz/workflow-plugin/teams","hooks_url":"https://api.github.com/repos/amuniz/workflow-plugin/hooks","issue_events_url":"https://api.github.com/repos/amuniz/workflow-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/amuniz/workflow-plugin/events","assignees_url":"https://api.github.com/repos/amuniz/workflow-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/amuniz/workflow-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/amuniz/workflow-plugin/tags","blobs_url":"https://api.github.com/repos/amuniz/workflow-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/amuniz/workflow-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/amuniz/workflow-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/amuniz/workflow-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/amuniz/workflow-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/amuniz/workflow-plugin/languages","stargazers_url":"https://api.github.com/repos/amuniz/workflow-plugin/stargazers","contributors_url":"https://api.github.com/repos/amuniz/workflow-plugin/contributors","subscribers_url":"https://api.github.com/repos/amuniz/workflow-plugin/subscribers","subscription_url":"https://api.github.com/repos/amuniz/workflow-plugin/subscription","commits_url":"https://api.github.com/repos/amuniz/workflow-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/amuniz/workflow-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/amuniz/workflow-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/amuniz/workflow-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/amuniz/workflow-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/amuniz/workflow-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/amuniz/workflow-plugin/merges","archive_url":"https://api.github.com/repos/amuniz/workflow-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/amuniz/workflow-plugin/downloads","issues_url":"https://api.github.com/repos/amuniz/workflow-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/amuniz/workflow-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/amuniz/workflow-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/amuniz/workflow-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/amuniz/workflow-plugin/labels{/name}","releases_url":"https://api.github.com/repos/amuniz/workflow-plugin/releases{/id}","created_at":"2015-07-01T07:47:44Z","updated_at":"2015-07-01T07:47:46Z","pushed_at":"2015-10-01T08:18:32Z","git_url":"git://github.com/amuniz/workflow-plugin.git","ssh_url":"git@github.com:amuniz/workflow-plugin.git","clone_url":"https://github.com/amuniz/workflow-plugin.git","svn_url":"https://github.com/amuniz/workflow-plugin","homepage":"https://wiki.jenkins-ci.org/display/JENKINS/Workflow+Plugin","size":4001,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jenkinsci:master","ref":"master","sha":"47f0fb752d20673550fc0e759dce48e45485dabf","user":{"login":"jenkinsci","id":107424,"avatar_url":"https://avatars.githubusercontent.com/u/107424?v=3","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"repo":{"id":19630847,"name":"workflow-plugin","full_name":"jenkinsci/workflow-plugin","owner":{"login":"jenkinsci","id":107424,"avatar_url":"https://avatars.githubusercontent.com/u/107424?v=3","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jenkinsci/workflow-plugin","description":"Jenkins workflow plugin","fork":false,"url":"https://api.github.com/repos/jenkinsci/workflow-plugin","forks_url":"https://api.github.com/repos/jenkinsci/workflow-plugin/forks","keys_url":"https://api.github.com/repos/jenkinsci/workflow-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jenkinsci/workflow-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jenkinsci/workflow-plugin/teams","hooks_url":"https://api.github.com/repos/jenkinsci/workflow-plugin/hooks","issue_events_url":"https://api.github.com/repos/jenkinsci/workflow-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/jenkinsci/workflow-plugin/events","assignees_url":"https://api.github.com/repos/jenkinsci/workflow-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/jenkinsci/workflow-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/jenkinsci/workflow-plugin/tags","blobs_url":"https://api.github.com/repos/jenkinsci/workflow-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jenkinsci/workflow-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jenkinsci/workflow-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/jenkinsci/workflow-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jenkinsci/workflow-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/jenkinsci/workflow-plugin/languages","stargazers_url":"https://api.github.com/repos/jenkinsci/workflow-plugin/stargazers","contributors_url":"https://api.github.com/repos/jenkinsci/workflow-plugin/contributors","subscribers_url":"https://api.github.com/repos/jenkinsci/workflow-plugin/subscribers","subscription_url":"https://api.github.com/repos/jenkinsci/workflow-plugin/subscription","commits_url":"https://api.github.com/repos/jenkinsci/workflow-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/jenkinsci/workflow-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/jenkinsci/workflow-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/jenkinsci/workflow-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/jenkinsci/workflow-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/jenkinsci/workflow-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jenkinsci/workflow-plugin/merges","archive_url":"https://api.github.com/repos/jenkinsci/workflow-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jenkinsci/workflow-plugin/downloads","issues_url":"https://api.github.com/repos/jenkinsci/workflow-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/jenkinsci/workflow-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/jenkinsci/workflow-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/jenkinsci/workflow-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jenkinsci/workflow-plugin/labels{/name}","releases_url":"https://api.github.com/repos/jenkinsci/workflow-plugin/releases{/id}","created_at":"2014-05-10T01:47:09Z","updated_at":"2015-10-01T07:58:49Z","pushed_at":"2015-10-01T08:18:33Z","git_url":"git://github.com/jenkinsci/workflow-plugin.git","ssh_url":"git@github.com:jenkinsci/workflow-plugin.git","clone_url":"https://github.com/jenkinsci/workflow-plugin.git","svn_url":"https://github.com/jenkinsci/workflow-plugin","homepage":"https://wiki.jenkins-ci.org/display/JENKINS/Workflow+Plugin","size":8755,"stargazers_count":400,"watchers_count":400,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":110,"mirror_url":null,"open_issues_count":9,"forks":110,"open_issues":9,"watchers":400,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jenkinsci/workflow-plugin/pulls/215"},"html":{"href":"https://github.com/jenkinsci/workflow-plugin/pull/215"},"issue":{"href":"https://api.github.com/repos/jenkinsci/workflow-plugin/issues/215"},"comments":{"href":"https://api.github.com/repos/jenkinsci/workflow-plugin/issues/215/comments"},"review_comments":{"href":"https://api.github.com/repos/jenkinsci/workflow-plugin/pulls/215/comments"},"review_comment":{"href":"https://api.github.com/repos/jenkinsci/workflow-plugin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jenkinsci/workflow-plugin/pulls/215/commits"},"statuses":{"href":"https://api.github.com/repos/jenkinsci/workflow-plugin/statuses/df501b674492ba6aeb5fded0a38391926c3e2b6d"}}}}