Ticket #6964 (closed: fixed)

Opened 7 years ago

Last modified 5 years ago

Add a check to the 'git test start' workflow macro that a branch has not been started from develop

Reported by: Russell Taylor Owned by: Martyn Gigg
Priority: major Milestone: Release 2.6
Component: Infrastructure Keywords: Maintenance
Cc: Blocked By:
Blocking: Tester: Nick Draper

Description

The scriptlet from the Jenkins job:

#!/bin/sh
MERGES=`git log | grep Merge.*into.*develop`
if [ -n "$MERGES" ]; then
  echo "The current branch appears to have been based off of develop, or has had develop merged into it. This needs to be fixed!"
  exit 1
fi

I'm fairly confident that the script won't produce false positives so would make it a 'hard' check. It may be prudent to limit the number of commits the check looks at (the Jenkins job will continue to examine the full history.

Change History

comment:1 Changed 7 years ago by Nick Draper

  • Status changed from new to assigned
  • Owner set to Martyn Gigg

comment:2 Changed 7 years ago by Martyn Gigg

  • Keywords Maintenance added

comment:3 Changed 7 years ago by Martyn Gigg

Add check to git-test for branch origin.

It will now exit if the branch has been started from develop or has had develop merged in. Refs #6964

Changeset: 7416f1ae01b1d28129526ae9ab230d1bc24f7f9d

comment:4 Changed 7 years ago by Martyn Gigg

Make 'git test fail' more tolerant of bad merges/rebases.

If a 'test start' merge fails then fail can now just reset without having to run 'git merge --abort'. Refs #6964

Changeset: b54b6d42b70f83722dfbe44f899486b7b3aec2d0

comment:5 Changed 7 years ago by Martyn Gigg

Add check to git-test for branch origin.

It will now exit if the branch has been started from develop or has had develop merged in. Refs #6964

Changeset: 7416f1ae01b1d28129526ae9ab230d1bc24f7f9d

comment:6 Changed 7 years ago by Martyn Gigg

Make 'git test fail' more tolerant of bad merges/rebases.

If a 'test start' merge fails then fail can now just reset without having to run 'git merge --abort'. Refs #6964

Changeset: b54b6d42b70f83722dfbe44f899486b7b3aec2d0

comment:7 Changed 7 years ago by Martyn Gigg

Make 'git test fail' more tolerant of bad merges/rebases.

If a 'test start' merge fails then fail can now just reset without having to run 'git merge --abort'. Refs #6964

Changeset: 783a4e4511be929a3285222ae2cc0993d82882a9

comment:8 Changed 7 years ago by Martyn Gigg

Make 'git test fail' more tolerant of bad merges/rebases.

If a 'test start' merge fails then fail can now just reset without having to run 'git merge --abort'. Refs #6964

Changeset: 783a4e4511be929a3285222ae2cc0993d82882a9

comment:9 Changed 7 years ago by Martyn Gigg

  • Status changed from assigned to accepted

comment:10 Changed 7 years ago by Martyn Gigg

  • Status changed from accepted to verify
  • Resolution set to fixed

Branch: feature/6964_git_test_macro_check_develop

Tester - Two things two check:

  • Start a branch based of develop and verify that git test start refuses to start testing it.
  • git test fail should now be able to abort failed merges/rebases on master,i.e if git test start causes a merge conflict then 'git test fail' should now be able reset to origin/master.

comment:11 Changed 7 years ago by Nick Draper

  • Status changed from verify to verifying
  • Tester set to Nick Draper

comment:12 Changed 7 years ago by Nick Draper

re #6964 test file added to test branch

Changeset: bea810f8006a76c2de4db6fcc2319ea4233091fd

comment:13 Changed 7 years ago by Nick Draper

Good handling of develop sourced branches

$ git test start 007
git fetch -p
ERROR: The branch 'test/007_no_branches_from_develop' appears to have been based
 off of develop, or has had develop merged into it.
This needs to be fixed. Reopen the ticket & contact Nick Draper on nick.draper@s
tfc.ac.uk (or via skype).

comment:14 Changed 7 years ago by Nick Draper

re #6964 test file for conflict

Changeset: 676f89c742634808e2f0633b603f60a66be15c90

comment:15 Changed 7 years ago by Martyn Gigg

Add check to git-test for branch origin.

It will now exit if the branch has been started from develop or has had develop merged in. Refs #6964

Changeset: 7416f1ae01b1d28129526ae9ab230d1bc24f7f9d

comment:16 Changed 7 years ago by Martyn Gigg

Make 'git test fail' more tolerant of bad merges/rebases.

If a 'test start' merge fails then fail can now just reset without having to run 'git merge --abort'. Refs #6964

Changeset: 783a4e4511be929a3285222ae2cc0993d82882a9

comment:17 Changed 7 years ago by Nick Draper

and finally managed to engineer a conflict

Auto-merging Code/Mantid/Framework/Crystal/CMakeLists.txt
CONFLICT (content): Merge conflict in Code/Mantid/Framework/Crystal/CMakeLists.t
xt
Automatic merge failed; fix conflicts and then commit the result.
rrc79113@NDW1207 /C/Mantid/Code (master|MERGING)
$ git test fail
Resetting master reset to origin/master
git merge --abort
git reset --hard origin/master
HEAD is now at 6b3f0f4 Merge remote-tracking branch 'origin/feature/7056_data_st
itching_api2'
rrc79113@NDW1207 /C/Mantid/Code (master)

comment:18 Changed 7 years ago by Nick Draper

  • Status changed from verifying to closed

comment:19 Changed 7 years ago by Martyn Gigg

Merge branch 'feature/6964_git_test_macro_check_develop' into develop into 6856_ConvertToDiffractionMDWS_v2

comment:20 Changed 7 years ago by Nick Draper

Merge branch 'test/007_no_branches_from_develop' into develop into 6856_ConvertToDiffractionMDWS_v2

comment:21 Changed 7 years ago by Martyn Gigg

Merge branch 'feature/6964_git_test_macro_check_develop' into develop into 6856_ConvertToDiffractionMDWS_v2

comment:22 Changed 7 years ago by Nick Draper

Merge branch 'test/007_no_branches_from_develop' into develop into 6856_ConvertToDiffractionMDWS_v2

comment:23 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 7810

Note: See TracTickets for help on using tickets.