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

Implement new accummulated merge strategy commit message (our case 12618)

    XMLWordPrintable

Details

    Description

      Currently the squash merge strategy will produce a commit message which will contain all the commit messages of the feature branch that is getting merged.

      The same behavior will be implemented for the accumulated strategy. It will gather the commit messages from the feature branch, format them for readability and it will be used as a commit message for the merge commit.

      Attachments

        Activity

          bue Bue Petersen added a comment -

          An example of the new commit message:

              commit 3962e0de4b263e7938b515820b4e15a61259d5af
              Merge: a0038a7 28ea8c9
              Author: john Doe <Joh@praqma.net>
              Date:   Mon Mar 2 20:56:01 2015 +0100
          
                  Accumulated commit of the following from branch 'origin/ready/anotherNewFeature':
          
                  commit 28ea8c98e891954e8c3e3e70e9dc61fb6e2919f2
                  Author: john Doe <Joh@praqma.net>
                  Date:   Mon Mar 02 08:55:52 2015 +0100
          
                      Updated info file again on branch ready/anotherNewFeature
          
                      - my first change is about this
                      - my next change is a refactor.
          
                  commit 14699c55596c25de1ffe881809aaac877992e6c9
                  Author: john Doe <Joh@praqma.net>
                  Date:   Mon Mar 02 08:55:52 2015 +0100
          
                      Updated info file on branch ready/anotherNewFeature
          
              commit a0038a7ad69ec0013013171de8958f95e0726066
              Author: john Doe <Joh@praqma.net>
              Date:   Mon Mar 2 20:55:52 2015 +0100
          
                  Added an info2 file on branch master
          
          bue Bue Petersen added a comment - An example of the new commit message: commit 3962e0de4b263e7938b515820b4e15a61259d5af Merge: a0038a7 28ea8c9 Author: john Doe <Joh@praqma.net> Date: Mon Mar 2 20:56:01 2015 +0100 Accumulated commit of the following from branch 'origin/ready/anotherNewFeature' : commit 28ea8c98e891954e8c3e3e70e9dc61fb6e2919f2 Author: john Doe <Joh@praqma.net> Date: Mon Mar 02 08:55:52 2015 +0100 Updated info file again on branch ready/anotherNewFeature - my first change is about this - my next change is a refactor. commit 14699c55596c25de1ffe881809aaac877992e6c9 Author: john Doe <Joh@praqma.net> Date: Mon Mar 02 08:55:52 2015 +0100 Updated info file on branch ready/anotherNewFeature commit a0038a7ad69ec0013013171de8958f95e0726066 Author: john Doe <Joh@praqma.net> Date: Mon Mar 2 20:55:52 2015 +0100 Added an info2 file on branch master

          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/GetAllCommitsFromBranchCallback.java
          src/test/java/org/jenkinsci/plugins/pretestedintegration/integration/scm/git/AccumulatedCommitMessageIT.java
          src/test/java/org/jenkinsci/plugins/pretestedintegration/integration/scm/git/AccumulatedCommitStrategyIT.java
          src/test/java/org/jenkinsci/plugins/pretestedintegration/integration/scm/git/TestUtilsFactory.java
          http://jenkins-ci.org/commit/pretested-integration-plugin/605041754b52c3f26df0f2b5c2f50a3af31a7304
          Log:
          JENKINS-26568: New accumulated commit message:

          The accumulated commit strategy is now using a commit message that is
          almost identical to the squash commit message. It includes the commit
          message of every included commit.

          Implementation change details:

          • Fixed the callback method, by limiting JGit tree walk to only work on
            branch and ignore master. That is, master commits are not collected
            and the tree walk stops.
          • Minor helper method implemented in TestUtilsFactory that can count
            commits on a branch.
          • All tests are moved to its own class, and there are tests written for
            a series of common cases. Each test case verifies selected text
            strings are in the new commit message.
          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/GetAllCommitsFromBranchCallback.java src/test/java/org/jenkinsci/plugins/pretestedintegration/integration/scm/git/AccumulatedCommitMessageIT.java src/test/java/org/jenkinsci/plugins/pretestedintegration/integration/scm/git/AccumulatedCommitStrategyIT.java src/test/java/org/jenkinsci/plugins/pretestedintegration/integration/scm/git/TestUtilsFactory.java http://jenkins-ci.org/commit/pretested-integration-plugin/605041754b52c3f26df0f2b5c2f50a3af31a7304 Log: JENKINS-26568 : New accumulated commit message: The accumulated commit strategy is now using a commit message that is almost identical to the squash commit message. It includes the commit message of every included commit. Implementation change details: Fixed the callback method, by limiting JGit tree walk to only work on branch and ignore master. That is, master commits are not collected and the tree walk stops. Minor helper method implemented in TestUtilsFactory that can count commits on a branch. All tests are moved to its own class, and there are tests written for a series of common cases. Each test case verifies selected text strings are in the new commit message.

          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/GetAllCommitsFromBranchCallback.java
          http://jenkins-ci.org/commit/pretested-integration-plugin/b3bfd2d5ec32945c22ff48a54e06d2d6eacfe413
          Log:
          JENKINS-26568: Static analysis code fixes

          Fixed some warnings from our build pipeline around our statis analysis
          of the code.

          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/GetAllCommitsFromBranchCallback.java http://jenkins-ci.org/commit/pretested-integration-plugin/b3bfd2d5ec32945c22ff48a54e06d2d6eacfe413 Log: JENKINS-26568 : Static analysis code fixes Fixed some warnings from our build pipeline around our statis analysis of the code.

          Code changed in jenkins
          User: Bue Petersen
          Path:
          README.md
          http://jenkins-ci.org/commit/pretested-integration-plugin/78d265c2e8fb0e8796c0e06ec24d916874977966
          Log:
          JENKINS-26568: Readme note on running tests on Win

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Bue Petersen Path: README.md http://jenkins-ci.org/commit/pretested-integration-plugin/78d265c2e8fb0e8796c0e06ec24d916874977966 Log: JENKINS-26568 : Readme note on running tests on Win

          Code changed in jenkins
          User: Bue Petersen
          Path:
          src/test/java/org/jenkinsci/plugins/pretestedintegration/integration/scm/git/AccumulatedCommitMessageIT.java
          http://jenkins-ci.org/commit/pretested-integration-plugin/df433874851e4136763701dcdda6758f9573a0df
          Log:
          JENKINS-26568: Made integation test Windows compl.

          Newline (unix) was used, so changed all strings in the tests to use
          string formattings that works on all platforms.

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Bue Petersen Path: src/test/java/org/jenkinsci/plugins/pretestedintegration/integration/scm/git/AccumulatedCommitMessageIT.java http://jenkins-ci.org/commit/pretested-integration-plugin/df433874851e4136763701dcdda6758f9573a0df Log: JENKINS-26568 : Made integation test Windows compl. Newline (unix) was used, so changed all strings in the tests to use string formattings that works on all platforms.

          People

            bue Bue Petersen
            andrius Andrius Ordojan
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: