A changelog should be recorded for the first build of a PR

Details

Description

The git plugin by design doesn't record a changelog for the first build of a job.

I guess that is expected/ok for the first build of a branch where no previous build history is known and we don't want to pollute the build with all the history that has come before the job was configured.

But that is not as expected for the first build of a GitHub PR where the commit list is somewhat short and should be known.

For example the Gerrit Trigger has a `BuildChooser` that computes the changelog for the patch set that is being built. It is a bit simpler in that case because it will always be only one commit. But something similar should be done for GitHub PRs.

Well, yes JENKINS-25508 is similar, but not really the same. I don't see it as a bug that the git plugin by default doesn't record the changelog for the first build, because I for example wouldn't want the changelog for the first build of the master branch of a nine years old project, that would be horrible.

But for pull requests it's a bit of a different story, at least in the multi branch sense, since we know where the branching point is, we could just list the commits that are in the PR at the time of the first build, with some caveats for example when someone does a rebase.

rsandell
added a comment - 2017-08-11 14:42 Well, yes JENKINS-25508 is similar, but not really the same. I don't see it as a bug that the git plugin by default doesn't record the changelog for the first build, because I for example wouldn't want the changelog for the first build of the master branch of a nine years old project, that would be horrible.
But for pull requests it's a bit of a different story, at least in the multi branch sense, since we know where the branching point is, we could just list the commits that are in the PR at the time of the first build, with some caveats for example when someone does a rebase.

This issue was marked as resolved/fixed, but I don't see any changes and the duplicated ticket is still open. I also didn't see any relevant changes in the plugin on Github. If it is fixed, how can I get the changelog for the first PR build? Right now, the changeset when condition isn't very helpful and can marks PRs as passing when nothing has been tested.

Jacob Hayes
added a comment - 2017-10-04 21:04 This issue was marked as resolved/fixed, but I don't see any changes and the duplicated ticket is still open. I also didn't see any relevant changes in the plugin on Github. If it is fixed, how can I get the changelog for the first PR build? Right now, the changeset when condition isn't very helpful and can marks PRs as passing when nothing has been tested.

Chen Fliesher
added a comment - 2019-01-23 10:20 This issue is still relevant even if more than 1 year had passed.
For example, this is the dump for a changelog for the 1st PR
ChangeSets
17:49:01 <java.util.LinkedList@20 size=1 first=java.util.LinkedList$Node@201a254b last=java.util.LinkedList$Node@201a254b modCount=1>
The first ChangeSets
17:49:01 <java.util.ArrayList@1 elementData=[] size=0 modCount=0>,
I think there should be a way to follow the branch on the Pull Request, this example if from Github repository