-
Notifications
You must be signed in to change notification settings - Fork 585
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
Git.Information doesn't work properly for VSO builds #933
Comments
definitely ... so we need to change that to be a fallback behavior. But why are your environment variables empty? and if you don't have the sha1 hash how do you make sure to get the correct one? |
I try to send a PR as soon as I can. |
@matthid, don't know why environment variables are empty, I'll verify one more time today to be sure. |
are the env variables empty afteer you set -ev JENKINS_HOME or also before? |
@vlukash Yes but IIRC the current hash (HEAD) is set in the ".git" folder, which you are copying from somewhere else, so you can't really be sure that the hash you get with |
Here are more detailed info for two types of VSO build (both are using on-premises build server): XAML build: vNext build Only one difference in getCurrentHash() that in /////////////////////// |
@matthid you are right, got your point about "can't really be sure that the hash you get with getCurrentHash is the one you are building". |
Ok I changed the behavior in #937, but it is a really close call. On the one hand if someone puts so much work into getting the wrong result he should get it... On the other hand it looks to be a common pitfall to copy the
Should we only return the first 6 characters to match the regular call? Does it matter anywhere? |
@matthid Some thoughts about getCurrentHash and relation to actual hash that I'm building. In the very beginning of build VSO copies (of just synchronizing) .git to build folder on build agent. In both cases (XAML, vNext). Based on this, current HEAD hash (and value that getCurrentHash returns) always will be the one I'm building and it is configured by VSO. I've tested this in vNext builds - BUILD_SOURCEVERSION and HEAD from git are always equal even when I set specific commit number to build. Please correct me if I wrote something wrong |
This would be awesome! Should we integrate the copying process into FAKE? Or at least provide a API for it? |
use TFS variables as fallback, fixes #933
@matthid Maybe I've explained it not very well, but under "copying" .git folder I meant something like "git clone" command executed by VSO itself. I use VSO as a repository for git project. and when I trigger new build VSO creates (clones from origin) this local .git folder on build server for me. And then VSO checkouts branch or commit that should be built and set HEAD to specific commit. So all this functionality is already build-in into VSO+build agent |
@matthid Thanks for fixing this issue! |
Seems like starting from 4.2.0 version some methods from Git.Information module doesn't work properly for VSO builds any more.
I'm using on-premises build server in VSO and both XAML and vNext builds.
And starting from 4.2.0 methods like getCurrentHash() and showName (".") methods return empty string.
In both cases (XAML and vNext) .git folder is copied into workdirectory during build, so as a workaround I just define
-ev JENKINS_HOME
NOTE:
environVar "BUILD_SOURCEVERSION"
and
environVar "BUILD_NUMBER"
are empty during build.
The text was updated successfully, but these errors were encountered: