jenkinsci / jenkinsci/workflow-multibranch-plugin

[JENKINS-46431] Multibranch pipelines should always show changes

Open
#472 12 comments 0 reactions 0 assignees View on GitHub
component:workflow-multibranch-plugin imported-jira-issue priority:minor resolution:unresolved
Dominant language
Java
Stars
87
Forks
131
PR merge metrics
No merged PRs in 30d

Description

Given a Jenkinsfile of the form:

node {

sh "ls"
}

If I configure a multibranch pipeline pointing to a git repo with this Jenkinsfile, Jenkins does not show changes. I have to explicitly add a checkout step:

node {

checkout scm
sh "ls"
}

If Jenkins cannot find changes, it cannot notify the committers that a build has failed. For example, CulpritsRecipientProvider in the email-ext ultimately calls WorkflowRun::getChangeSets. This returns an empty list, so Jenkins doesn't know who to email.

Adding 'checkout scm' seems redundant, because Jenkins has found the Jenkinsfile from git already. In principle, Jenkins has the data it needs to work out the changes, as far as I can see.

---
Originally reported by wilfredh, imported from: Multibranch pipelines should always show changes


  • status: Open
  • priority: Minor
  • component(s): workflow-multibranch-plugin
  • resolution: Unresolved
  • votes: 5
  • watchers: 12
  • imported: 20251212-090250

Raw content of original issue

Given a Jenkinsfile of the form:


node {

sh "ls"
}

If I configure a multibranch pipeline pointing to a git repo with this Jenkinsfile, Jenkins does not show changes. I have to explicitly add a checkout step:


node {

checkout scm
sh "ls"
}

If Jenkins cannot find changes, it cannot notify the committers that a build has failed. For example, CulpritsRecipientProvider in the email-ext ultimately calls WorkflowRun::getChangeSets. This returns an empty list, so Jenkins doesn't know who to email.

Adding 'checkout scm' seems redundant, because Jenkins has found the Jenkinsfile from git already. In principle, Jenkins has the data it needs to work out the changes, as far as I can see.

environment

```
Jenkins 2.60.3

Pipeline Plugin 2.5

Pipeline: Multibranch 2.16

Git Plugin 3.5.1
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.