nishio-dens / bitbucket-pullrequest-builder-plugin

Bitbucket Pull Request Builder Plugin for Jenkins
Other
125 stars 145 forks source link

Cancel outdated job not working #194

Closed mokone91 closed 4 years ago

mokone91 commented 5 years ago

Hi, after the last update "Cancel outdated job" feature not working anymore..

I use pipeline script Here example:

#!/usr/bin/env groovy
properties([disableConcurrentBuilds()])
pipeline {
    agent any
    tools { nodejs "nodejs" }
    environment {
        NODE_ENV = 'tests'
    }
    options {
        timestamps()
    }
    triggers {
        bitbucketpr(
            projectPath: 'git@bitbucket.org:***/***.git',
            cron: '* * * * *',
            credentialsId: '****',
            repositoryOwner: '***',
            repositoryName: '***',
            branchesFilter: '',
            branchesFilterBySCMIncludes:false,
            ciKey: 'jenkins-tests',
            ciName: 'Jenkins tests',
            ciSkipPhrases: 'trivial,[skiptest],[trivial]',
            checkDestinationCommit: false,
            approveIfSuccess: false,
            cancelOutdatedJobs: true,
            commentTrigger: 'test this please'
        )
    }
    stages {
        stage("Install dependencies") {
            steps {
               sh "yarn"
            }
        }
        stage("Deploy to remote server") {
            steps {
              sshagent(credentials : ['******']) {
                  sh "yarn deploy"
              }
            }
        }
        stage("Run Tests") {
            steps {
               sh "yarn test"
            }
        }
    }
    post {
          always {
            junit 'packages/test/reports/report.xml'
          }
       }
}
mokone91 commented 5 years ago

Hi again! In version 1.4.26 this feature works great, but bitbucket do not update build status(

mokone91 commented 5 years ago

I tested latest version on clear jenkins installation also, issue still presented

znerd commented 5 years ago

@mokone91 : It would be useful if you could elaborate on which version of the Bitbucket PR Builder Plugin was still working fine, and which version introduced the bug you describe.

Additionally, it would be helpful to share your Jenkins version.

Regarding your credentials: are you filling both the credentialsId as well as the user name + password combination?

CodeMonk commented 5 years ago

There was a bug that went in that broke job canceling. That should be fixed.

If you are seeing issues, please provide the logs, too, and the exact version you're running.

I did have issues pushing out the last release. Perhaps it didn't grab the new changes?

zzhelqzkov commented 4 years ago

Hi i have the same issue cancelOutdatedJobs feature not working. Use jenkins version 2.190.1 with plugin version 1.5.0 and 1.4.30

triggers{
        bitbucketpr(
            projectPath:'',
            cron: '* * * * *',
            credentialsId: 'Bitbucket',
            username: '******',
            password: '*****',
            repositoryOwner: '****',
            repositoryName: '*****',
            branchesFilter: 'trivial,[skiptest]',
            branchesFilterBySCMIncludes: false,
            ciKey: 'jenkins',
            ciName: 'Jenkins',
            ciSkipPhrases: '',
            checkDestinationCommit: false,
            approveIfSuccess: false,
            cancelOutdatedJobs: true,
            commentTrigger: 'test this please'
        )
    } 
CodeMonk commented 4 years ago

Thanks for providing the versions, but, without logs . . . . I'll try some code inspection this weekend, but, I wouldn't hold your breath.

zzhelqzkov commented 4 years ago

My problem is that, when cancelOutdatedJobs option is enabled and programmer push new code does not stop old running job in Jenkins to start a new one with least version of code.

CodeMonk commented 4 years ago

Jobs in jenkins do not stop immediately. Sometimes steps can take many minutes to catch the abort signal.

I'd be happy to analyze any logs you can attach, but, without logs, there is really nothing more I can do.

CodeMonk commented 4 years ago

Closing since this is not the same issue that was fixed, and there are no logs to analyze to see if a different error is occurring.