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

Hook uninstalled if job is in a subfolder

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Component/s: github-plugin
    • Labels:
    • Environment:
      Jenkins ver. 1.565.3, GitHub plugin 1.9.1, CloudBees Folders Plugin 4.6.1
    • Similar Issues:

      Description

      After I started using the CloudBees Folders Plugin and moving jobs into folders, I noticed when I pushed stuff to github, builds were no longer triggered. I checked in GitHub and the Jenkins plugin was not enabled. I go to the job, save it again (the option "Build when a change is pushed to GitHub" is always checked and is the only method to trigger a build that's activated) and I see the hook is created, but after a minute or 2, it gets removed again. GitHub security log says the removal request comes from the Jenkins server.

      Looking at the source code, I see where hooks are being removed:
      https://github.com/jenkinsci/github-plugin/blob/49bc59d79707808d73eb0f9d5c97996fd5525d08/src/main/java/com/cloudbees/jenkins/Cleaner.java

      Activating the log for com.cloudbees.jenkins.Cleaner I can definitely see it's Jenkins the one removing the hooks. Why is considering jobs inside subfolders as "not interesting" I have no idea.

        Attachments

          Activity

          lucasocio Leandro Lucarella created issue -
          lucasocio Leandro Lucarella made changes -
          Field Original Value New Value
          Description After I started using the CloudBees Folders Plugin and moving jobs into folders, I noticed when I pushed stuff to github, builds were no longer triggered. I checked in GitHub and the Jenkins plugin was not enabled. I go to the job, save it again (the option "Build when a change is pushed to GitHub" is always checked and is the only method to trigger a build that's activated) and I see the hook is created, but after a minute or 2, it gets removed again. GitHub security log says the removal request comes from the Jenkins server.

          Looking at the source code, I see where hooks are being removed:
          https://github.com/jenkinsci/github-plugin/blob/49bc59d79707808d73eb0f9d5c97996fd5525d08/src/main/java/com/cloudbees/jenkins/Cleaner.java

          Activating the log for com.cloudbees.jenkins.Cleaner I can definitely see it's Jenkins the one removing the hooks. Why is considering jobs inside subfolders as "not interesting" I have no idea.

          Looking at the "GitHub Hook Log" for a top-level project, I see something like this:
          ---
          Last GitHub Push

          Started on Oct 13, 2014 3:21:08 PM
          Polling SCM changes on master
          Using strategy: Default
          [poll] Last Built Revision: Revision ae6386642259cb1b675730fbce96deaa29d3a369 (origin/master)
           > git rev-parse --is-inside-work-tree # timeout=10
          Fetching changes from the remote Git repositories
           > git config remote.origin.url git@github.com:sociomantic/git-hub.git # timeout=10
          Fetching upstream changes from git@github.com:sociomantic/git-hub.git
           > git --version # timeout=10
          using GIT_SSH to set credentials GitHub jenkins-admin
           > git fetch --tags --progress git@github.com:sociomantic/git-hub.git +refs/heads/*:refs/remotes/origin/*
          Polling for changes in
          Seen branch in repository origin/master
           > git log --full-history --no-abbrev --format=raw -M -m --raw ae6386642259cb1b675730fbce96deaa29d3a369..7618cac3f33deb84868332acc64572b60d7adf7e # timeout=10
          Done. Took 3.4 sec
          Changes found
          ---

          (I don't know why is it polling anything in the first place because Polling is not enabled)

          For a job in a subfolder, I see this log instead:
          ---
          After I started using the CloudBees Folders Plugin and moving jobs into folders, I noticed when I pushed stuff to github, builds were no longer triggered. I checked in GitHub and the Jenkins plugin was not enabled. I go to the job, save it again (the option "Build when a change is pushed to GitHub" is always checked and is the only method to trigger a build that's activated) and I see the hook is created, but after a minute or 2, it gets removed again. GitHub security log says the removal request comes from the Jenkins server.

          Looking at the source code, I see where hooks are being removed:
          https://github.com/jenkinsci/github-plugin/blob/49bc59d79707808d73eb0f9d5c97996fd5525d08/src/main/java/com/cloudbees/jenkins/Cleaner.java

          Activating the log for com.cloudbees.jenkins.Cleaner I can definitely see it's Jenkins the one removing the hooks. Why is considering jobs inside subfolders as "not interesting" I have no idea.
          danielbeck Daniel Beck made changes -
          Labels folders
          integer Kanstantsin Shautsou made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 159033 ] JNJira + In-Review [ 195973 ]

            People

            • Assignee:
              Unassigned
              Reporter:
              lucasocio Leandro Lucarella
            • Votes:
              2 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: