-
Bug
-
Resolution: Unresolved
-
Minor
-
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.
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.