Ivan Fernandez Calvo
2018-12-10 14:39:05 UTC
Hi,
I am trying to show PRs related changes on Multibranch pipeline (MBP) jobs
when a PR is created, I could not make it, I only see changes it the PR is
modified with new commits. The "Calculate changelog against a specific
branch" git behavior is not available on MBP jobs so I use a custom
checkout, Is it possible? What do I wrong?
[image: Screenshot 2018-12-10 at 15.30.06.png]
Jenkins 2.155,
Pipeline 2.2,
Declarative pipeline 1.33,
Pipeline: Multibranch 2.20,
Pipeline: SCM Step 2.7,
SCM API Plugin 2.3.0,
Github API 1.95,
Basic Branch Build Strategies Plugin 1.1.1,
Branch API Plugin 2.1.1,
GitHub Branch Source Plugin 2.4.1
regular checkout does not compute changes (I suppose that in this case is
correct)
pipeline {
agent any
options {
timeout(time: 1, unit: 'HOURS')
buildDiscarder(logRotator(numToKeepStr: '20', artifactNumToKeepStr: '20', daysToKeepStr: '30'))
timestamps()
ansiColor('xterm')
disableResume()
durabilityHint('PERFORMANCE_OPTIMIZED')
}
stages {
stage('Dummy'){
steps {
sh 'export'
checkout scm
}
}
}
}
using a reference repo checkout does not compute changes (I suppose that in
this case is correct)
pipeline {
agent { label 'master'}
options {
timeout(time: 1, unit: 'HOURS')
buildDiscarder(logRotator(numToKeepStr: '20', artifactNumToKeepStr: '20', daysToKeepStr: '30'))
timestamps()
ansiColor('xterm')
disableResume()
durabilityHint('PERFORMANCE_OPTIMIZED')
}
stages {
stage('Dummy'){
steps {
checkout([$class: 'GitSCM',
branches: [[name: "${env?.CHANGE_ID ? env?.GIT_COMMIT : env?.BRANCH_NAME}"]],
doGenerateSubmoduleConfigurations: false,
extensions: [[$class: 'CloneOption',
noTags: false,
reference: '/var/lib/jenkins/.git-references/apm-agent-go.git',
shallow: false]],
submoduleCfg: [],
userRemoteConfigs: [[credentialsId: 'UserAndToken',
url: "${env?.GIT_URL}"]]])
}
}
}
}
using ChangelogToBranch checkout does not compute changes, here it should
compute the changes with the reference branch
pipeline {
agent any
options {
timeout(time: 1, unit: 'HOURS')
buildDiscarder(logRotator(numToKeepStr: '20', artifactNumToKeepStr: '20', daysToKeepStr: '30'))
timestamps()
ansiColor('xterm')
disableResume()
durabilityHint('PERFORMANCE_OPTIMIZED')
}
stages {
stage('Dummy'){
steps {
checkout([$class: 'GitSCM',
branches: [[name: "${env?.CHANGE_ID ? env?.GIT_COMMIT : env?.BRANCH_NAME}"]],
doGenerateSubmoduleConfigurations: false,
extensions: [
[$class: 'ChangelogToBranch',
options: [compareRemote: "origin",
compareTarget: "master"]]],
submoduleCfg: [],
userRemoteConfigs: [
[credentialsId: 'UserAndToken',
url: "${env?.GIT_URL}"]]])
}
}
}
}
I am trying to show PRs related changes on Multibranch pipeline (MBP) jobs
when a PR is created, I could not make it, I only see changes it the PR is
modified with new commits. The "Calculate changelog against a specific
branch" git behavior is not available on MBP jobs so I use a custom
checkout, Is it possible? What do I wrong?
[image: Screenshot 2018-12-10 at 15.30.06.png]
Jenkins 2.155,
Pipeline 2.2,
Declarative pipeline 1.33,
Pipeline: Multibranch 2.20,
Pipeline: SCM Step 2.7,
SCM API Plugin 2.3.0,
Github API 1.95,
Basic Branch Build Strategies Plugin 1.1.1,
Branch API Plugin 2.1.1,
GitHub Branch Source Plugin 2.4.1
regular checkout does not compute changes (I suppose that in this case is
correct)
pipeline {
agent any
options {
timeout(time: 1, unit: 'HOURS')
buildDiscarder(logRotator(numToKeepStr: '20', artifactNumToKeepStr: '20', daysToKeepStr: '30'))
timestamps()
ansiColor('xterm')
disableResume()
durabilityHint('PERFORMANCE_OPTIMIZED')
}
stages {
stage('Dummy'){
steps {
sh 'export'
checkout scm
}
}
}
}
using a reference repo checkout does not compute changes (I suppose that in
this case is correct)
pipeline {
agent { label 'master'}
options {
timeout(time: 1, unit: 'HOURS')
buildDiscarder(logRotator(numToKeepStr: '20', artifactNumToKeepStr: '20', daysToKeepStr: '30'))
timestamps()
ansiColor('xterm')
disableResume()
durabilityHint('PERFORMANCE_OPTIMIZED')
}
stages {
stage('Dummy'){
steps {
checkout([$class: 'GitSCM',
branches: [[name: "${env?.CHANGE_ID ? env?.GIT_COMMIT : env?.BRANCH_NAME}"]],
doGenerateSubmoduleConfigurations: false,
extensions: [[$class: 'CloneOption',
noTags: false,
reference: '/var/lib/jenkins/.git-references/apm-agent-go.git',
shallow: false]],
submoduleCfg: [],
userRemoteConfigs: [[credentialsId: 'UserAndToken',
url: "${env?.GIT_URL}"]]])
}
}
}
}
using ChangelogToBranch checkout does not compute changes, here it should
compute the changes with the reference branch
pipeline {
agent any
options {
timeout(time: 1, unit: 'HOURS')
buildDiscarder(logRotator(numToKeepStr: '20', artifactNumToKeepStr: '20', daysToKeepStr: '30'))
timestamps()
ansiColor('xterm')
disableResume()
durabilityHint('PERFORMANCE_OPTIMIZED')
}
stages {
stage('Dummy'){
steps {
checkout([$class: 'GitSCM',
branches: [[name: "${env?.CHANGE_ID ? env?.GIT_COMMIT : env?.BRANCH_NAME}"]],
doGenerateSubmoduleConfigurations: false,
extensions: [
[$class: 'ChangelogToBranch',
options: [compareRemote: "origin",
compareTarget: "master"]]],
submoduleCfg: [],
userRemoteConfigs: [
[credentialsId: 'UserAndToken',
url: "${env?.GIT_URL}"]]])
}
}
}
}
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/1e562716-319e-4b7e-82d6-eb355455b391%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/1e562716-319e-4b7e-82d6-eb355455b391%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.