Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-38698

SCM Changelog: Commits, made via github, displayed with "noreply" user

    Details

    • Similar Issues:

      Description

      Steps:

      1. Create Pipeline job for any project on github.
        node {
           def mvnHome
           stage('Preparation') { 
              git 'https://github.com/user-github/project.git'           
              mvnHome = tool 'M3'
           }
           stage('Build') {
              if (isUnix()) {
                 sh "'${mvnHome}/bin/mvn' -Dmaven.test.failure.ignore clean package"
              } else {
                 bat(/"${mvnHome}\bin\mvn" -Dmaven.test.failure.ignore clean package/)
              }
           stage('Results') {
              junit '**/target/surefire-reports/TEST-*.xml'
              archive 'target/*.jar'
           }
        }
        
      2. Open this project on github.
      3. Edit any files via the web interface. Commit.
      4. Run this job.
      5. Check Recent Changes:
        Expected Result: Recent changes have been made the correct user from github.
        Actual Result: Recent changes have been made the "noreply" user.
        Correct git log:
        commit 497fb99ae5c481f72ea34fa2e190afa908660798
        Author: ksenia-nenasheva <ks.nenasheva@gmail.com>
        Date:   Tue Oct 4 14:46:24 2016 +0200
        
            Update Jenkinsfile
        
        commit bbf860b9a6c7a28208b717d42e6f8665b21063a8
        Author: ksenia-nenasheva <ks.nenasheva@gmail.com>
        Date:   Tue Oct 4 14:18:41 2016 +0200
        
            Update Jenkinsfile
        
        commit 7312064526032f050b04335b4676b27b48a698f0
        Author: ksenia-nenasheva <ks.nenasheva@gmail.com>
        Date:   Tue Oct 4 13:56:31 2016 +0200
        
            Update Jenkinsfile
        

      Please see the attached screenshots.

        Attachments

        1. Changes.png
          Changes.png
          127 kB
        2. Changes in Blue Ocean.png
          Changes in Blue Ocean.png
          37 kB
        3. GitHub-Org-Folders.png
          GitHub-Org-Folders.png
          52 kB
        4. Pipeline-Multi-Branch.png
          Pipeline-Multi-Branch.png
          78 kB

          Activity

          Hide
          rochdev Roch Devost added a comment - - edited

          Where exactly is this option? I have looked everywhere and cannot seem to find it.

          I am using the `checkout scm` step in Blue Ocean rc3 if that helps.

          Show
          rochdev Roch Devost added a comment - - edited Where exactly is this option? I have looked everywhere and cannot seem to find it. I am using the `checkout scm` step in Blue Ocean rc3 if that helps.
          Hide
          markewaite Mark Waite added a comment -

          The "pipeline syntax" link on most pipeline job definition pages will let you choose the "checkout" step. That will then guide you through the web page to select various git plugin options. Look for "Additional Behaviours" and you'll find a drop-down list which includes "Use commit author in changelog".

          We were tempted some years ago to make "Use commit author in changelog" the default, but any change to default behavior tends to result in a loud outcry from users who don't expect defaults to change from one release to the next.

          Show
          markewaite Mark Waite added a comment - The "pipeline syntax" link on most pipeline job definition pages will let you choose the "checkout" step. That will then guide you through the web page to select various git plugin options. Look for "Additional Behaviours" and you'll find a drop-down list which includes "Use commit author in changelog". We were tempted some years ago to make "Use commit author in changelog" the default, but any change to default behavior tends to result in a loud outcry from users who don't expect defaults to change from one release to the next.
          Hide
          rochdev Roch Devost added a comment -

          According to this article: https://support.cloudbees.com/hc/en-us/articles/226122247-How-to-Customize-Checkout-for-Pipeline-Multibranch the "Additional Behaviours" should appear in Branch Source -> Git, but in branch source I only have GitHub available, which doesn't have this option.

          Additionally, I want to change the behaviour for all projects if possible and not have to redo this setup on each one (especially since they are created automatically from pushes to the organizations repos).

          I understand the need for backward compatibility, but since pretty much all commits in GitHub are made by "noreply", there should at least be a way to change the behaviour globally (JAVA_OPTS?)

          Show
          rochdev Roch Devost added a comment - According to this article: https://support.cloudbees.com/hc/en-us/articles/226122247-How-to-Customize-Checkout-for-Pipeline-Multibranch  the "Additional Behaviours" should appear in Branch Source -> Git, but in branch source I only have GitHub available, which doesn't have this option. Additionally, I want to change the behaviour for all projects if possible and not have to redo this setup on each one (especially since they are created automatically from pushes to the organizations repos). I understand the need for backward compatibility, but since pretty much all commits in GitHub are made by "noreply", there should at least be a way to change the behaviour globally (JAVA_OPTS?)
          Hide
          markewaite Mark Waite added a comment -

          I'm not clear which type of pipeline job you're using, since you say that GitHub is the only branch source available.

          If you're using a GitHub Organization Folders job, then the customization of checkout technique will need to be performed either in a pipeline global library shared with all jobs, or in each job.

          If you're using a pipeline multi-branch job, then the customization of checkout technique can be performed at job definition, and may then be adjusted or modified in either a pipeline global library shared with all jobs, or in the Jenkinsfile for each branch.

          Show
          markewaite Mark Waite added a comment - I'm not clear which type of pipeline job you're using, since you say that GitHub is the only branch source available. If you're using a GitHub Organization Folders job, then the customization of checkout technique will need to be performed either in a pipeline global library shared with all jobs, or in each job. If you're using a pipeline multi-branch job, then the customization of checkout technique can be performed at job definition, and may then be adjusted or modified in either a pipeline global library shared with all jobs, or in the Jenkinsfile for each branch.
          Hide
          rochdev Roch Devost added a comment -

          Since I am using pipeline multi-branch jobs with GitHub, I will add a helper to our shared libraries as you suggested. Thank you very much for your help!

          (I still think however that there should be a way to globally override the default checkout behaviour since it is incompatible with the largest Git provider on the planet)

          Show
          rochdev Roch Devost added a comment - Since I am using pipeline multi-branch jobs with GitHub, I will add a helper to our shared libraries as you suggested. Thank you very much for your help! (I still think however that there should be a way to globally override the default checkout behaviour since it is incompatible with the largest Git provider on the planet)

            People

            • Assignee:
              Unassigned
              Reporter:
              ks_nenasheva Kseniia Nenasheva
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: