-
Bug
-
Resolution: Duplicate
-
Minor
-
None
-
jenkins 2.46.2, github-branch-source-plugin 2.0.4
When a job is generated (whether it be a branch or pull request build), the only "Change" (in the UI) is a Branch event. When manually querying the changesets, the first run is always an empty list. This doesn't include information about who contributed to a build. Any plugin that uses changesets in a meaningful way does not work for the first run.
My initial use case is sending emails to culprits for a failed build. This list is correctly populated on the next build, but should be available on the initial build. This would also block changeset introspection (e.g. searching for particular changelists).
- depends on
-
JENKINS-14138 New git branch has empty changelist
-
- Open
-
- duplicates
-
JENKINS-33274 "Base build" link for first build of branch project
-
- Open
-
- is duplicated by
-
JENKINS-46086 A changelog should be recorded for the first build of a PR
-
- Closed
-
- relates to
-
JENKINS-48687 Bitbucket Branch Source Plugin: changes are missing for builds again
-
- Open
-
This is a pretty serious problem that significantly impairs the functionality of the `changeset` directive in declarative pipeline. I would go as far as to say that the `changeset` directive is worthless because of its counter intuitive and inconsistent behavior. It's led myself and a teammate to make several meaningless changes to our `changeset` usages to see if that would make the job run the conditional stages; of course whenever we made such changes within a PR the next build would actually run so we mistakenly thought we had fixed something, even though in reality all we had done was satisfy the condition under which Jenkins would actually acknowledge that changes are present in the PR as described in this ticket.
Since I absolutely know some other poor fool is going to encounter this problem, this is the workaround I've come up with: