-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Build: Add iceberg-build.properties to Jars and release process #5236
Conversation
|
||
# remove the uncommitted build files so they don't affect the current working copy | ||
rm $projectdir/version.txt | ||
rm $projectdir/iceberg-build.properties |
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.
This wasn't needed before because the version.txt
file was committed. When switching back to the master branch, it would be removed because it isn't present in the master branch.
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.
Will there be any commit specifically for the release or will it simply be the last commit that goes into the release branch? Previously the version.txt commit wound up being the source release commit.
To be clear, I am definitely in agreement on removing the git commit
from this script. It has caused several people issues while testing releasing in the past or when the release script needed to be rerun for the same RC candidate.
@@ -51,7 +51,7 @@ try { | |||
gitPropertiesName = 'iceberg-build.properties' | |||
gitPropertiesResourceDir = file("${rootDir}/build") | |||
extProperty = 'gitProps' | |||
failOnNoGitDirectory = false | |||
failOnNoGitDirectory = true |
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.
Will this cause build verification to fail? If we're downloading the tarball and building from that will the build fail?
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.
No, this actually doesn't do much. The plugin is configured in a try/catch after the Palantir version plugin. So if there is not .git directory, this code doesn't even run.
Eventually, we should see if this can be moved outside of the try/catch, which was my intent here. I think that if generateGitProperties
is called and it can't, then we want to have a failure. That's why this introduces a new task, buildInfo
that will use the properties file in the build root if it is present. The failure we want is when you have no .git
directory and have no iceberg-build.properties
file.
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.
I tried without the try catch and having gitProperties
in the build file causes even simple tasks like gradle tasks
to fail because the surrounding gitProperties
block is not registered and has no meaning to gradle. Even if it’s not used, such as gradle clean
.
So my observation was that the try-catch block will always be needed for any gitProperties
block.
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.
I think this flag is more for the case that somebody overrides the .git
directory - which the plug-in allows - and that overridden directory isn’t present (at least from my testing). But git is still present so the plug-in is able to be applied in general.
Ryan’s right that it doesn’t do much and the flag won’t cause the build to fail when using the tarball.
I created 0.14.0-rc0 to test out the I also verified that release and everything looks good:
|
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
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.
This LGTM.
Will this place Things in Possibly that’s going to be handled in a follow up though (if needed at all). I’m less familiar with gradle than you are and this differs slightly from the way I was testing it before, so this could be fine. |
This ensures that
iceberg-build.properties
is added to Jars produced by the Gradle build, even when building from a source tarball with no.git
directory.This builds on the
generateGitProperties
task added in #5228 and updates the build:buildInfo
ensures thatbuild/iceberg-build.properties
exists, either by copying it from the source root or by callinggenerateGitProperties
(change intasks.gradle
)iceberg-build.properties
from the rootbuild
folder (change indeploy.gradle
)iceberg-build.properties
and add it to the root folder for the release candidate tarball (changes insource-release.sh
)Note that this also changes how release tarballs are created. Previously, the
source-release.sh
script would createversion.txt
and commit the file, then tag the commit withversion.txt
. This wasn't possible for addingiceberg-build.properties
becauseiceberg-build.properties
needs to describe the git commit in the source tarball (and can't be included in the commit itself). Instead of adding the file to git, this adds bothversion.txt
andiceberg-build.properties
directly to the archive usinggit archive ... --add-file
. A side benefit is that we will no longer have release tags off of the master branch.