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
[Feature] GitVersion Fails with GitVersion.BugException on New Commits in Running Pipeline #3718
Comments
Note that the issue also occurs when re-running a pipeline on old commits, it is not limited to race condition cases only. |
I found the following definition what normalization does:
If we take this definition my naive assumption would be:
If you get such an error on step two only when you have no sequential pipeline runs I would say the problem is not located in GitVersion right? Because GitVersion needs a stable workspace with no interdifferences from ohter build runs. Have you checked that the build pipeline configuration:
|
If this is the case then please create an integration test to reproduce it in an isolated environment. Maybe this example can help: #3351 (comment) Thank you! |
Got the same issue
git log --graph --format="%h %cr %d" --decorate --date=relative --all --remotes=* -n 100 IGNORE_NORMALISATION_GIT_HEAD_MOVE == 1 result a 0.0.1 version </3 UPD: UPD[2]: UPD[3]: |
Is there a workaround? For me it only fails on pipelines that didn't start with a tag. For example merge request pipelines. Edit: |
@DefinitelyADev did you disable cache for gitlab runner or disable cache for job? |
@nluzgin i tried both. |
Describe the bug
GitVersion fails with a
GitVersion.BugException
when pushing new commits to a running pipeline branch. The error message suggests that the HEAD moves unexpectedly during repo normalization.Expected Behavior
GitVersion should complete successfully without exceptions when new commits are pushed to the branch that has a running pipeline.
Actual Behavior
When a new commit is pushed to a running pipeline branch, GitVersion fails with a
GitVersion.BugException
error. Re-executing pipeline on past commits on a branch immediately results in failure as well.Possible Fix
N/A
Steps to Reproduce
Example: After creating a branch the pipeline executes the job "versioning1" and "versioning2" successfully. After adding an additional commit to the branch, the running pipeline's remaining job "versioning3" fails. Although GitLab performs a detached HEAD checkout,
git clone
picks up the new unrelated commit and GitVersion is unable to normalize.Context
Our team is unable to commit while another pipeline is running on the same branch.
IGNORE_NORMALISATION_GIT_HEAD_MOVE
suppresses the exception, however the code running afterGitVersion
will work on the wrong commit./nonormalize
avoids the issue, however, it is not clear whether there are side-effects. We suspect there is a reason for normalization.Your Environment
We use an on-prem GitLab instance. Once the error is established on the GitLab project, the error can be reproduced locally without GitLab. The prerequisite is that there is a remote defined and two environment variables are set:
The text was updated successfully, but these errors were encountered: