-
-
Notifications
You must be signed in to change notification settings - Fork 314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do a hard reset if tck update fails and try git pull again #3978
Conversation
e0f6496
to
c25de62
Compare
Signed-off-by: Mesbah Alam <Mesbah_Alam@ca.ibm.com>
c25de62
to
3f04c94
Compare
Step 1: Error reproduced on Grinder_JCK/668: Additional test where local repo is already up-to-date: Grinder_JCK/675. |
Verified in TC Grinder/1815 |
<exec executable="git" dir="${JCK_ROOT_USED}" failonerror="true"> | ||
<arg value="reset" /> | ||
<arg value="--hard" /> | ||
<arg value="origin/master" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we need to reset to origin/master, then clean and pull again? Could we just hard reset to ${JCK_GIT_REPO_USED} ${jck_branch}
directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had tried reset --hard ${JCK_GIT_REPO_USED} ${jck_branch}
but that didn't seem to work in our case. The change in the PR had worked. I am not sure about the difference. I think we can merge this and see if the problem ever comes back again - if it does we can try other ways.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any idea what error we get when we do reset --hard ${JCK_GIT_REPO_USED} ${jck_branch}
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have seen the merge conflict remain after reset --hard ${JCK_GIT_REPO_USED} ${jck_branch}
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw, here origin = {JCK_GIT_REPO_USED}
; e.g. Grinder_JCK/672/console. The git clean
is just added as an extra step to clean up any possible garbage left behind after the reset.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you try just git reset --hard
?
I don't really like hardcoding origin/master since those names are not guaranteed. Especially since master is being renamed to main.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you try just git reset --hard?
- yes, and that did not get rid of the merge conflict.
"Especially since master is being renamed to main." - do you mean in our internal JCK repos?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Talked with @Mesbah-Alam , we think it is the best solution so far. We will merge it and monitor the result.
If there are changes in local tck repo on disc in a Jenkins machine, the default git pull results in a merge conflict and the build fails.
If this merge conflict occurs, this PR will catch it and clean up any local changes by performing a
git --reset hard
and agit clean
, andgit pull
again.Related backlog issue: backlog/issues/705
Signed-off-by: Mesbah Alam Mesbah_Alam@ca.ibm.com