Status: Open (View Workflow)
Local mercurial version: 3.1.2
Mercurial plugin: 1.56
Pipeline plugin: 2.2
Pipeline Multibranch plugin: 2.8
I've created a pipeline multibranch project with mercurial repo as a source, build configuration set in Jenkinsfile in repo and set to build periodically to poll the repo every two minutes (H/2). The first step inside Jenkinsfile is checkout scm.
It seems that for newly created branches (that have only one commit) the changes view is totally empty. On the other hand, when there are more commits it seems that they are logged twice (see screenshot below).
This looks like a similar issue to
JENKINS-30491 or JENKINS-31079 yet this time it happens with mercurial instead of git.
- is related to
JENKINS-39487 SVN changesets duplicated when using multibranch pipeline
- relates to
JENKINS-29326 Workflow sidebar has duplicated Git Build Data links
- links to
Probably the same basic cause as JENKINS-29326.
Actually this is a generic issue with WorkflowRun:
When there are multiple checkouts, WorkflowRun will just add them all and does not attempt any de-dup (now that it is not possible to perform a generic de-dup is a separate issue)
I should note that the Git Plugin has a hack to work around this bug in WorkflowRun: https://github.com/jenkinsci/git-plugin/blob/31fedce9c41c9006c886835e03c9fe825d49aba6/src/main/java/hudson/plugins/git/GitSCM.java#L1146-L1153
That hack was introduced as part of JENKINS-29326 but can probably be removed once WorkflowRun does a de-dup (note that otherwise JENKINS-29326 was following the correct principle for de-duping the actions that it was adding... though using a too strict equality comparison)
Whether a more generic fix is possible is TBD as far as I am concerned.