Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-64862

After installing Git Forensic plugin , Warnings NG step is taking long time

      After installing the git forensics plugin, the warnings ng step is taking more than one hour and getting timed out.

      Git Forensic step:
      discoverGitReferenceBuild referenceJob: "in-community-pipeline/master", latestBuildIfNotFound: true, maxCommits: 150, skipUnknownCommits: true

      Output:

      [2021-02-12T20:15:50.181Z] [ReferenceFinder] Configured reference job: 'in-community-pipeline/master'
      [2021-02-12T20:15:50.181Z] [ReferenceFinder] No reference build found that contains matching commits
      [2021-02-12T20:15:50.181Z] [ReferenceFinder] Falling back to latest build of reference job: '1619-deploy/2021-02-09'

      Warnings NG step:

      recordIssues(enabledForFailure: true, tools: [phpCodeSniffer(id: 'phpcs-community', name: 'PHP code sniffer community platform', pattern: 'build/logs/php-checkstyle*.xml')])

       

      Output:

       [2021-02-12T20:17:22.497Z] [PHP code sniffer community platform] Searching for all files in '/var/lib/jenkins/workspace/mmunity-pipeline_dev_sharedtest1' that match the pattern 'build/logs/php-checkstyle*.xml'
      [2021-02-12T20:17:22.497Z] [PHP code sniffer community platform] -> found 1 file
      [2021-02-12T20:17:22.497Z] [PHP code sniffer community platform] Successfully parsed file /var/lib/jenkins/workspace/mmunity-pipeline_dev_sharedtest1/build/logs/php-checkstyle.xml
      [2021-02-12T20:17:22.497Z] [PHP code sniffer community platform] -> found 20297 issues (skipped 0 duplicates)
      [2021-02-12T20:17:22.503Z] The recommended git tool is: NONE
      [2021-02-12T20:17:22.515Z] using credential github-internations-jenkins
      [2021-02-12T20:17:22.562Z] The recommended git tool is: NONE
      [2021-02-12T20:17:22.571Z] using credential github-internations-jenkins
      [2021-02-12T20:17:22.538Z] > git rev-parse HEAD^{commit} # timeout=10
      [2021-02-12T20:19:51.167Z] > git rev-parse HEAD^{commit} # timeout=10

       

      At this point its run for more than 70 mins, then we have timeout set, so its exiting.

          [JENKINS-64862] After installing Git Forensic plugin , Warnings NG step is taking long time

          Ulli Hafner added a comment - - edited

          With so many issues it makes no sense to compute the blames. I would suggest to disable blaming with the option skipBlames: https://github.com/jenkinsci/warnings-ng-plugin/blob/master/doc/Documentation.md#source-code-blames-for-git-projects

          Ulli Hafner added a comment - - edited With so many issues it makes no sense to compute the blames. I would suggest to disable blaming with the option skipBlames : https://github.com/jenkinsci/warnings-ng-plugin/blob/master/doc/Documentation.md#source-code-blames-for-git-projects

          Kalle Niemitalo added a comment - - edited

          I too have switched blames off in some pipelines, to speed up the builds.

          From the source code, it appears that GitBlamer already runs only one blame command per file even if that file has many warnings, so I think the time will depend more on the number, size, and history of affected files, than on the number of warnings.

          If some of the warnings are for files that have not been modified at all after a previous build, then it might be feasible to copy the blame results from that build and avoid comparing older blobs in Git history. However, this would still risk excessive build times if the plug-in does not find a previous build.

          Kalle Niemitalo added a comment - - edited I too have switched blames off in some pipelines, to speed up the builds. From the source code, it appears that GitBlamer already runs only one blame command per file even if that file has many warnings, so I think the time will depend more on the number, size, and history of affected files, than on the number of warnings. If some of the warnings are for files that have not been modified at all after a previous build, then it might be feasible to copy the blame results from that build and avoid comparing older blobs in Git history. However, this would still risk excessive build times if the plug-in does not find a previous build.

          Another idea. Warnings NG could have an internal timeout, e.g. five minutes. If blaming takes longer than that, then let it keep going but write a reminder about skipBlames to the log.

          Kalle Niemitalo added a comment - Another idea. Warnings NG could have an internal timeout, e.g. five minutes. If blaming takes longer than that, then let it keep going but write a reminder about skipBlames to the log.

            drulli Ulli Hafner
            whitewolf123 Gourav Pattnaik
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: