-
-
Notifications
You must be signed in to change notification settings - Fork 173
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
Nuget Package Version and nbgv cloud NBGV_NuGetPackageVersion differ #451
Comments
Can you include a diagnostic build log? ( |
Produced by running
in this repo. |
BTW, the difference isn't in the package vs. the CLI. The difference is whether the version calculation is from the repo root or the project directory. |
That may be reasonable behavior. If you’re using it to generate multiple package versions don’t know how else you would deal with it.
…Sent from my iPhone
On Mar 14, 2020, at 11:46, Andrew Arnott ***@***.***> wrote:
BTW, the difference isn't in the package vs. the CLI. The difference is whether the version calculation is from the repo root or the project directory.
So @epvanhouten, a workaround for you would be to pass the -p sub-dir argument when calling nbgv so that the relative path is the same as the path that contains the project being packed.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Well, since version.json was defined only once in the root, and the pathfilter indicated |
Sorry I was thinking in the model of having multiple version.json files. Yes nbgv cloud on any directory under a version.json should be consistent with the packages produced by those projects. But if you have multiple version.json files running around you’re going to need to tell nbgv cloud, by cding or passing the path, the correct sub tree to calculate a version for.
This is probably an obvious clarification, but more for my own benefit.
…Sent from my iPhone
On Mar 14, 2020, at 13:26, Andrew Arnott ***@***.***> wrote:
Well, since version.json was defined only once in the root, and the pathfilter indicated ., that I would expect to mean all files and directories at the repo root and below. So I expect the same version throughout.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
I'm seeing a similar issue, but even after removing the path filters it doesn't seem to work. I'm using GitHub Actions and I see that my NuGet package I'm producing gets a different version number then when I try to restore that same NuGet package later on in a different job. For some reason the NuGet package version being calculated is two Git commits higher than what's being set by nbgv cloud. Interestingly running nbgv cloud locally on my development machine produces the correct version number. This is kinda driving me crazy. Feel free to have a look at my repo. For example, in this CI Workflow I'm seeing that |
Applying @AArnott's workaround of specifying the sub path explicitly when running |
I'm glad the workaround worked, @jmezach. |
Probably because you didn't rewrite your past commits. NB.GV is a git history based algorithm so if your |
For what it's worth, we've been using path filters on dozens of packages at our company with no issues. Although from the comments in this ticket, it appears this issue is only happening with NBGV cloud? I could certainly set aside some time to dig into this. |
Thanks, @saul! A bit more info to help you: Here are the pathFilters used in the two folks who have reported version mismatches: rr-wfm/MSBuild.Sdk.SqlProj@9cbba15 |
Any progress, @saul? |
Hi - I did spend a couple of hours on Friday afternoon looking into this but it wasn't immediately obvious how I could fix it. I'm setting aside more time tomorrow in the working day to dig deeper. Is there an easier way to communicate with you both instead of GitHub comments? I may have some more questions re the cloud functionality. Thanks |
Yes: you can find me on gitter.im. this repo has a room there. But again, this has nothing to do with the cloud feature, and everything to do with the "projectDirectory" used to start the version calculation. |
OK so my understanding of the problem is that when building a project, I believe the bug here is that relative paths should always be relative to the |
Fixes dotnet#451 Path were incorrectly relative to the project directory.
Opened #465 which fixes this |
Nerdbank.GitVersioning Version 3.1.68
version.json
Results in package like
<Package Name>.0.2.0-g49454ca976.nupkg
andNBGV_NuGetPackageVersion
like0.2.1-g49454ca976
.The text was updated successfully, but these errors were encountered: