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

Git push tag in case if build SUCCESS only, UNSTABLE result is not pushing a tag.

      Git push tag only in case if build SUCCESS only, UNSTABLE result is not push a tag.

      Since UNSTABLE status in general can be "stable" with warnings. Since compilation errors or something critical don't happens during build we need to have ability to push tag even build is unstable.

      Possible fix I will push as pull request.

          [JENKINS-16646] Git push tag in case if build SUCCESS only, UNSTABLE result is not pushing a tag.

          From our point of view in continous process it's can be life, since there can be exists some issues due which tests are failed (bug or bugs about which we are know) and QA should get build with some limitation.(Since another features are working and QA should test it)
          To fix these issues need some time e.g. 2-4 days. As I said before QA should get build during this 2-4 days.

          We are using tagging to have stable(or unstable) build (but not failed). Continous build marks in source control tag e.g. "stable" and nighly build use this tag to have "good" build.

          Vladimir Kravets added a comment - From our point of view in continous process it's can be life, since there can be exists some issues due which tests are failed (bug or bugs about which we are know) and QA should get build with some limitation.(Since another features are working and QA should test it) To fix these issues need some time e.g. 2-4 days. As I said before QA should get build during this 2-4 days. We are using tagging to have stable(or unstable) build (but not failed). Continous build marks in source control tag e.g. "stable" and nighly build use this tag to have "good" build.

          Possible fix was implemented in the pull request - https://github.com/jenkinsci/git-plugin/pull/128

          Kutzi comments some things in this pull request. Thus I will change some behavior in the fix.

          Vladimir Kravets added a comment - Possible fix was implemented in the pull request - https://github.com/jenkinsci/git-plugin/pull/128 Kutzi comments some things in this pull request. Thus I will change some behavior in the fix.

          Mikolaj Leszczynski added a comment - - edited

          Hello, any updates on this issue?
          We consider failing tests acceptable, as Android's test suite tends to be unreliable. The plugin not pushing when it's unstable disrupts our tagging and versioning system. It would be nice to at leat have the option to push if it's also unstable.

          Mikolaj Leszczynski added a comment - - edited Hello, any updates on this issue? We consider failing tests acceptable, as Android's test suite tends to be unreliable. The plugin not pushing when it's unstable disrupts our tagging and versioning system. It would be nice to at leat have the option to push if it's also unstable.

          Mark Waite added a comment -

          The git publisher has a post build action has a checkbox to push only on success. Is that sufficient to meet this need?

          Mark Waite added a comment - The git publisher has a post build action has a checkbox to push only on success . Is that sufficient to meet this need?

          Mark Waite added a comment -

          Publish only if build succeeds - screen clip

          Mark Waite added a comment - Publish only if build succeeds - screen clip

          Adam Kaufman added a comment -

          I would like to be able to push tags on SUCCESS or UNSTABLE, but not on FAILURE. Currently this is not possible. I see that the pull request was denied...any chance of getting functionality like this into the plugin?

          Adam Kaufman added a comment - I would like to be able to push tags on SUCCESS or UNSTABLE, but not on FAILURE. Currently this is not possible. I see that the pull request was denied...any chance of getting functionality like this into the plugin?

          Mark Waite added a comment -

          ajk8 that functionality won't be added into the plugin unless someone reworks the submission based on the feedback that was provided on the submission. Since the pull request was closed about 2 years ago, it is unlikely that will arrive in the plugin.

          Mark Waite added a comment - ajk8 that functionality won't be added into the plugin unless someone reworks the submission based on the feedback that was provided on the submission. Since the pull request was closed about 2 years ago, it is unlikely that will arrive in the plugin.

          Once again Jenkins kicks you in the teeth for using the fancy features. Just go with a shell script

          git push origin $GIT_LOCAL_BRANCH 


          in last build step wrapped with a conditional. https://wiki.jenkins-ci.org/display/JENKINS/Conditional+BuildStep+Plugin
          You need the credentials available via CLI for that – we use Docker, so we just put ssh keys in Dockerfile but you could also use one of the plugins for managing secrets.

          Above works, unless you have other publishers that can change the status (like me).
          You could try https://wiki.jenkins-ci.org/display/JENKINS/PostBuildScript+Plugin but it's unmaintaned and I haven't yet checked if it isn't afflicted by a similar bug as this.
          The https://wiki.jenkins-ci.org/display/JENKINS/Post+build+task only let's you grep console, which is too ugly for my taste.

          Last resort is a groovy/shell script checking the build status manually and calling git push based on that.

          Jakub Bochenski added a comment - Once again Jenkins kicks you in the teeth for using the fancy features. Just go with a shell script git push origin $GIT_LOCAL_BRANCH in last build step wrapped with a conditional. https://wiki.jenkins-ci.org/display/JENKINS/Conditional+BuildStep+Plugin You need the credentials available via CLI for that – we use Docker, so we just put ssh keys in Dockerfile but you could also use one of the plugins for managing secrets. Above works, unless you have other publishers that can change the status (like me). You could try https://wiki.jenkins-ci.org/display/JENKINS/PostBuildScript+Plugin but it's unmaintaned and I haven't yet checked if it isn't afflicted by a similar bug as this. The https://wiki.jenkins-ci.org/display/JENKINS/Post+build+task only let's you grep console, which is too ugly for my taste. Last resort is a groovy/shell script checking the build status manually and calling git push based on that.

          markewaite would it be possible to at least update the documentation which is clearly wrong? Currently the publisher will only push on "Stable" status not "Successful".
          I know about JENKINS-10763 , but what the permalinks show (lastSuccessfullBuild vs lastStableBuild) is quite prominent so I'd go with that.

          Jakub Bochenski added a comment - markewaite would it be possible to at least update the documentation which is clearly wrong? Currently the publisher will only push on "Stable" status not "Successful". I know about JENKINS-10763 , but what the permalinks show ( lastSuccessfullBuild vs lastStableBuild ) is quite prominent so I'd go with that.

          Mark Waite added a comment -

          jbochenski, the wiki page for documentation is available for anyone to edit and improve. Please feel free to improve it.

          The online help is available in the source code repository for anyone to clone and submit pull requests. Please feel free to submit a pull request to improve it.

          Mark Waite added a comment - jbochenski , the wiki page for documentation is available for anyone to edit and improve. Please feel free to improve it. The online help is available in the source code repository for anyone to clone and submit pull requests. Please feel free to submit a pull request to improve it.

            Unassigned Unassigned
            vkravets Vladimir Kravets
            Votes:
            4 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: