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

Jenkinsfile not found in PR on GitHub -- Does not meet criteria

    Details

    • Similar Issues:

      Description

      Sometimes, when we create PR on GitHub - it is ignored by Jenkins. I've tried to re-scan organization - and see in logs:

        Getting remote pull requests...
      
          Checking pull request #128
            ‘Jenkinsfile’ not found
          Does not meet criteria
      

      But Jenkinsfile is here! I see other bugs in your Jira and here is some additional information:

      • Repository is added to Jenkins via GitHub Organization Folder
      • We don't use forks
      • Commiter is a member of our organization and has full rights on this repository
      • Problem PRs are also very simple and doesn't touch Jenkinsfile at all
      • Source PR branch has Jenkinsfile
      • Branch which we want to merge - was created from source branch and also has Jenkinsfile
      • Jenkinsfile was not changed between merge commits
      • If I merge branches manually - result has Jenkinsfile
      • If we do merge on GitHub UI - result will have Jenkinsfile (and will be built)
      • If we recreate same pull request several times - it will be built

      And more logs:

      Examining our-organization/our-repo:  
      
      Checking branches...  
      Getting remote branches...  
        
      Checking branch master
            ‘Jenkinsfile’ found
          Met criteria
      No changes detected: master (still at 923197f48be5cd8296b8ca95bd72a4a830a474f4)    
      
      Checking branch develop
            ‘Jenkinsfile’ found
          Met criteria
      No changes detected: develop (still at 43c2cce36623a4af90b28d886dfb28ea8d813ab8)    
      
      Checking branch feature/198-video-verification
            ‘Jenkinsfile’ found
          Met criteria
      No changes detected: feature/198-video-verification (still at 9126f0c6958db3c712078ed0d2587e96004d27c6)  
      
      3 branches were processed  
      
      Checking pull-requests...  
      Getting remote pull requests...    
      
      Checking pull request #128
            ‘Jenkinsfile’ not found
          Does not meet criteria
      

      PR #128 - is between develop and feature/198-video-verification - and, as you can see, both have Jenkinsfile and were built successfully.

        Attachments

          Issue Links

            Activity

            Hide
            bitwiseman Liam Newman added a comment -

            Thomas Liddle
            It is good to know the workaround still works. Thanks!

            Show
            bitwiseman Liam Newman added a comment - Thomas Liddle It is good to know the workaround still works. Thanks!
            Hide
            sg Sudheer Gundanna added a comment -

            This issue occurred on one our branch today. On login to Jenkins server I noticed entire branch was missing under jobs folder. We use Multipipeline project and 2.164.2, this is so annoying as we lost entire history of PR(s) that went to this branch. We map build number to PR to do feature testing and now we don't have that details. 

            Show
            sg Sudheer Gundanna added a comment - This issue occurred on one our branch today. On login to Jenkins server I noticed entire branch was missing under jobs folder. We use Multipipeline project and 2.164.2, this is so annoying as we lost entire history of PR(s) that went to this branch. We map build number to PR to do feature testing and now we don't have that details. 
            Hide
            joncormier Jon Cormier added a comment -

            We encountered this problem today, we have:
            Jenkins v2.176.2
            Branch API Plugin v2.5.4
            GitHub Branch Source v2.5.5
            Multijob plugin v 1.32
            Pipeline: Multibranch 2.21

            deleting the files under $JENKINS_HOME/org.jenkinsci.plugins.github_branch_source.GitHubSCMProbe.cache resolved the problem. This isn't a viable longterm solution though.

            Show
            joncormier Jon Cormier added a comment - We encountered this problem today, we have: Jenkins v2.176.2 Branch API Plugin v2.5.4 GitHub Branch Source v2.5.5 Multijob plugin v 1.32 Pipeline: Multibranch 2.21 deleting the files under $JENKINS_HOME/org.jenkinsci.plugins.github_branch_source.GitHubSCMProbe.cache resolved the problem. This isn't a viable longterm solution though.
            Hide
            jayache80 Jay Ache added a comment - - edited

            Steps to reproduce:
            1. Create a branch testbranch that is one commit behind the tip of master (or some branch that is to be merged into)
            2. Make a commit to testbranch that will cause a conflict with the latest on master.
            3. In GitHub, create a pull-request for testbranch to be merged into master. (It will warn you that it can't be automatically merged, but "don't worry, you can still create the pull-request". (Jenkins Multibranch pipeline will refuse to create a build for both the branch and the PR).
            4. Rebase testbranch off the latest on master, resolve the conflicts, and git push origin testbranch --force.
            5. Jenkins Multibranch pipeline will catch that the branch changed, and build the branch, however, it still doesn't sense the pull-request, and refuses to create a build for it.

            Closing and re-opening the pull-request doesn't help.
            Closing the pull-request and opening a new one (for the same, conflict-free branch) does work (but is obviously not ideal).
            rm -rf $JENKINS_HOME/org.jenkinsci.plugins.github_branch_source.GitHubSCMProbe.cache/* does work.

            I'd also like to state that there indeed was a Jenkinsfile on testbranch, and that the trigger of this bug is when there's a merge conflict at the time the pull-request is created.

            Jenkins 2.176.2
            GitHub Source Plugin 2.5.6
            Pipeline: Multibranch 2.21

            Show
            jayache80 Jay Ache added a comment - - edited Steps to reproduce: 1. Create a branch testbranch  that is one commit behind the tip of master  (or some branch that is to be merged into) 2. Make a commit to testbranch that will cause a conflict with the latest on master . 3. In GitHub, create a pull-request for testbranch to be merged into master . (It will warn you that it can't be automatically merged, but "don't worry, you can still create the pull-request". (Jenkins Multibranch pipeline will refuse to create a build for both the branch and the PR). 4. Rebase testbranch off the latest on master , resolve the conflicts, and git push origin testbranch --force . 5. Jenkins Multibranch pipeline will catch that the branch changed, and build the branch, however, it still doesn't sense the pull-request, and refuses to create a build for it. Closing and re-opening the pull-request doesn't help. Closing the pull-request and opening a new one (for the same, conflict-free branch) does work (but is obviously not ideal). rm -rf $JENKINS_HOME/org.jenkinsci.plugins.github_branch_source.GitHubSCMProbe.cache/* does work. I'd also like to state that there indeed was a Jenkinsfile on testbranch , and that the trigger of this bug is when there's a merge conflict at the time the pull-request is created . Jenkins 2.176.2 GitHub Source Plugin 2.5.6 Pipeline: Multibranch 2.21
            Hide
            jordanjennings Jordan Jennings added a comment -

            We're seeing this all the time on PRs that use the draft PR feature in GitHub. I found a related issue reported for it already:

            https://issues.jenkins-ci.org/browse/JENKINS-57206

            Show
            jordanjennings Jordan Jennings added a comment - We're seeing this all the time on PRs that use the draft PR feature in GitHub. I found a related issue reported for it already: https://issues.jenkins-ci.org/browse/JENKINS-57206

              People

              • Assignee:
                bitwiseman Liam Newman
                Reporter:
                soar Aleksey Smyrnov
              • Votes:
                65 Vote for this issue
                Watchers:
                88 Start watching this issue

                Dates

                • Created:
                  Updated: