• 5.0.0-beta2

      It would be great if the SCM would be queried for the reference build. If the builds are not in order (e.g. because the build are triggered by code review (e.g. Gerrit)), it doesn't make sense to use the last build as reference. The SCM (e.g. Git) or the Trigger (e.g. Gerrit) would know the previous commit which should be used as reference.

          [JENKINS-13056] Obtain reference build from SCM/Trigger

          Ulli Hafner added a comment - - edited

          Actually nobody is working on this issue up to now. As I understood the discussion above it will be quite hard (or impossible) to provide a solution that works for all use cases.

          Are you using a pipeline in your jobs? Maybe the planned pipeline features let you provide your own implementation as part of the pipeline script...

          Ulli Hafner added a comment - - edited Actually nobody is working on this issue up to now. As I understood the discussion above it will be quite hard (or impossible ) to provide a solution that works for all use cases. Are you using a pipeline in your jobs? Maybe the planned pipeline features let you provide your own implementation as part of the pipeline script...

          mirza zeyrek added a comment -

          chantivlad drulli

          I ended up creating another job called warning-count-syncher. It contains a simple script based on casperjs.

          After each successful commit to master, it gets the warning counts from latest successful build and sets it for PR job and master. I know it's a bit nasty but it does the job and works stable %99.9  of the cases.

          You can take a look at it from here:

          https://github.com/mirzazeyrek/jenkins-warning-count-synchronizer

          mirza zeyrek added a comment - chantivlad drulli I ended up creating another job called warning-count-syncher. It contains a simple script based on casperjs. After each successful commit to master, it gets the warning counts from latest successful build and sets it for PR job and master. I know it's a bit nasty but it does the job and works stable %99.9  of the cases. You can take a look at it from here: https://github.com/mirzazeyrek/jenkins-warning-count-synchronizer

          Any updates on this? It would be nice to get at least a feature mentioned by chantivlad:

           "For reference, take last stable build of Job: " .

          This doesn't sound like a big change, but it looks it would solve the problem for many users.

          Michał Rapacz added a comment - Any updates on this? It would be nice to get at least a feature mentioned by chantivlad :  "For reference, take last stable build of Job: " . This doesn't sound like a big change, but it looks it would solve the problem for many users.

          I totally agree with the previous suggestion.  Having a feature that allows you to reference another Jenkins job to compare against is all that's really needed to address the issue that usually happens when you have a Pull Request build.

          Mark DeMichele added a comment - I totally agree with the previous suggestion.  Having a feature that allows you to reference another Jenkins job to compare against is all that's really needed to address the issue that usually happens when you have a Pull Request build.

          Ulli Hafner added a comment -

          Ok, I will add this kind of reference selection to the new pipeline API. Is the reference 'job' sufficient? Or should also the build number of the other job be a variable?

          Ulli Hafner added a comment - Ok, I will add this kind of reference selection to the new pipeline API. Is the reference 'job' sufficient? Or should also the build number of the other job be a variable?

          mirza zeyrek added a comment - - edited

          Latest stable build from another job would be ok for now

          But It would be nice to have something compatible with multi branch pipeline; being able to choose from:
          1- (different or same) multi branch pipeline job
          2- choosing branch from it and getting latest stable build as reference.

          drulli 

          mirza zeyrek added a comment - - edited Latest stable build from another job would be ok for now But It would be nice to have something compatible with multi branch pipeline; being able to choose from: 1- (different or same) multi branch pipeline job 2- choosing branch from it and getting latest stable build as reference. drulli  

          Code changed in jenkins
          User: Ulli Hafner
          Path:
          src/main/java/io/jenkins/plugins/analysis/core/JenkinsFacade.java
          src/main/java/io/jenkins/plugins/analysis/core/graphs/AnnotationsByUserGraph.java
          src/main/java/io/jenkins/plugins/analysis/core/history/BuildHistory.java
          src/main/java/io/jenkins/plugins/analysis/core/history/OtherJobReferenceFinder.java
          src/main/java/io/jenkins/plugins/analysis/core/history/ReferenceFinder.java
          src/main/java/io/jenkins/plugins/analysis/core/history/ReferenceProvider.java
          src/main/java/io/jenkins/plugins/analysis/core/history/ResultHistory.java
          src/main/java/io/jenkins/plugins/analysis/core/model/AnalysisResult.java
          src/main/java/io/jenkins/plugins/analysis/core/model/StaticAnalysisLabelProvider.java
          src/main/java/io/jenkins/plugins/analysis/core/model/Summary.java
          src/main/java/io/jenkins/plugins/analysis/core/steps/AnalysisExecution.java
          src/main/java/io/jenkins/plugins/analysis/core/steps/PublishIssuesStep.java
          src/main/java/io/jenkins/plugins/analysis/core/steps/ScanForIssuesStep.java
          src/main/resources/io/jenkins/plugins/analysis/core/model/Messages.properties
          src/main/resources/io/jenkins/plugins/analysis/core/views/InfoErrorDetail/index.jelly
          src/main/resources/io/jenkins/plugins/analysis/core/views/IssuesDetail/index.jelly
          src/test/java/io/jenkins/plugins/analysis/core/history/OtherJobReferenceFinderTest.java
          src/test/java/io/jenkins/plugins/analysis/core/model/SummaryTest.java
          http://jenkins-ci.org/commit/analysis-core-plugin/3429aead0352f32c2b2c2114bd868e2a8a110dcf
          Log:
          JENKINS-13056JENKINS-31812 Added option to specify a reference job.

          The reference results will now be obtained either
          a) from the current job
          b) from a specified reference job (given by the name)

          The reference job will be selected using the properties:

          • ignoreAnalysisResult: ignores the result of the previous analysis run
          • overallResultMustBeSuccess: picks only builds with overall SUCCESS

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ulli Hafner Path: src/main/java/io/jenkins/plugins/analysis/core/JenkinsFacade.java src/main/java/io/jenkins/plugins/analysis/core/graphs/AnnotationsByUserGraph.java src/main/java/io/jenkins/plugins/analysis/core/history/BuildHistory.java src/main/java/io/jenkins/plugins/analysis/core/history/OtherJobReferenceFinder.java src/main/java/io/jenkins/plugins/analysis/core/history/ReferenceFinder.java src/main/java/io/jenkins/plugins/analysis/core/history/ReferenceProvider.java src/main/java/io/jenkins/plugins/analysis/core/history/ResultHistory.java src/main/java/io/jenkins/plugins/analysis/core/model/AnalysisResult.java src/main/java/io/jenkins/plugins/analysis/core/model/StaticAnalysisLabelProvider.java src/main/java/io/jenkins/plugins/analysis/core/model/Summary.java src/main/java/io/jenkins/plugins/analysis/core/steps/AnalysisExecution.java src/main/java/io/jenkins/plugins/analysis/core/steps/PublishIssuesStep.java src/main/java/io/jenkins/plugins/analysis/core/steps/ScanForIssuesStep.java src/main/resources/io/jenkins/plugins/analysis/core/model/Messages.properties src/main/resources/io/jenkins/plugins/analysis/core/views/InfoErrorDetail/index.jelly src/main/resources/io/jenkins/plugins/analysis/core/views/IssuesDetail/index.jelly src/test/java/io/jenkins/plugins/analysis/core/history/OtherJobReferenceFinderTest.java src/test/java/io/jenkins/plugins/analysis/core/model/SummaryTest.java http://jenkins-ci.org/commit/analysis-core-plugin/3429aead0352f32c2b2c2114bd868e2a8a110dcf Log: JENKINS-13056 JENKINS-31812 Added option to specify a reference job. The reference results will now be obtained either a) from the current job b) from a specified reference job (given by the name) The reference job will be selected using the properties: ignoreAnalysisResult: ignores the result of the previous analysis run overallResultMustBeSuccess: picks only builds with overall SUCCESS

          Code changed in jenkins
          User: Ulli Hafner
          Path:
          src/test/java/io/jenkins/plugins/analysis/warnings/PipelineITest.java
          src/test/java/io/jenkins/plugins/analysis/warnings/StepsITest.java
          src/test/resources/io/jenkins/plugins/analysis/warnings/java-start.txt
          http://jenkins-ci.org/commit/warnings-plugin/3c64ac6c68b433e3f3b4e960e02a99c414223b31
          Log:
          JENKINS-13056JENKINS-31812 Added option to specify a reference job.

          The reference results will now be obtained either
          a) from the current job
          b) from a specified reference job (given by the name)

          The reference job will be selected using the properties:

          • ignoreAnalysisResult: ignores the result of the previous analysis run
          • overallResultMustBeSuccess: picks only builds with overall SUCCESS

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ulli Hafner Path: src/test/java/io/jenkins/plugins/analysis/warnings/PipelineITest.java src/test/java/io/jenkins/plugins/analysis/warnings/StepsITest.java src/test/resources/io/jenkins/plugins/analysis/warnings/java-start.txt http://jenkins-ci.org/commit/warnings-plugin/3c64ac6c68b433e3f3b4e960e02a99c414223b31 Log: JENKINS-13056 JENKINS-31812 Added option to specify a reference job. The reference results will now be obtained either a) from the current job b) from a specified reference job (given by the name) The reference job will be selected using the properties: ignoreAnalysisResult: ignores the result of the previous analysis run overallResultMustBeSuccess: picks only builds with overall SUCCESS

          Ulli Hafner added a comment -

          Partly fixed by making the reference build configurable.

          Ulli Hafner added a comment - Partly fixed by making the reference build configurable.

          Ulli Hafner added a comment -

          Released in 5.0.0-beta2.

          Ulli Hafner added a comment - Released in 5.0.0-beta2.

            drulli Ulli Hafner
            rschulz Roland Schulz
            Votes:
            9 Vote for this issue
            Watchers:
            16 Start watching this issue

              Created:
              Updated:
              Resolved: