Pipeline: Show changes on build for rebased commits

22 views
Skip to first unread message

Sverre Moe

unread,
May 13, 2019, 10:27:27 AM5/13/19
to Jenkins Users
Jenkins does not show changes after commits have been rebased.

Build #1: has 3 changes (commits)
Build #2: no changes

The second build actually has the same three changes. but these are not shown. They are same changes as before, but just slightly changed (git rebased).

I want the changes shown for the second build. Is this possible to enable?

Sverre Moe

unread,
May 14, 2019, 2:56:52 PM5/14/19
to Jenkins Users
In Blue Ocean, under Changes, getting "There are no changes for this run".
However there are changes. Is there no way I can force it to show the changes?

Jonathan Pigrée

unread,
May 14, 2019, 3:27:53 PM5/14/19
to Jenkins Users
Hi Sverre. I encountered the same issue. To my knowledge, this isn't possible. Jenkins don't know how to handle rebases. I can understand why they don't. This would require some work to detect those and handle all the edge-cases.

For now, It just displays "no changes". A workaround I found, but that I didn't found acceptable myself is to set the compareTarget property on the GitSCM checkout step.
It will display the changes between your branch and master for each builds. This way, the algorithm succeed to display the changes, even after rebases.

You will have to specify it like this (extensions line):
checkout([
    $class
: 'GitSCM',
    branches
: [[name: '**']],
    doGenerateSubmoduleConfigurations
: false,
    extensions
: [[$class: 'ChangelogToBranch', options: [compareRemote: 'origin', compareTarget: 'master']]],
    submoduleCfg
: [],
    userRemoteConfigs
: [[url: 'https://github.com/jenkinsci/jenkins']]
])

Hope it helps.
Reply all
Reply to author
Forward
0 new messages