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

Pipeline GitHub Changelog No Changes on Merge

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • git-plugin
    • None
    • git-client-plugin 2.7.1
      git-plugin 3.7.0
      Jenkins 2.89.4

      We have a pipeline set up for a GitHub repo with a Jenkinsfile. On a merge from a pull request, a build will trigger but it will not always pick up changes (the "Changes" link on the build is empty). After some more commits/merges are added, all of the changes since the last build that had changes will get picked up, so no commits are actually missed, but it takes a few to actually get picked up.

      I would expect every new build that is building on a new revision would pick up the changes. Is this not how the plugins work? Or do we have something set up wrong? In our Jenkinsfile we are using shared library code that is both in a different repo and in the same repo as this Jenkinsfile, so we have `library 'myrepo@${branch}'` (for dynamic loading if the build is on a PR instead of master) as well as some Groovy source code being loaded with `@Library('myrepo@master')` since without it, the source code does not appear to be added to the classpath (removing this causes `unable to resolve class` errors).

      The attached screenshots are two screenshots of one build that has an empty "Changes" page and only 1 (duplicate) "Git Build Data" that should have picked up changes to the branch. The other screenshot is of the build that came directly after it that has more "Git Build Data" and had all of the changes that were missed by previous builds that should have had changes.

          [JENKINS-49703] Pipeline GitHub Changelog No Changes on Merge

          Did some more investigating and it appears that using `library` and `@Library` to load files with their default behavior of `changelog=false` from the same repo that the pipeline is running in was causing the problem. Switching these to `changelog=false` fixed the problem.

          I think we are probably using the libraries incorrectly. It makes sense for the global functions and classes we have to exist in the same repo as the Jenkinsfile using it, since nothing else uses them so they are not actually "shared". But there does not seem to be a way to do this without the library steps.

          Is the proper way to set up something like this to put global functions and classes in separate repos even though they will only be used by one Jenkinsfile? I have tried searching for the correct way to have this setup work, but so far everything I have found is either inconsistent, doesn't work, or comes with some sort of problem.

          Dustin Chaloupka added a comment - Did some more investigating and it appears that using `library` and `@Library` to load files with their default behavior of `changelog=false` from the same repo that the pipeline is running in was causing the problem. Switching these to `changelog=false` fixed the problem. I think we are probably using the libraries incorrectly. It makes sense for the global functions and classes we have to exist in the same repo as the Jenkinsfile using it, since nothing else uses them so they are not actually "shared". But there does not seem to be a way to do this without the library steps. Is the proper way to set up something like this to put global functions and classes in separate repos even though they will only be used by one Jenkinsfile? I have tried searching for the correct way to have this setup work, but so far everything I have found is either inconsistent, doesn't work, or comes with some sort of problem.

          Mark Waite added a comment -

          I use a dedicated repository for my pipeline shared libraries. A dedicated repo is better (for me) than bundling the library inside..

          Mark Waite added a comment - I use a dedicated repository for my pipeline shared libraries. A dedicated repo is better (for me) than bundling the library inside..

          Mark Bretl added a comment -

          Environment:
          Jenkins 2.204.2
          github-branch-source 2.6.0
          bitbucket-branch-source 2.7.0
          git 4.2.0
          atlassian-jira-software-cloud 1.0.4
           
          I am using Jenkins pipelines and trying to get all commits (and their messages) in a particular build to link to JIRA. I noticed notifications were missing in Jira when the reference to the ticket was in a merge commit in GitHub. This got me to see why the integration was failing. When looking at the ChangeSet log from the currentBuild, if the commit is a merge, then it does not show in the ChangeSets (hudson.plugins.git.GitChangeSet) item list.
           
          I do also have an on-premise Bitbucket Server 6.9.1 and was able to verify merge commits were being added to the ChangeSet when using the bitbucket-branch-source plugin, so this feels like a limitation on the GitHub side. If merge commits from GitHub repositories are not able to be in ChangeSet logs, I am not able to have developers use the 'squash and merge' functionality for a PR.
           

          Mark Bretl added a comment - Environment: Jenkins 2.204.2 github-branch-source 2.6.0 bitbucket-branch-source 2.7.0 git 4.2.0 atlassian-jira-software-cloud 1.0.4   I am using Jenkins pipelines and trying to get all commits (and their messages) in a particular build to link to JIRA. I noticed notifications were missing in Jira when the reference to the ticket was in a merge commit in GitHub. This got me to see why the integration was failing. When looking at the ChangeSet log from the currentBuild, if the commit is a merge, then it does not show in the ChangeSets (hudson.plugins.git.GitChangeSet) item list.   I do also have an on-premise Bitbucket Server 6.9.1 and was able to verify merge commits were being added to the ChangeSet when using the bitbucket-branch-source plugin, so this feels like a limitation on the GitHub side. If merge commits from GitHub repositories are not able to be in ChangeSet logs, I am not able to have developers use the 'squash and merge' functionality for a PR.  

          We are having this issue with github folders (latest plugin version / jenkins lts) as well.

          We are seeing this both on PRs and any other branches (master as well): any view that would show up "changes" is empty.

          Bitbucket server on the same jenkins server works fine.

          Günter Grodotzki added a comment - We are having this issue with github folders (latest plugin version / jenkins lts) as well. We are seeing this both on PRs and any other branches (master as well): any view that would show up "changes" is empty. Bitbucket server on the same jenkins server works fine.

            Unassigned Unassigned
            dustinchaloupka Dustin Chaloupka
            Votes:
            4 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: