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.

    Details

    • Similar Issues:

      Description

      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.

        Attachments

          Activity

          vkravets Vladimir Kravets created issue -
          Hide
          ndeloof Nicolas De Loof added a comment -

          if "UNSTABLE status in general can be "stable" with warnings" then your job is just misconfigured. if "warnings" aren't relevant they shouldn't break the build. I don't consider an UNSTABLE build to be production-ready, so should not be tagged and go further in the build-pipeline

          Show
          ndeloof Nicolas De Loof added a comment - if "UNSTABLE status in general can be "stable" with warnings" then your job is just misconfigured. if "warnings" aren't relevant they shouldn't break the build. I don't consider an UNSTABLE build to be production-ready, so should not be tagged and go further in the build-pipeline
          Hide
          vkravets 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.

          Show
          vkravets 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.
          Hide
          vkravets 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.

          Show
          vkravets 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.
          Hide
          rosomack 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.

          Show
          rosomack 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.
          vkravets Vladimir Kravets made changes -
          Field Original Value New Value
          Summary Git push tag only in case if build SUCCESS only, UNSTABLE result is not push a tag. Git push tag in case if build SUCCESS only, UNSTABLE result is not pushing a tag.
          Hide
          markewaite 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?

          Show
          markewaite 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?
          Hide
          markewaite Mark Waite added a comment -

          Publish only if build succeeds - screen clip

          Show
          markewaite Mark Waite added a comment - Publish only if build succeeds - screen clip
          markewaite Mark Waite made changes -
          Attachment publish-only-if-ok.png [ 27781 ]
          integer Kanstantsin Shautsou made changes -
          Labels git-publisher
          Hide
          ajk8 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?

          Show
          ajk8 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?
          Hide
          markewaite Mark Waite added a comment -

          Adam Kaufman 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.

          Show
          markewaite Mark Waite added a comment - Adam Kaufman 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.
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 147470 ] JNJira + In-Review [ 176910 ]
          Hide
          jbochenski 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.

          Show
          jbochenski 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.
          Hide
          jbochenski Jakub Bochenski added a comment -

          Mark Waite 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.

          Show
          jbochenski Jakub Bochenski added a comment - Mark Waite 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.
          Hide
          markewaite Mark Waite added a comment -

          Jakub Bochenski, 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.

          Show
          markewaite Mark Waite added a comment - Jakub Bochenski , 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.
          ndeloof Nicolas De Loof made changes -
          Assignee Nicolas De Loof [ ndeloof ]

            People

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

              Dates

              • Created:
                Updated: