Skip to content

Conversation

XN137
Copy link
Contributor

@XN137 XN137 commented Aug 29, 2025

follow-up to f8ad77a

we can simply use guava instead and eliminate the extra dependency

}

public static String sha256Hex(String input) {
return Hashing.sha256().hashString(input, StandardCharsets.UTF_8).toString();
Copy link
Contributor Author

@XN137 XN137 Aug 29, 2025

Choose a reason for hiding this comment

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

some basic local testing to confirm this produces the same results as org.apache.polaris.core.DigestUtils.sha256Hex:

Input: 
guava -> e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
codec -> e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
Input: foobar
guava -> c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2
codec -> c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2
Input: ajsdljaksl-92301928i390!@#$%^&*()_+
guava -> ee7a434dd148156b40dd00ad567c37dea7297ebccb6df0f7a5be064c97dcb18b
codec -> ee7a434dd148156b40dd00ad567c37dea7297ebccb6df0f7a5be064c97dcb18b
Input: 😀
guava -> f0443a342c5ef54783a111b51ba56c938e474c32324d90c3a60c9c8e3a37e2d9
codec -> f0443a342c5ef54783a111b51ba56c938e474c32324d90c3a60c9c8e3a37e2d9

@XN137 XN137 marked this pull request as ready for review August 29, 2025 18:11
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.

That sounds reasonable to me. I would suggest to update LICENSE to remove commons-codec mention there.

@github-project-automation github-project-automation bot moved this from PRs In Progress to Ready to merge in Basic Kanban Board Aug 30, 2025
@XN137 XN137 force-pushed the remove-commons-codec branch from 4f69623 to 2bdd239 Compare September 1, 2025 03:34
@XN137
Copy link
Contributor Author

XN137 commented Sep 1, 2025

thanks for the review

I would suggest to update LICENSE to remove commons-codec mention there.

i think while this PR removes a direct dependency on the library we still depend on it transitively and thus it ends up in our binary distribution:

unzip -l ./runtime/distribution/build/distributions/polaris-bin-1.1.0-incubating-SNAPSHOT.zip | grep commons-codec
   373045  1980-02-01 00:00   polaris-bin-1.1.0-incubating-SNAPSHOT/admin/lib/main/commons-codec.commons-codec-1.18.0.jar
   373045  1980-02-01 00:00   polaris-bin-1.1.0-incubating-SNAPSHOT/server/lib/main/commons-codec.commons-codec-1.18.0.jar

doesnt that mean we have to keep it in the LICENSE file?

generally wondering whether we have plans to move towards automatic creation/update of that file?
i would assume/hope this is a solved problem in the gradle ecosystem 😅

@jbonofre
Copy link
Member

jbonofre commented Sep 1, 2025

Yes, as it's still shipped in the distribution, we have to keep in the LICENSE.

I will open another PR to simplify a bit LICENSE. That's not so easy to have automatic script for that (especially for NOTICE). As already said, it's more an assist: the contributor still has to check what is actually embedded, and the affected part of the NOTICE.

By the way, I have a script to check the versions/dependency in the distributions.

@XN137 XN137 force-pushed the remove-commons-codec branch from 2bdd239 to ffd4310 Compare September 3, 2025 04:45
follow-up to f8ad77a

we can simply use guava instead and eliminate the extra dependency
@XN137 XN137 force-pushed the remove-commons-codec branch from ffd4310 to 4666358 Compare September 4, 2025 14:00
@dimas-b dimas-b merged commit cbdc12b into apache:main Sep 4, 2025
12 checks passed
@github-project-automation github-project-automation bot moved this from Ready to merge to Done in Basic Kanban Board Sep 4, 2025
@XN137 XN137 deleted the remove-commons-codec branch September 5, 2025 05:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants