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

Git Push Event Broken when switching repo URLs

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • git-plugin
    • None
    • Jenkins 2.60.2, Git Plugin 3.5.1

      Problem

      Internally, we have consolidated Github repositories and as a result, had to update repository URLs in Jenkins jobs to point to their new locations. In the process of this, changing the Git URL in Pipeline jobs and committing code did not trigger the Github Push on the Pipeline jobs. I can see the Push events come through in the Jenkins logs but the Github Hook Log seems to still show the old URL log results and does not update. 

      Steps to Reproduce

      1. Stand up a Jenkins master (I did in Docker)
      2. Create two different Github repos (repo1,repo2)
        1. Include a Jenkinsfile that just has:
          node { echo 'hello repo1(make this repo2 for repo2)' }
      1. Create a Pipeline job
        1. For our particular job, we have set the branch specifier as */tags/* to build tags
      2. Create a tag on the repo (v1.0)
      3. Run a build and see that it built (v1.0) successfully via manual trigger (without the hook triggering a tag)
      4. Set up a Github webhook on repo1 (send all events to make it easy) to the Jenkins server
      5. Make a small change to the echo statement in the Jenkinsfile for repo1
      6. Create a tag and see that the job is successfully triggered from the Github webhook
      7. ** Notice the Github Hook Log is showing that the tag is fetched properly from repo1
      8. Go back to the job configuration page and change the Git URL to point to repo2
      9. Set up a Github webhook on repo2 (send all events to make it easy) to the Jenkins server
      10. Create a tag on repo2
      11. ** Expected echo 'hello repo2' but it is still displaying 'hello repo1'
        1. The Github Hook Log is also showing the tags from repo1 being fetched

       

      Is there some sort of state stored? If I create a brand new Pipeline job that points to repo2 the tagging trigger all works. But vice versa, if I change that URL back to repo1, it will not trigger on repo1 tag creation. 

            Unassigned Unassigned
            ahuang Alvin Huang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: