-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Ignore GIT_COMMIT when calculating commit hash #28082
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
Conversation
When finding the commit hash for the build to place in the JAR manifest (which is used to identity the build), the scm-info plugin assumes that GIT_COMMIT is the commit for this build. That assumption is wrong, this build could be a sub-build of another build that GIT_COMMIT belongs to. If GIT_COMMIT is set, we ignore the commit hash calculated by scm-info and calculate the hash ourselves.
rjernst
left a comment
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.
LGTM
| * is the commit hash for that build. Therefore, if GIT_COMMIT is set we calculate the commit hash ourselves. | ||
| */ | ||
| if (System.getenv("GIT_COMMIT") != null) { | ||
| def hash = new RepositoryBuilder().findGitDir(project.buildDir).build().resolve(Constants.HEAD).name |
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.
String instead of def please?
When finding the commit hash for the build to place in the JAR manifest (which is used to identity the build), the scm-info plugin assumes that GIT_COMMIT is the commit for this build. That assumption is wrong, this build could be a sub-build of another build that GIT_COMMIT belongs to. If GIT_COMMIT is set, we ignore the commit hash calculated by scm-info and calculate the hash ourselves. Relates #28082
When finding the commit hash for the build to place in the JAR manifest (which is used to identity the build), the scm-info plugin assumes that GIT_COMMIT is the commit for this build. That assumption is wrong, this build could be a sub-build of another build that GIT_COMMIT belongs to. If GIT_COMMIT is set, we ignore the commit hash calculated by scm-info and calculate the hash ourselves. Relates #28082
When finding the commit hash for the build to place in the JAR manifest (which is used to identity the build), the scm-info plugin assumes that GIT_COMMIT is the commit for this build. That assumption is wrong, this build could be a sub-build of another build that GIT_COMMIT belongs to. If GIT_COMMIT is set, we ignore the commit hash calculated by scm-info and calculate the hash ourselves. Relates #28082
When finding the commit hash for the build to place in the JAR manifest (which is used to identity the build), the scm-info plugin assumes that GIT_COMMIT is the commit for this build. That assumption is wrong, this build could be a sub-build of another build that GIT_COMMIT belongs to. If GIT_COMMIT is set, we ignore the commit hash calculated by scm-info and calculate the hash ourselves. Relates #28082
|
Is it possible that something went wrong with this patch? If I download build snapshot from https://download.elastic.co/esvm/snapshots/6.1.zip it contains {
"name" : "q9gSC4_",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "zNOfg0gQTwC0UFDoVjEcpg",
"version" : {
"number" : "6.1.2",
"build_hash" : "esCommi",
"build_date" : "2018-01-04T18:42:14.730Z",
"build_snapshot" : true,
"lucene_version" : "7.1.0",
"minimum_wire_compatibility_version" : "5.6.0",
"minimum_index_compatibility_version" : "5.0.0"
},
"tagline" : "You Know, for Search"
}// Related to elastic/elasticsearch-php#711 |
|
There's no chance that was caused by this change. It was caused by this change to the esvm snapshot builder. I've reached out internally to have it fixed. |
Remove GIT_COMMIT setting, since it didn't work and elastic/elasticsearch#28082 is merged
|
@mhujer Sorry about the hasty fix/bug, https://download.elastic.co/esvm/snapshots/6.1.zip is correct now: {
"name" : "Ldm-0Ow",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "gsH7uboEQWKUrmK43z_nBQ",
"version" : {
"number" : "6.1.2",
"build_hash" : "e345797",
"build_date" : "2018-01-04T20:58:28.717Z",
"build_snapshot" : true,
"lucene_version" : "7.1.0",
"minimum_wire_compatibility_version" : "5.6.0",
"minimum_index_compatibility_version" : "5.0.0"
},
"tagline" : "You Know, for Search"
} |
|
Thanks for fixing it! 👍 |
When finding the commit hash for the build to place in the JAR manifest (which is used to identity the build), the scm-info plugin assumes that GIT_COMMIT is the commit for this build. That assumption is wrong, this build could be a sub-build of another build that GIT_COMMIT belongs to. If GIT_COMMIT is set, we ignore the commit hash calculated by scm-info and calculate the hash ourselves.