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

Version Number plugin doesn't increment build numbers after an unstable build

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      When the option 'Don't increment builds today/ this month/ this year/ all time after a failed build' is selected, the plugin doesn't increment build numbers for unstable builds as well.

      This makes it tedious to get a correct version number if one or two tests tend to be unstable.

        Attachments

          Issue Links

            Activity

            Hide
            samueltb Sam Barron added a comment -

            This issue seems to be pretty old, but I've come across it too in a recent version 1.7 of the plugin. So I'll document the most recent behavior of this issue.

            When checked, the version will increment only when the previous build is failed.

            Specifically here
            https://github.com/jenkinsci/versionnumber-plugin/commit/2e88832a04f1523ff635d79d87f8d2086e956fbe#diff-fd9d190813a396ffe0cb41fc634a9c64R50

            This change was committed to version 1.7.

            You can see the comment is "if we're skipping version numbers on failed builds and the last build failed..." and the change on line 53
            https://github.com/jenkinsci/versionnumber-plugin/commit/2e88832a04f1523ff635d79d87f8d2086e956fbe#diff-fd9d190813a396ffe0cb41fc634a9c64R53

            Checks

            if (result != null && result.equals(Result.SUCCESS)) {
            

            It SHOULD be

            if (result != null && !result.equals(Result.SUCCESS)) {
            

            It is clear in the diff where the error is.

            Show
            samueltb Sam Barron added a comment - This issue seems to be pretty old, but I've come across it too in a recent version 1.7 of the plugin. So I'll document the most recent behavior of this issue. When checked, the version will increment only when the previous build is failed. Specifically here https://github.com/jenkinsci/versionnumber-plugin/commit/2e88832a04f1523ff635d79d87f8d2086e956fbe#diff-fd9d190813a396ffe0cb41fc634a9c64R50 This change was committed to version 1.7. You can see the comment is "if we're skipping version numbers on failed builds and the last build failed..." and the change on line 53 https://github.com/jenkinsci/versionnumber-plugin/commit/2e88832a04f1523ff635d79d87f8d2086e956fbe#diff-fd9d190813a396ffe0cb41fc634a9c64R53 Checks if (result != null && result.equals(Result.SUCCESS)) { It SHOULD be if (result != null && !result.equals(Result.SUCCESS)) { It is clear in the diff where the error is.
            Hide
            bahadir Deniz Bahadir added a comment -

            Duplicates JENKINS-36831.

            Show
            bahadir Deniz Bahadir added a comment - Duplicates JENKINS-36831 .
            Hide
            jfrancoeur Jean Francoeur added a comment -

            Hi!  The issue is still there in version 1.8.1 and have nothing to do with this one https://issues.jenkins-ci.org/browse/JENKINS-36831    Like Sam Barron explains, There's no support for unstable build.  The build number doesn't increment when the build result is unstable.  We really need this feature to avoid messing up our configuration.  Can you please add the support to deal with unstable build status?   Thank you in advance

            Show
            jfrancoeur Jean Francoeur added a comment - Hi!  The issue is still there in version 1.8.1 and have nothing to do with this one  https://issues.jenkins-ci.org/browse/JENKINS-36831     Like Sam Barron explains, There's no support for unstable build.  The build number doesn't increment when the build result is unstable.  We really need this feature to avoid messing up our configuration.  Can you please add the support to deal with unstable build status?   Thank you in advance
            Hide
            bahadir Deniz Bahadir added a comment -

            The original issue-message did not duplicate JENKINS-36831, but the first comment from Sam Barron did.

            However, I am looking into it.

             

            NOTE: I am looking for a new maintainer of this plugin. I accidentally became the maintainer of this plugin and don't have the time for it anymore. (Additionally, Java is not my first language of choice.)

            Show
            bahadir Deniz Bahadir added a comment - The original issue-message did not duplicate JENKINS-36831 , but the first comment from Sam Barron did. However, I am looking into it.   NOTE: I am looking for a new maintainer of this plugin. I accidentally became the maintainer of this plugin and don't have the time for it anymore. (Additionally, Java is not my first language of choice.)
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Deniz Bahadir
            Path:
            src/main/java/org/jvnet/hudson/tools/versionnumber/AbstractBuildNumberGenerator.java
            src/main/java/org/jvnet/hudson/tools/versionnumber/BuildNumberGenerator.java
            src/main/java/org/jvnet/hudson/tools/versionnumber/VersionNumberBuilder.java
            src/main/java/org/jvnet/hudson/tools/versionnumber/VersionNumberCommon.java
            src/main/java/org/jvnet/hudson/tools/versionnumber/VersionNumberStep.java
            src/main/resources/org/jvnet/hudson/tools/versionnumber/VersionNumberBuilder/config.jelly
            src/main/resources/org/jvnet/hudson/tools/versionnumber/VersionNumberStep/config.jelly
            src/main/resources/org/jvnet/hudson/tools/versionnumber/VersionNumberStep/help-skipFailedBuilds.html
            src/main/resources/org/jvnet/hudson/tools/versionnumber/VersionNumberStep/help-worstResultForIncrement.html
            src/main/webapp/help-reuseVersionNumbers.html
            src/main/webapp/help-skipBuildsWorseThan.html
            src/test/java/org/jvnet/hudson/tools/versionnumber/VersionNumberStepTest.java
            http://jenkins-ci.org/commit/versionnumber-plugin/668c9e6c785d2f1bdd991a57ff1c33c70152f54b
            Log:
            JENKINS-18171 Allow more fine-grained skipping of version-number.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Deniz Bahadir Path: src/main/java/org/jvnet/hudson/tools/versionnumber/AbstractBuildNumberGenerator.java src/main/java/org/jvnet/hudson/tools/versionnumber/BuildNumberGenerator.java src/main/java/org/jvnet/hudson/tools/versionnumber/VersionNumberBuilder.java src/main/java/org/jvnet/hudson/tools/versionnumber/VersionNumberCommon.java src/main/java/org/jvnet/hudson/tools/versionnumber/VersionNumberStep.java src/main/resources/org/jvnet/hudson/tools/versionnumber/VersionNumberBuilder/config.jelly src/main/resources/org/jvnet/hudson/tools/versionnumber/VersionNumberStep/config.jelly src/main/resources/org/jvnet/hudson/tools/versionnumber/VersionNumberStep/help-skipFailedBuilds.html src/main/resources/org/jvnet/hudson/tools/versionnumber/VersionNumberStep/help-worstResultForIncrement.html src/main/webapp/help-reuseVersionNumbers.html src/main/webapp/help-skipBuildsWorseThan.html src/test/java/org/jvnet/hudson/tools/versionnumber/VersionNumberStepTest.java http://jenkins-ci.org/commit/versionnumber-plugin/668c9e6c785d2f1bdd991a57ff1c33c70152f54b Log: JENKINS-18171 Allow more fine-grained skipping of version-number.
            Hide
            bahadir Deniz Bahadir added a comment -

            Fixed in release v1.9.

            Show
            bahadir Deniz Bahadir added a comment - Fixed in release v1.9.
            Hide
            jfrancoeur Jean Francoeur added a comment -

            Wow! So fast and great!

            Thank you so much Deniz, more than expected!

            Show
            jfrancoeur Jean Francoeur added a comment - Wow! So fast and great! Thank you so much Deniz, more than expected!

              People

              • Assignee:
                bahadir Deniz Bahadir
                Reporter:
                rosomack Mikolaj Leszczynski
              • Votes:
                1 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: