Skip to content

Resolving Skara mirror job "Merge Conflicts"

Andrew Leonard edited this page Sep 23, 2024 · 7 revisions

Problem

Occasionally the git-skara-REPO mirror jobs will fail due to a merge conflict, typically in the common/autoconf/generated-configure.sh file. The likely cause is an adoptium patch which causes a re-gen of this file, conflicts with an upstream change.

Prereqs

Solution

  1. Clone mirror-scripts:
git clone https://github.com/adoptium/mirror-scripts.git
cd mirror-scripts
  1. Run the mirror script as run by the mirror job. Check the job Configuration Build Steps->Shell execute command, eg.https://ci.adoptium.net/view/git-mirrors/job/git-mirrors/job/adoptium/job/git-skara-jdk8u/configure, but for the required Skara job. So for example for jdk8u:

bash ./skaraMirror.sh jdk8u [email protected]:adoptium/jdk8u.git

It should fail with the merge conflict the same as the jenkins job. Most likely common/autoconf/generated-configure.sh.

  1. The merge conflict will typically either come from trying to merge a new master branch tag into the release branch, OR the merge of the master HEAD into the dev branch. Handle each of these scenarios as follows.

Conflict during new tag merge into "release" branch, message: "Merging build tag <TAG> into release branch"

  1. The following messages will be seen for a new tag merge conflict into the release branch:
Merging build tag <TAG> into release branch
+ git merge -m"Merging <TAG> into release" <TAG>
CONFLICT (content): Merge conflict in common/autoconf/generated-configure.sh
  1. Resolve the conflict by going into the merge workspace repo (eg. workspace/jdk8u) and resolving accordingly. (Typically if the conflict is ONLY common/autoconf/generated-configure.sh, then simply re-generating it by running common/autoconf/autogen.sh is the simplest solution, for others investigation will be required):
cd workspace/dk8u
git status (check conflict information)
bash common/autoconf/autogen.sh (if just common/autoconf/generated-configure.sh, otherwise resolve manually...)
git add common/autoconf/generated-configure.sh (or others if resolved manually)
git commit -s -m"Resolve merge conflict"
  1. Complete the merge by tagging the resultant commit, replacing <TAG> with the tag from the "Merging build tag <TAG> into release branch" message from the skaraMirror.sh script output:
git tag -a "<TAG>_adopt" -m "Merged <TAG> into release"
  1. Push the resolved conflict to the remote repo release branch:
git push --tags origin release
  1. Now return to the mirror-scripts base directory and re-run the skaraMirror.sh again to see if it now succeeds, if not there is probably another conflict, thus repeat.

Conflict during merge of "master" branch HEAD into the "dev" branch, message: "Merging origin/master HEAD into dev branch"

  1. The following messages will be seen for a master HEAD merge conflict into the dev branch:
Merging origin/$BRANCH HEAD into $DEV_BRANCH branch
+ git merge -m"Merging origin/master HEAD into dev" origin/master
CONFLICT (content): Merge conflict in common/autoconf/generated-configure.sh
  1. Resolve the conflict by going into the merge workspace repo (eg. workspace/jdk8u) and resolving accordingly. (Typically if the conflict is ONLY common/autoconf/generated-configure.sh, then simply re-generating it by running common/autoconf/autogen.sh is the simplest solution, for others investigation will be required):
cd workspace/dk8u
git status (check conflict information)
bash common/autoconf/autogen.sh (if just common/autoconf/generated-configure.sh, otherwise resolve manually...)
git add common/autoconf/generated-configure.sh (or others if resolved manually)
git commit -s -m"Resolve merge conflict"
  1. Complete the dev branch merge processing by merging the latest "release" branch into the "dev" branch:
git merge -m"Merging latest patches from release branch" "origin/release"
  1. Push the resolved conflict to the remote repo dev branch:
git push origin dev
  1. Now return to the mirror-scripts base directory and re-run the skaraMirror.sh again to see if it now succeeds, if not there is probably another conflict, thus repeat.