ghprb
ghprb copied to clipboard
Generate the proper changelog/changeset for the PR.
I am seeing way too much noise in the changelog generated by ghprb if I am merging into different release branches and using the same Jenkins Job. Would be nice to be able to see the proper list of commits/changes.
Github API does provide for a way to fetch this: https://developer.github.com/v3/pulls/#list-commits-on-a-pull-request
A changeset can also be generated based on the merged hash with something like: git log pull_21^1..pull_21^2
Are you seeing this on the initial build? Or subsequent builds? Or both?
Just tested this again with one of my PRs (PR has only 1 commit):
- Initial build (jenkins build 55) shows "Changes" listing 174 Commits
- Did "retest this please" (jenkins build 59) shows "Changes" listing 185 commits.
Jenkins ver. 1.563 ghprb 1.12
Which version of the plugin? There was a fix put in for this that should help get the right changeset.
1.12 (latest stable)
Currently I am only 1 build behind on the actual Jenkins (1.563). Everything else is updated to the latest stable.
I think I'm seeing this same behavior. Far more commits than should be included are included in the reported information. I added the 'wipe out repository and force clone hoping it would improve things; it hasn't fixed the issue.
I'm seeing this issue as well intermittently. I believe it has to do with how Jenkins calculates the change set difference between a build and its previous build (https://github.com/jenkinsci/git-plugin/blob/ac8f3549d7141ae310138fb73f35d7e6b5e58f82/src/main/java/hudson/plugins/git/GitSCM.java#L971-L1012)
Looks like they calculate the difference in commits contained within the build, so if a PR is rebased, then a bunch of commits that are from the "trunk" and were not in the previous built get included.
IMO, the plugin should override this behavior and simply set the changeset to be the commits that the Github API reports are in the PR.
+1 we're being hit by this as well. Would be cool if this could be made to work reliably..
The plugin already uses Github API to pull a list of commits here: https://github.com/jenkinsci/ghprb-plugin/blob/master/src/main/java/org/jenkinsci/plugins/ghprb/GhprbPullRequest.java#L220
Why not pull that list into a changelog?
might be relevant to this issue: https://stackoverflow.com/questions/16306012/github-pull-request-showing-commits-that-are-already-in-target-branch