Skip to content

Conversation

@elek
Copy link
Member

@elek elek commented Apr 29, 2021

This is the fixed version (handles ratis snapshots) of #2177

JIRA: https://issues.apache.org/jira/browse/HDDS-5144

What changes were proposed in this pull request?

hadoop-ozone/dist/src/main/license/bin/LICENSE.txt and hadoop-ozone/dist/src/main/license/bin/LICENSE.txt should be modified when the transitive dependencies are changed.

However, it's very easy to miss any dependency change when we bump versions. It's possible that we change only versions but we also introduce new jar files via transitive dependencies.

This happened (for example) in #2139 and #2065

To avoid any mistake I suggest the same approach what we use the protobuf compatibility check:

  1. commit the current list of the jar files to the repository
  2. create a check which compares the actual value with the committed one

If new dependency is introduced, the LICENSE file can be updated and the committed jar list also can be updated.

How was this patch tested?

Tested on my fork.

Example of failing builds:

https://github.com/elek/ozone/runs/2407951331?check_suite_focus=true

@elek elek requested a review from adoroszlai April 29, 2021 16:33
#sed expression removes the version. Usually license is not changed with version bumps
#jacoco and test dependencies are excluded
find . -type f -name "*.jar" | cut -c3- | perl -wpl -e 's/-[0-9]+(.[0-9]+)*(-SNAPSHOT)?+//g' | grep -v jacoco | grep -v hadoop-hdds-test-utils | sort > "$SCRIPTDIR"/$REPORT_NAME
find . -type f -name "*.jar" | cut -c3- | perl -wpl -e 's/-[0-9]+(.[0-9]+)*(-SNAPSHOT)?+//g' | perl -wpl -e 's/[0-9a-z]+-SNAPSHOT//g' | grep -v jacoco | grep -v hadoop-hdds-test-utils | sort > "$SCRIPTDIR"/$REPORT_NAME
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: the hash in snapshot jars could be handled by replacing (-SNAPSHOT)? with (-([0-9a-f]+-)?SNAPSHOT)?. One less perl command, no ugly - suffix in jar names.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good idea, thanks for the suggestion. Pushed the fix in b9b7dae, will merge it once we have a green build.

@adoroszlai
Copy link
Contributor

Thanks @elek for updating the patch. Merging it after a green build.

@adoroszlai adoroszlai merged commit 00eba3e into apache:master May 4, 2021
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.

2 participants