{"action":"created","issue":{"url":"https://api.github.com/repos/tomasbjerre/violation-comments-to-gitlab-lib/issues/6","repository_url":"https://api.github.com/repos/tomasbjerre/violation-comments-to-gitlab-lib","labels_url":"https://api.github.com/repos/tomasbjerre/violation-comments-to-gitlab-lib/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/tomasbjerre/violation-comments-to-gitlab-lib/issues/6/comments","events_url":"https://api.github.com/repos/tomasbjerre/violation-comments-to-gitlab-lib/issues/6/events","html_url":"https://github.com/tomasbjerre/violation-comments-to-gitlab-lib/issues/6","id":355252309,"node_id":"MDU6SXNzdWUzNTUyNTIzMDk=","number":6,"title":"Comment doesn't appear after build ","user":{"login":"AlexStasko","id":22001795,"node_id":"MDQ6VXNlcjIyMDAxNzk1","avatar_url":"https://avatars2.githubusercontent.com/u/22001795?v=4","gravatar_id":"","url":"https://api.github.com/users/AlexStasko","html_url":"https://github.com/AlexStasko","followers_url":"https://api.github.com/users/AlexStasko/followers","following_url":"https://api.github.com/users/AlexStasko/following{/other_user}","gists_url":"https://api.github.com/users/AlexStasko/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexStasko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexStasko/subscriptions","organizations_url":"https://api.github.com/users/AlexStasko/orgs","repos_url":"https://api.github.com/users/AlexStasko/repos","events_url":"https://api.github.com/users/AlexStasko/events{/privacy}","received_events_url":"https://api.github.com/users/AlexStasko/received_events","type":"User","site_admin":false},"labels":[{"id":542859470,"node_id":"MDU6TGFiZWw1NDI4NTk0NzA=","url":"https://api.github.com/repos/tomasbjerre/violation-comments-to-gitlab-lib/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-08-29T17:05:24Z","updated_at":"2018-08-29T22:39:22Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\n\r\nI've started using Jenkins pipelines and I need to send violations to GitLab MRs.\r\nI use scripted pipeline to make pre-merge build.\r\n\r\nAfter running my Gradle tasks I use following snippet from Snippet Generator:\r\n```\r\nViolationsToGitLab([\r\n    apiToken: 'private-token',\r\n    apiTokenPrivate: true,\r\n    authMethodHeader: true,\r\n    createCommentWithAllSingleFileComments: false,\r\n    gitLabUrl: 'https://my-gitlab.com',\r\n    ignoreCertificateErrors: true,\r\n    keepOldComments: true,\r\n    shouldSetWip: true,\r\n    mergeRequestIid: \"${env.gitlabMergeRequestIid}\",\r\n    projectId: \"${env.gitlabMergeRequestTargetProjectId}\",\r\n    commentTemplate: '',\r\n    violationConfigs: [\r\n        [parser: 'CHECKSTYLE', pattern: '.*/reports/checkstyle/.*\\\\.xml', reporter: 'CHECKSTYLE'],\r\n        [parser: 'FINDBUGS', pattern: '.*/reports/findbugs/.*\\\\.xml', reporter: 'FINDBUGS'],\r\n        [parser: 'PMD', pattern: '.*/reports/pmd/.*\\\\.xml', reporter: 'PMD']\r\n    ]])\r\n```\r\nThere's logs from job:\r\n```\r\n---\r\n--- Violation Comments to GitLab ---\r\n---\r\ngitLabUrl: https://my-gitlab.com\r\nprojectId: 39\r\nmergeRequestIid: 103\r\napiToken: true\r\napiTokenCredentialsId: false\r\nignoreCertificateErrors: true\r\napiTokenPrivate: true\r\nauthMethodHeader: true\r\ncreateCommentWithAllSingleFileComments: false\r\ncommentOnlyChangedContent: false\r\nminSeverity: INFO\r\nkeepOldComments: true\r\nshouldSetWip: true\r\ncommentTemplate: \r\n**Reporter**: {{violation.reporter}}{{#violation.rule}}\r\n\r\n**Rule**: {{violation.rule}}{{/violation.rule}}\r\n**Severity**: {{violation.severity}}\r\n**File**: {{violation.file}} L{{violation.startLine}}{{#violation.source}}\r\n\r\n**Source**: {{violation.source}}{{/violation.source}}\r\n\r\n{{violation.message}}\r\n\r\nCHECKSTYLE with pattern .*/reports/checkstyle/.*\\.xml\r\nFINDBUGS with pattern .*/reports/findbugs/.*\\.xml\r\nPMD with pattern .*/reports/pmd/.*\\.xml\r\nRunning Violation Comments To GitLab\r\nMerge request: 103\r\nWorkspace: /home/jenkins/workspace/test-pre-merge-java\r\nFound 0 violations from ViolationConfig [pattern=.*/reports/checkstyle/.*\\.xml, parser=CHECKSTYLE, reporter=CHECKSTYLE].\r\nFound 1 violations from ViolationConfig [pattern=.*/reports/findbugs/.*\\.xml, parser=FINDBUGS, reporter=FINDBUGS].\r\nFound 0 violations from ViolationConfig [pattern=.*/reports/pmd/.*\\.xml, parser=PMD, reporter=PMD].\r\nWill comment PR https://my-gitlab.com 39 103\r\n```\r\n\r\nBut no comment in my MR.\r\nAlso I've tried use Post-build action in freestyle job, but with no luck.\r\nThe same with your example [here](https://wiki.jenkins.io/display/JENKINS/Violation+Comments+to+GitLab+Plugin):\r\n```\r\nstep([\r\n    $class: 'ViolationsToGitLabRecorder',\r\n    config: [\r\n         gitLabUrl: 'https://my-gitlab.com',\r\n         projectId: env.gitlabMergeRequestTargetProjectId,\r\n         mergeRequestIid: env.gitlabMergeRequestIid,\r\n         commentOnlyChangedContent: true,\r\n         createCommentWithAllSingleFileComments: true,\r\n         minSeverity: 'INFO',\r\n         apiToken: 'private-token',\r\n         apiTokenPrivate: true,\r\n         authMethodHeader: true,\r\n         ignoreCertificateErrors: true,\r\n         keepOldComments: false,\r\n         shouldSetWip: false,\r\n         violationConfigs: [\r\n             [parser: 'CHECKSTYLE', pattern: '.*/reports/checkstyle/.*\\\\.xml', reporter: 'CHECKSTYLE'],\r\n             [parser: 'FINDBUGS', pattern: '.*/reports/findbugs/.*\\\\.xml', reporter: 'FINDBUGS'],\r\n             [parser: 'PMD', pattern: '.*/reports/pmd/.*\\\\.xml', reporter: 'PMD']\r\n         ]\r\n     ]\r\n])\r\n```\r\n\r\nI'm using\r\nJenkins: 2.121.3\r\nViolation Comments to GitLab Plugin: 2.2\r\n\r\nCould you say me whether it's a bug or miss-configuration?\r\n\r\nThanks,\r\nAlex"},"comment":{"url":"https://api.github.com/repos/tomasbjerre/violation-comments-to-gitlab-lib/issues/comments/417130016","html_url":"https://github.com/tomasbjerre/violation-comments-to-gitlab-lib/issues/6#issuecomment-417130016","issue_url":"https://api.github.com/repos/tomasbjerre/violation-comments-to-gitlab-lib/issues/6","id":417130016,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNzEzMDAxNg==","user":{"login":"AlexStasko","id":22001795,"node_id":"MDQ6VXNlcjIyMDAxNzk1","avatar_url":"https://avatars2.githubusercontent.com/u/22001795?v=4","gravatar_id":"","url":"https://api.github.com/users/AlexStasko","html_url":"https://github.com/AlexStasko","followers_url":"https://api.github.com/users/AlexStasko/followers","following_url":"https://api.github.com/users/AlexStasko/following{/other_user}","gists_url":"https://api.github.com/users/AlexStasko/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexStasko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexStasko/subscriptions","organizations_url":"https://api.github.com/users/AlexStasko/orgs","repos_url":"https://api.github.com/users/AlexStasko/repos","events_url":"https://api.github.com/users/AlexStasko/events{/privacy}","received_events_url":"https://api.github.com/users/AlexStasko/received_events","type":"User","site_admin":false},"created_at":"2018-08-29T22:39:22Z","updated_at":"2018-08-29T22:39:22Z","author_association":"NONE","body":"I'm sorry for confusing, I've just played with settings, that is why differences between snippets.\r\n\r\nIn general I use `createCommentWithAllSingleFileComments=true` and `commentOnlyChangedContent=false`\r\n\r\nI use GitLab 11.1.0-ee (9a9f41d) on my server in AWS.\r\nJenkins is based on Kubernetes.\r\n\r\nJenkins logs:\r\n```\r\nAug 29, 2018 10:26:58 PM INFO com.dabsquared.gitlabjenkins.webhook.GitLabWebHook getDynamic\r\nWebHook called with url: /project/test-pre-merge-java\r\nAug 29, 2018 10:26:58 PM INFO com.dabsquared.gitlabjenkins.trigger.handler.AbstractWebHookTriggerHandler handle\r\ntest-pre-merge-java triggered for merge request.\r\nAug 29, 2018 10:27:05 PM INFO com.dabsquared.gitlabjenkins.util.CommitStatusUpdater retrieveGitlabProjectIds\r\nRetrieving gitlab project ids\r\nAug 29, 2018 10:27:11 PM INFO org.csanchez.jenkins.plugins.kubernetes.KubernetesCloud provision\r\nExcess workload after pending Kubernetes agents: 1\r\nAug 29, 2018 10:27:11 PM INFO org.csanchez.jenkins.plugins.kubernetes.KubernetesCloud provision\r\nTemplate: Kubernetes Pod Template\r\nAug 29, 2018 10:27:11 PM INFO okhttp3.internal.platform.Platform log\r\nALPN callback dropped: HTTP/2 is disabled. Is alpn-boot on the boot class path?\r\nAug 29, 2018 10:27:11 PM INFO hudson.slaves.NodeProvisioner$StandardStrategyImpl apply\r\nStarted provisioning Kubernetes Pod Template from kubernetes with 1 executors. Remaining excess workload: 0\r\nAug 29, 2018 10:27:21 PM INFO hudson.slaves.NodeProvisioner$2 run\r\nKubernetes Pod Template provisioning successfully completed. We have now 2 computer(s)\r\nAug 29, 2018 10:27:21 PM INFO okhttp3.internal.platform.Platform log\r\nALPN callback dropped: HTTP/2 is disabled. Is alpn-boot on the boot class path?\r\nAug 29, 2018 10:27:21 PM INFO org.csanchez.jenkins.plugins.kubernetes.KubernetesLauncher launch\r\nCreated Pod: jenkins-slave-md1bn-r528w in namespace default\r\nAug 29, 2018 10:27:21 PM INFO org.csanchez.jenkins.plugins.kubernetes.KubernetesLauncher launch\r\nWaiting for Pod to be scheduled (0/100): jenkins-slave-md1bn-r528w\r\nAug 29, 2018 10:27:23 PM INFO hudson.TcpSlaveAgentListener$ConnectionHandler run\r\nAccepted JNLP4-connect connection #152 from ip-172-20-185-51.ec2.internal/172.20.185.51:48014\r\nAug 29, 2018 10:27:41 PM INFO hudson.plugins.git.GitSCM guessBrowser\r\nMultiple browser guess matches for [org.eclipse.jgit.transport.RemoteConfig@12a6d113, org.eclipse.jgit.transport.RemoteConfig@6eea8f15]\r\nAug 29, 2018 10:27:42 PM INFO okhttp3.internal.platform.Platform log\r\nALPN callback dropped: HTTP/2 is disabled. Is alpn-boot on the boot class path?\r\nAug 29, 2018 10:27:42 PM INFO okhttp3.internal.platform.Platform log\r\nALPN callback dropped: HTTP/2 is disabled. Is alpn-boot on the boot class path?\r\nAug 29, 2018 10:27:48 PM INFO org.csanchez.jenkins.plugins.kubernetes.pipeline.ContainerExecDecorator$1 doLaunch\r\nCreated process inside pod: [jenkins-slave-md1bn-r528w], container: [gradle] with pid:[-1]\r\nAug 29, 2018 10:29:20 PM INFO com.dabsquared.gitlabjenkins.webhook.GitLabWebHook getDynamic\r\nWebHook called with url: /project/test-pre-merge-java\r\nAug 29, 2018 10:30:36 PM INFO com.dabsquared.gitlabjenkins.util.CommitStatusUpdater retrieveGitlabProjectIds\r\nRetrieving gitlab project ids\r\nAug 29, 2018 10:30:36 PM INFO org.csanchez.jenkins.plugins.kubernetes.KubernetesSlave _terminate\r\nTerminating Kubernetes instance for agent jenkins-slave-md1bn-r528w\r\nAug 29, 2018 10:30:36 PM INFO org.csanchez.jenkins.plugins.kubernetes.pipeline.PodTemplateStepExecution$PodTemplateCallback finished\r\nRemoving pod template jenkins-slave-md1bn from cloud kubernetes\r\nAug 29, 2018 10:30:36 PM INFO okhttp3.internal.platform.Platform log\r\nALPN callback dropped: HTTP/2 is disabled. Is alpn-boot on the boot class path?\r\nAug 29, 2018 10:30:36 PM INFO org.jenkinsci.plugins.workflow.job.WorkflowRun finish\r\ntest-pre-merge-java #28 completed: SUCCESS\r\nAug 29, 2018 10:30:36 PM WARNING jenkins.slaves.DefaultJnlpSlaveReceiver channelClosed\r\nComputer.threadPoolForRemoting [#4820] for jenkins-slave-md1bn-r528w terminated\r\njava.nio.channels.ClosedChannelException\r\n\tat org.jenkinsci.remoting.protocol.impl.ChannelApplicationLayer.onReadClosed(ChannelApplicationLayer.java:209)\r\n\tat org.jenkinsci.remoting.protocol.ApplicationLayer.onRecvClosed(ApplicationLayer.java:222)\r\n\tat org.jenkinsci.remoting.protocol.ProtocolStack$Ptr.onRecvClosed(ProtocolStack.java:832)\r\n\tat org.jenkinsci.remoting.protocol.FilterLayer.onRecvClosed(FilterLayer.java:287)\r\n\tat org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.onRecvClosed(SSLEngineFilterLayer.java:181)\r\n\tat org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.switchToNoSecure(SSLEngineFilterLayer.java:283)\r\n\tat org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.processWrite(SSLEngineFilterLayer.java:503)\r\n\tat org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.processQueuedWrites(SSLEngineFilterLayer.java:248)\r\n\tat org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.doSend(SSLEngineFilterLayer.java:200)\r\n\tat org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.doCloseSend(SSLEngineFilterLayer.java:213)\r\n\tat org.jenkinsci.remoting.protocol.ProtocolStack$Ptr.doCloseSend(ProtocolStack.java:800)\r\n\tat org.jenkinsci.remoting.protocol.ApplicationLayer.doCloseWrite(ApplicationLayer.java:173)\r\n\tat org.jenkinsci.remoting.protocol.impl.ChannelApplicationLayer$ByteBufferCommandTransport.closeWrite(ChannelApplicationLayer.java:314)\r\n\tat hudson.remoting.Channel.close(Channel.java:1450)\r\n\tat hudson.remoting.Channel.close(Channel.java:1403)\r\n\tat hudson.slaves.SlaveComputer.closeChannel(SlaveComputer.java:799)\r\n\tat hudson.slaves.SlaveComputer.access$800(SlaveComputer.java:103)\r\n\tat hudson.slaves.SlaveComputer$3.run(SlaveComputer.java:715)\r\n\tat jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)\r\n\tat jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)\r\n\tat java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)\r\n\tat java.util.concurrent.FutureTask.run(FutureTask.java:266)\r\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\r\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\r\n\tat java.lang.Thread.run(Thread.java:748)\r\n\r\nAug 29, 2018 10:30:36 PM INFO org.csanchez.jenkins.plugins.kubernetes.KubernetesSlave deleteSlavePod\r\nTerminated Kubernetes instance for agent default/jenkins-slave-md1bn-r528w\r\nAug 29, 2018 10:30:36 PM INFO org.csanchez.jenkins.plugins.kubernetes.KubernetesSlave _terminate\r\nDisconnected computer jenkins-slave-md1bn-r528w\r\n```\r\n"}}
{"actor":{"display_login":"AlexStasko"}}