-
Notifications
You must be signed in to change notification settings - Fork 651
[ISSUE]: GitVersion 6.0.5 fails to calculate the version and says the repo is shallow #4348
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
Comments
For some more context, I'm having the exact same issue as #4094 as well
Output from Azure pipelines
https://github.com/GitTools/actions/blob/main/docs/cloning.md says to use the below
But as you can see, I've set the same thing and it fails |
If I see the following log output I would say that a native git command is used to determine whether or not a shallow checkout happens:
Have you tried this git command by yourself? What is the outcome? Why do you think it is a problem in GitVersion and not in git? Have you thought about that your repository is corrupt? Can you provide steps to reproduce? Question about question. |
Well that's the weird part - when I run with I just tested it with the git command above and it shows the same as above - shallow for v6 but not for v5 I did think it could be a corrupt repo, but this is my preceding step
It's scorching the repo before it pulls it and starts from a clean slate each time I believe that using the above config in my original post should allow you to reproduce the issue within an ADO environment As a workaround, I've updated my ADO tasks to this
I've added in 10 retries on the setup and calculate steps - we see bizarre behaviour where sometimes the pipeline will fail to determine the version with an error, but if we run it again, it works That would imply an issue with the pipeline agent, but we're using Docker to spawn pristine containers each time with their own clean working environment (not that it really matters because it fresh clones the repo each time anyway) And on the Git checkout step, I see this (with
So it's definitely unshallow, but on that same run I got this
|
We have been experiencing similar issues since upgrading to version 6.x. It seems to fail approx 1-2% of the time on our build agents. Sometimes the only way we can get the build completed is to kill the specific agent that it has been previously failing on. We didn't experience any shallow clone issues like this using version 5.x either. |
I'm not sure if it is constructive to repeat the sentence that it was working in version
I mean you have not answered the question what the result is of using native git command. What are you expecting from the community? The following line is used to detect shallow clones:
For this the Thank you very much. |
I also had this issue. At least for Azure DevOps set this before all the steps in your job and that should help to resolve it. |
Hey @SoucianceEqdamRashti that did the trick! This now works
Using this GitVersion config (needed tweaking for v6)
|
Hey @SoucianceEqdamRashti can you create a PR in the https://github.com/GitTools/actions/blob/main/docs/examples/azure/gitversion/setup.md#usage-examples as well? |
Is this considered a fix 😱? |
Prerequisites
GitVersion package
AzureDevops task, GitVersion.Tool
GitVersion version
6.0.5 and 5.12.0
Operating system
Linux
What are you seeing?
Here is my
5.12.0
config that worksI'm using the actual GitVersion commands rather than the ADO task because we keep getting random errors with
5.12.0
- sometimes it works and sometimes it fails witherror: undefined message
Now when I change the below config options for version
6.0.5
, it doesn't workI just get this error
And as you can see above, it's lying to me - this is definitely a shallow clone
What is expected?
I know with v6 I have to make some config changes to
gitversion.yml
which I've done - yet the error doesn't make sense because IT IS a full clone of the repoSteps to Reproduce
Use the above config to make a pipeline with the defined config and run it
It should work with
5.12.0
and fail with6.0.5
RepositoryFixture Test
No response
Output log or link to your CI build (if appropriate).
The text was updated successfully, but these errors were encountered: