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

Author of last commit becomes the author of the integration commit (Praqma case 13102)

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Both accumulated and squashed strategy sets both committer and author to the git user on the Jenkins slave.

      The author on the commits on the ready-branch should be kept, as the author on the new commit on the integration branch.

      This follows the usual idea of pull-request patterns, where the maintainer accepts the pull requests and becomes the committer, while the original author doing the work get credit as author.

      Many repository browsers shows author of commits, thus the history in such systems will be more interesting when looking over the git history. Today it is the git user on the Jenkins slave showing as both committer and author.

      If there is more than one commit on the ready branch, the author of the last commit will be used, so in the implementation details we just always use the author of the last commit.

        Attachments

          Activity

          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Bue Petersen
          Path:
          pom.xml
          src/main/java/org/jenkinsci/plugins/pretestedintegration/PretestedIntegrationPostCheckout.java
          src/main/java/org/jenkinsci/plugins/pretestedintegration/scm/git/AccumulatedCommitStrategy.java
          src/main/java/org/jenkinsci/plugins/pretestedintegration/scm/git/FindCommitAuthorCallback.java
          src/main/java/org/jenkinsci/plugins/pretestedintegration/scm/git/GitBridge.java
          src/main/java/org/jenkinsci/plugins/pretestedintegration/scm/git/SquashCommitStrategy.java
          src/test/java/org/jenkinsci/plugins/pretestedintegration/integration/scm/git/MultipleScm_threeRepos_IT.java
          src/test/java/org/jenkinsci/plugins/pretestedintegration/integration/scm/git/StaticGitRepositoryTestBase.java
          src/test/java/org/jenkinsci/plugins/pretestedintegration/integration/scm/git/UseAuthorOfLastCommit.java
          src/test/resources/useAuthorOfLastCommit-repo_description.log
          src/test/resources/useAuthorOfLastCommit.md
          src/test/resources/useAuthorOfLastCommit.sh
          src/test/resources/useAuthorOfLastCommit.zip
          http://jenkins-ci.org/commit/pretested-integration-plugin/79f125e99c537f93cb8a6faf26c805a4859f63a0
          Log:
          JENKINS-28590 Re-use author on commit and refactor:

          The integration commit will have the author of the last commit on the
          development branch being integrated.
          In both accumulated and squash strategy the author of the last commit is
          collected and used with the '--author' switch during commit of the
          integration commit.

          The implementation includes large refactoring to improve logging,
          console output FIXME

          • Maven pom file, updated java ncss tool from version 2.0 to 2.1 as it
            failed to parse java 7 multi catch constructs

          Logging changes in general:

          • user information that is written to job console is now also logged
          • LOG_PREFIX which equals '[PREINT]' is added to all changed logging
            lines for consistency

          Accumulated and squash strategy implementations:

          • changed, restructured the work flow reporting to the job console
          • made output to job console almost identical between the two strategies
          • added more progress and logging during the work flow
          • separated merge and commit in two phases, each handling exceptions and
            git command exit codes individually
          • splitting merge and commit needed to allow to use the option --author
            to set the author of the commit

          Finding the author:

          • implemented as a call back method, to support remoting
          • copy and re-use from a like method

          GitBridge - the post-build step pushing integration branch and deleting
          development branch:

          • added better error reporting, showing output message and exception if
            failing

          Test MultipleScm_threeRepos_IT:

          • improved the wait for activity function to only return if result is
            valid, not only when there is a temporary one and the job is still
            building
          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Bue Petersen Path: pom.xml src/main/java/org/jenkinsci/plugins/pretestedintegration/PretestedIntegrationPostCheckout.java src/main/java/org/jenkinsci/plugins/pretestedintegration/scm/git/AccumulatedCommitStrategy.java src/main/java/org/jenkinsci/plugins/pretestedintegration/scm/git/FindCommitAuthorCallback.java src/main/java/org/jenkinsci/plugins/pretestedintegration/scm/git/GitBridge.java src/main/java/org/jenkinsci/plugins/pretestedintegration/scm/git/SquashCommitStrategy.java src/test/java/org/jenkinsci/plugins/pretestedintegration/integration/scm/git/MultipleScm_threeRepos_IT.java src/test/java/org/jenkinsci/plugins/pretestedintegration/integration/scm/git/StaticGitRepositoryTestBase.java src/test/java/org/jenkinsci/plugins/pretestedintegration/integration/scm/git/UseAuthorOfLastCommit.java src/test/resources/useAuthorOfLastCommit-repo_description.log src/test/resources/useAuthorOfLastCommit.md src/test/resources/useAuthorOfLastCommit.sh src/test/resources/useAuthorOfLastCommit.zip http://jenkins-ci.org/commit/pretested-integration-plugin/79f125e99c537f93cb8a6faf26c805a4859f63a0 Log: JENKINS-28590 Re-use author on commit and refactor: The integration commit will have the author of the last commit on the development branch being integrated. In both accumulated and squash strategy the author of the last commit is collected and used with the '--author' switch during commit of the integration commit. The implementation includes large refactoring to improve logging, console output FIXME Maven pom file, updated java ncss tool from version 2.0 to 2.1 as it failed to parse java 7 multi catch constructs Logging changes in general: user information that is written to job console is now also logged LOG_PREFIX which equals ' [PREINT] ' is added to all changed logging lines for consistency Accumulated and squash strategy implementations: changed, restructured the work flow reporting to the job console made output to job console almost identical between the two strategies added more progress and logging during the work flow separated merge and commit in two phases, each handling exceptions and git command exit codes individually splitting merge and commit needed to allow to use the option --author to set the author of the commit Finding the author: implemented as a call back method, to support remoting copy and re-use from a like method GitBridge - the post-build step pushing integration branch and deleting development branch: added better error reporting, showing output message and exception if failing Test MultipleScm_threeRepos_IT: improved the wait for activity function to only return if result is valid, not only when there is a temporary one and the job is still building
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Bue Petersen
          Path:
          src/main/java/org/jenkinsci/plugins/pretestedintegration/scm/git/AccumulatedCommitStrategy.java
          src/main/java/org/jenkinsci/plugins/pretestedintegration/scm/git/GitBridge.java
          src/main/java/org/jenkinsci/plugins/pretestedintegration/scm/git/SquashCommitStrategy.java
          http://jenkins-ci.org/commit/pretested-integration-plugin/8702ef4257fb87b5a02ebcc7a8d0834fec4c44e4
          Log:
          JENKINS-28590 Fixed few checkstyle errors

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Bue Petersen Path: src/main/java/org/jenkinsci/plugins/pretestedintegration/scm/git/AccumulatedCommitStrategy.java src/main/java/org/jenkinsci/plugins/pretestedintegration/scm/git/GitBridge.java src/main/java/org/jenkinsci/plugins/pretestedintegration/scm/git/SquashCommitStrategy.java http://jenkins-ci.org/commit/pretested-integration-plugin/8702ef4257fb87b5a02ebcc7a8d0834fec4c44e4 Log: JENKINS-28590 Fixed few checkstyle errors

            People

            • Assignee:
              bue Bue Petersen
              Reporter:
              bue Bue Petersen
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: