Skip to content

Conversation

@RussellSpitzer
Copy link
Member

Fixes #12926

The underlying issue is that we automatically bumped the Git Properties plugin which now uses a slightly different mechanism for determining what the version of the project is from before. To avoid any issues in the future, I decided to just explicitly pass in our custom version function to the plugin.

I then added a few tests to check that we don't have an undefined value and if a version.txt file is present make sure it matches.

@Test
public void testVersionMatchesFile() throws IOException {
Path versionPath = Paths.get("../version.txt").toAbsolutePath();
assumeThat(java.nio.file.Files.exists(versionPath)).isTrue();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

If we set the project.version in the system property for tests in build.gradle

test {
    systemProperty "project.version", project.version
}

we can always check

assertThat(IcebergBuild.version())
        .isEqualTo(System.getProperty("project.version"))

This way we don't need two testcase and also it won't be a conditional test.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's a good suggestion, but I really want to test that file. I'm trying to test against the thing we know must be correct. We basically directly pipe this value into version.txt in our source-release script. If we somehow bungle gradle in the future and that value doesn't match the text file for whatever reason I'd like to know. I can add this test as well as an assert though

Copy link
Member

@ajantha-bhat ajantha-bhat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The underlying issue is that we automatically bumped the Git Properties plugin which now uses a slightly different mechanism for determining what the version of the project is from before

Thanks for digging into this issue and fixing it 👍

Copy link
Contributor

@singhpk234 singhpk234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM !

Copy link
Contributor

@HonahX HonahX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

assertThat(IcebergBuild.version()).isNotEqualTo("unspecified");
}

@Test
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ajantha-bhat Added this test, all good?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

Copy link
Contributor

@amogh-jahagirdar amogh-jahagirdar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @RussellSpitzer!

@amogh-jahagirdar
Copy link
Contributor

I'll go ahead and merge, thank you @RussellSpitzer for digging into it, and thanks @ajantha-bhat @singhpk234 @HonahX for reviewing. Thank you @sullis for reporting this issue as well!

@amogh-jahagirdar amogh-jahagirdar merged commit 696a72c into apache:main May 2, 2025
43 checks passed
Copy link
Member

@jbonofre jbonofre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (sorry I'm just waking up :)).

Copy link
Contributor

@sullis sullis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@RussellSpitzer RussellSpitzer deleted the FixBuildVersionNumber branch May 4, 2025 04:06
@RussellSpitzer RussellSpitzer restored the FixBuildVersionNumber branch May 6, 2025 14:39
@RussellSpitzer RussellSpitzer added this to the Iceberg 1.9.1 milestone May 12, 2025
@RussellSpitzer RussellSpitzer deleted the FixBuildVersionNumber branch May 12, 2025 20:33
RussellSpitzer added a commit to RussellSpitzer/iceberg that referenced this pull request May 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Core, Release: 1.9.0 Build Version() returns Unspecified due to incorrect packaged iceberg-build.properties

7 participants