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

Should have option to not care about build failure status

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • sloccount-plugin
    • None
    • windows 7

      most times a build is declared failed, its about compilation issues, or health thresholds or simple scripting error status.

      so most times, it has nothing to do with sloc.

      the problem is that the failed build has no sloc summary data in the build.xml (it doesn't even coast from the previous non-failed build).

      Can be addressed many options
      0 - ignore failure state of build
      1 - have an ignore failed build status option (many other publisher plugins have this
      2 - if can't ignore fail status, at least coast the data from last non failed build

      in general, suggest that unless there was a path issues (sloc count file doesn't exist) the results should always be published

          [JENKINS-22303] Should have option to not care about build failure status

          Michal Turek added a comment -

          I'm not sure if such feature can be useful. How do you call the SLOCCount tool, before or after the build? I'm using most often:

          • Execute sloccount as part of make for C++ and Python projects (e.g. 'make build sloccount').
          • Execute sloccount as part of ant for Java projects (e.g. 'ant build sloccount').
          • Execute sloccount inside Jenkins (shell build action) AFTER the code is built.

          In all three cases the sloccount command won't be executed and sloccount.sc file generated if the build fails. Make, Ant and shell (in Jenkins) most often stops the processing on first error. So processing the non-existent or outdated sloccount.sc data is not reasonable.

          0 - ignore failure state of build
          -> Yes, this is possible, but you have to somehow satisfy that sloccount.sc contains valid data. E.g. generate it after checkout and before the build - does anyone do that?

          1 - have an ignore failed build status option (many other publisher plugins have this
          -> Exactly the same as 0 above.

          2 - if can't ignore fail status, at least coast the data from last non failed build
          -> Why? No information is added anywhere if we copy the data. The plugin already skips the failed builds if e.g. compares current and previous results.

          To be honest I don't see this feature much useful, but let's discuss...

          Michal Turek added a comment - I'm not sure if such feature can be useful. How do you call the SLOCCount tool, before or after the build? I'm using most often: Execute sloccount as part of make for C++ and Python projects (e.g. 'make build sloccount'). Execute sloccount as part of ant for Java projects (e.g. 'ant build sloccount'). Execute sloccount inside Jenkins (shell build action) AFTER the code is built. In all three cases the sloccount command won't be executed and sloccount.sc file generated if the build fails. Make, Ant and shell (in Jenkins) most often stops the processing on first error. So processing the non-existent or outdated sloccount.sc data is not reasonable. 0 - ignore failure state of build -> Yes, this is possible, but you have to somehow satisfy that sloccount.sc contains valid data. E.g. generate it after checkout and before the build - does anyone do that? 1 - have an ignore failed build status option (many other publisher plugins have this -> Exactly the same as 0 above. 2 - if can't ignore fail status, at least coast the data from last non failed build -> Why? No information is added anywhere if we copy the data. The plugin already skips the failed builds if e.g. compares current and previous results. To be honest I don't see this feature much useful, but let's discuss...

          So.

          We aren't using a big honking make in a single build step.

          We have many individual build steps that run typically single tool focused shell scripts.

          Most of those are 'quality' scripts that are running code through various tools, and collecting data for warnings parsers.

          We are attempting to use health thresh holding with static analysis to get extra attention when the mountain of technical debt grows (a containment strategy).

          Since we are a big institution, nothing is resolved quickly, so sometimes jobs remain in that attention getting state for a long while (weeks to quarters), even if development of new capabilities is active in the code base that job is monitoring. Not my call. I'm just the CI tool smith, not the prioritization/funding/process manager.

          Typically, an actual compile or script fault occurs < 1% of the time, but a build 'quality' health thresh hold breach is > 99% of why we have builds marked failed.

          Thus, we would like SLOCCount to able to be configured to run regardless of build health.

          Greg Moncreaff added a comment - So. We aren't using a big honking make in a single build step. We have many individual build steps that run typically single tool focused shell scripts. Most of those are 'quality' scripts that are running code through various tools, and collecting data for warnings parsers. We are attempting to use health thresh holding with static analysis to get extra attention when the mountain of technical debt grows (a containment strategy). Since we are a big institution, nothing is resolved quickly, so sometimes jobs remain in that attention getting state for a long while (weeks to quarters), even if development of new capabilities is active in the code base that job is monitoring. Not my call. I'm just the CI tool smith, not the prioritization/funding/process manager. Typically, an actual compile or script fault occurs < 1% of the time, but a build 'quality' health thresh hold breach is > 99% of why we have builds marked failed. Thus, we would like SLOCCount to able to be configured to run regardless of build health.

          Michal Turek added a comment -

          Ok, I will look at it.

          Michal Turek added a comment - Ok, I will look at it.

          Code changed in jenkins
          User: Michal Turek
          Path:
          src/main/java/hudson/plugins/sloccount/SloccountPublisher.java
          src/main/resources/hudson/plugins/sloccount/SloccountPublisher/config.jelly
          http://jenkins-ci.org/commit/sloccount-plugin/38eedb0848fd345f84f8a0294c2111e4ed4b446f
          Log:
          JENKINS-22303 Should have option to not care about build failure status

          • Option to try to process the report files even if the build is not successful added to job configuration.
          • If no file is matching the input pattern, no data are stored and the build is marked as failed.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Michal Turek Path: src/main/java/hudson/plugins/sloccount/SloccountPublisher.java src/main/resources/hudson/plugins/sloccount/SloccountPublisher/config.jelly http://jenkins-ci.org/commit/sloccount-plugin/38eedb0848fd345f84f8a0294c2111e4ed4b446f Log: JENKINS-22303 Should have option to not care about build failure status Option to try to process the report files even if the build is not successful added to job configuration. If no file is matching the input pattern, no data are stored and the build is marked as failed.

          Code changed in jenkins
          User: Michal Turek
          Path:
          src/main/java/hudson/plugins/sloccount/SloccountPublisher.java
          src/main/resources/hudson/plugins/sloccount/SloccountPublisher/config.jelly
          http://jenkins-ci.org/commit/sloccount-plugin/2d9956629d6b1b2f2ce479af14369807468b56cb
          Log:
          Merge pull request #39 from mixalturek/master

          JENKINS-22303 Should have option to not care about build failure status

          Compare: https://github.com/jenkinsci/sloccount-plugin/compare/4f30bbf5c058...2d9956629d6b

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Michal Turek Path: src/main/java/hudson/plugins/sloccount/SloccountPublisher.java src/main/resources/hudson/plugins/sloccount/SloccountPublisher/config.jelly http://jenkins-ci.org/commit/sloccount-plugin/2d9956629d6b1b2f2ce479af14369807468b56cb Log: Merge pull request #39 from mixalturek/master JENKINS-22303 Should have option to not care about build failure status Compare: https://github.com/jenkinsci/sloccount-plugin/compare/4f30bbf5c058...2d9956629d6b

          Michal Turek added a comment - - edited

          Implemented, will be released in version 1.17.

          Michal Turek added a comment - - edited Implemented, will be released in version 1.17.

          Code changed in jenkins
          User: Michal Turek
          Path:
          src/main/resources/hudson/plugins/sloccount/SloccountPublisher/config.jelly
          http://jenkins-ci.org/commit/sloccount-plugin/2c8d46aec8f9f32b2358611d454ac2184f1933fb
          Log:
          JENKINS-22303 Should have option to not care about build failure status

          • Regression found by injected unit test fixed.
          • <label for=...> shouldn't be used because it doesn't work when the configuration item is repeated. Use <label class="attach-previous"> to have your label attach to the previous DOM node instead.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Michal Turek Path: src/main/resources/hudson/plugins/sloccount/SloccountPublisher/config.jelly http://jenkins-ci.org/commit/sloccount-plugin/2c8d46aec8f9f32b2358611d454ac2184f1933fb Log: JENKINS-22303 Should have option to not care about build failure status Regression found by injected unit test fixed. <label for=...> shouldn't be used because it doesn't work when the configuration item is repeated. Use <label class="attach-previous"> to have your label attach to the previous DOM node instead.

          Code changed in jenkins
          User: Michal Turek
          Path:
          src/main/resources/hudson/plugins/sloccount/SloccountPublisher/config.jelly
          http://jenkins-ci.org/commit/sloccount-plugin/105324d6263140d03989d02995c588e988cd5365
          Log:
          Merge pull request #40 from mixalturek/master

          JENKINS-22303 Should have option to not care about build failure statu...

          Compare: https://github.com/jenkinsci/sloccount-plugin/compare/2d9956629d6b...105324d62631

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Michal Turek Path: src/main/resources/hudson/plugins/sloccount/SloccountPublisher/config.jelly http://jenkins-ci.org/commit/sloccount-plugin/105324d6263140d03989d02995c588e988cd5365 Log: Merge pull request #40 from mixalturek/master JENKINS-22303 Should have option to not care about build failure statu... Compare: https://github.com/jenkinsci/sloccount-plugin/compare/2d9956629d6b...105324d62631

            mixalturek Michal Turek
            moncreaff Greg Moncreaff
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: