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

Pretested Integration Plugin failed to clean all ready branches merged

    Details

    • Similar Issues:

      Description

      Sometimes developer pushed to another ready/ branch by typo, resulted in remote with 2 ready branches rooted from the same local branch. The pretested plugin does merge them, as following:

      ```
      21:08:13 > git show-ref --tags -d # timeout=10*21:08:13* [PREINT] Pretested Integration Plugin v3.0.0 (9fd14)21:08:13 [PREINT] Checking out integration branch master:21:08:13 > git config core.sparsecheckout # timeout=10*21:08:13* > git checkout -f origin/master*21:08:13* > git branch -a -v --no-abbrev # timeout=10*21:08:13* > git checkout -b master origin/master*21:08:13* [PREINT] Branch commit count: 2*21:08:13* [PREINT] Skip FF as there are several commits*21:08:13* [PREINT] Preparing to merge changes in commit 01cf8ca58f9afaed607c3214551f60ca1a5c828e on development branch origin/ready/vweng1 to integration branch master*21:08:13* Seen branch in repository origin/master*21:08:13* Seen branch in repository origin/ready/vw1*21:08:13* Seen branch in repository origin/ready/vweng1*21:08:13* Seen branch in repository origin/release*21:08:13* Seen branch in repository origin/vic*21:08:13* Seen branch in repository origin/vweng*21:08:13* Seen 6 remote branches*21:08:13* [PREINT] Collecting commit messages on development branch origin/ready/vweng1*21:08:13* [PREINT] Done collecting commit messages*21:08:13* [PREINT] Collecting author of last commit on development branch*21:08:13* [PREINT] Done collecting last commit author: Victor <xxxx@xxxx.xxx> 1519783628 -0500*21:08:13* [PREINT] Starting accumulated merge (no-ff) - without commit:21:08:13 > git merge --no-commit -m Accumulated commit of the following from branch 'origin/ready/vweng1':21:08:13 21:08:13 commit 01cf8ca58f9afaed607c3214551f60ca1a5c828e*21:08:13* Author: Victor <xxxx@xxxx.xxx>21:08:13 Date: Tue Feb 27 21:07:08 2018 -0500*21:08:13* 21:08:13 test*21:08:13* 21:08:13 21:08:13 commit d75c103d0d3a41fae8a37182c1e19530e576d3a2*21:08:13* Author: Victor <xxxx@xxxx.xxx>21:08:13 Date: Tue Feb 27 21:04:39 2018 -0500*21:08:13* 21:08:13 update*21:08:13* 21:08:13 21:08:13 --no-ff 01cf8ca58f9afaed607c3214551f60ca1a5c828e # timeout=10*21:08:13* [PREINT] Merge was successful*21:08:13* [PREINT] Starting to commit accumulated merge changes:21:08:13 > git commit -F /var/jenkins_home/workspace/c3_template@tmp/gitcommit7900359076344737293.txt # timeout=10*21:08:13* [PREINT] Commit of accumulated merge done*21:08:13* [PREINT] Commit was successful*21:08:13* > git rev-parse HEAD^{commit} # timeout=10*21:08:13* Seen branch in repository origin/master*21:08:13* Seen branch in repository origin/ready/vw1*21:08:13* Seen branch in repository origin/ready/vweng1*21:08:13* Seen branch in repository origin/release*21:08:13* Seen branch in repository origin/vic*21:08:13* Seen branch in repository origin/vweng*21:08:13* Seen 6 remote branches*21:08:13* > git show-ref --tags -d # timeout=10*21:08:13* Checking out Revision e79cf57fcf126d5992ef5d7b755a7cdc15acb594 ()21:08:13 > git config core.sparsecheckout # timeout=10*21:08:13* > git checkout -f e79cf57fcf126d5992ef5d7b755a7cdc15acb594*21:08:13* Commit message: "Accumulated commit of the following from branch 'origin/ready/vweng1':"21:08:13 First time build. Skipping changelog.21:08:13 Cleaning workspace*21:08:13* > git rev-parse --verify HEAD # timeout=10*21:08:13* Resetting working tree*21:08:13* > git reset --hard # timeout=10*21:08:13* > git clean -fdx # timeout=10
      ```

      but only able to remove one of the ready branch and left the other one behind. Upon next poll, the other one is picked up again but results in the following error:

      ```
      21:13:13 > git show-ref --tags -d # timeout=10*21:13:13* [PREINT] Pretested Integration Plugin v3.0.0 (9fd14)21:13:13 [PREINT] Checking out integration branch master:21:13:13 > git config core.sparsecheckout # timeout=10*21:13:13* > git checkout -f origin/master*21:13:13* > git branch -a -v --no-abbrev # timeout=10*21:13:13* > git checkout -b master origin/master*21:13:13* [PREINT] Branch commit count: 0*21:13:13* [PREINT] Skip FF as there are several commits*21:13:13* [PREINT] Preparing to merge changes in commit d75c103d0d3a41fae8a37182c1e19530e576d3a2 on development branch origin/ready/vw1 to integration branch master*21:13:13* Seen branch in repository origin/master*21:13:13* Seen branch in repository origin/ready/vw1*21:13:13* Seen branch in repository origin/release*21:13:13* Seen branch in repository origin/vic*21:13:13* Seen branch in repository origin/vweng*21:13:13* Seen 5 remote branches*21:13:13* [PREINT] Collecting commit messages on development branch origin/ready/vw1*21:13:13* [PREINT] Done collecting commit messages*21:13:13* [PREINT] Collecting author of last commit on development branch*21:13:13* [PREINT] Done collecting last commit author: Victor <xxxx@xxxx.xxx> 1519783479 -0500*21:13:13* [PREINT] Starting accumulated merge (no-ff) - without commit:21:13:13 > git merge --no-commit -m Accumulated commit of the following from branch 'origin/ready/vw1':21:13:13 21:13:13 --no-ff d75c103d0d3a41fae8a37182c1e19530e576d3a2 # timeout=10*21:13:13* [PREINT] Merge was successful*21:13:13* [PREINT] Starting to commit accumulated merge changes:21:13:13 [PREINT] [PREINT] - setUp() - NothingToDoException - Nothing to do. The reason is: No MERGE_MSG found in .git, there was nothing to merge*21:13:13* > git config core.sparsecheckout # timeout=10*21:13:13* > git checkout -f origin/master*21:13:13* > git branch -a -v --no-abbrev # timeout=10*21:13:13* > git branch -D master # timeout=10*21:13:13* > git checkout -b master origin/master*21:13:13* > git config core.sparsecheckout # timeout=10*21:13:13* > git checkout -f origin/ready/vw1*21:13:14* Checking out Revision d75c103d0d3a41fae8a37182c1e19530e576d3a2 (origin/ready/vw1)21:13:14 > git config core.sparsecheckout # timeout=10*21:13:14* > git checkout -f d75c103d0d3a41fae8a37182c1e19530e576d3a2*21:13:14* Commit message: "update"21:13:14 First time build. Skipping changelog.21:13:14 Cleaning workspace*21:13:14* > git rev-parse --verify HEAD # timeout=10*21:13:14* Resetting working tree*21:13:14* > git reset --hard # timeout=10*21:13:14* > git clean -fdx # timeout=10
      ```
      Can this be fixed?

        Attachments

          Activity

          Hide
          bue Bue Petersen added a comment -

          Sorry for the late reply, but that is expected behavior.

          There is no other good option - at least we think - than failing the build because we don't want to delete anything we did just integrate, like another branch-head pointing to the same commit.

           

           

          Show
          bue Bue Petersen added a comment - Sorry for the late reply, but that is expected behavior. There is no other good option - at least we think - than failing the build because we don't want to delete anything we did just integrate, like another branch-head pointing to the same commit.    
          Hide
          victorwon Victor Weng added a comment -

          Well, I thought the agreement of pretested flow is to remove any ready branch that's been integrated, why the plugin only removes one ready-branch instead of both in the 1st run when both got merged?

          Show
          victorwon Victor Weng added a comment - Well, I thought the agreement of pretested flow is to remove any ready branch that's been integrated, why the plugin only removes one ready-branch instead of both in the 1st run when both got merged?
          Hide
          bue Bue Petersen added a comment -

          If you have to ready-branches pointing to the same git commit, you're basically asking the plugin to integrate the same code change twice. And we're just telling you that is not possible, because it is already done.

           

          So I recommend not to push the same ready-branch twice.

          Show
          bue Bue Petersen added a comment - If you have to ready-branches pointing to the same git commit, you're basically asking the plugin to integrate the same code change twice. And we're just telling you that is not possible, because it is already done.   So I recommend not to push the same ready-branch twice.
          Hide
          bue Bue Petersen added a comment -

          > why the plugin only removes one ready-branch instead of both in the 1st run when both got merged?

           

          Actually we're only merging one branch

          Show
          bue Bue Petersen added a comment - > why the plugin only removes one ready-branch instead of both in the 1st run when both got merged?   Actually we're only merging one branch

            People

            • Assignee:
              praqma Praqma Support
              Reporter:
              victorwon Victor Weng
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: