geyanggang opened a new pull request, #15052:
URL: https://github.com/apache/gravitino/pull/15052

   ### What changes were proposed in this pull request?
   
   - Exclude `org/apache/hadoop/shaded/org/apache/avro/**` and 
`META-INF/maven/org.apache.avro/**` from the `shadowJar` of the AWS, Azure, 
GCP, Aliyun and Tencent bundles. The rule lives in the root `build.gradle.kts` 
next to `StripShadedAvroTransform`, reuses its path constants, and applies to 
the projects in the new `shadedAvroStrippedBundles` set.
   - Add a `Test<Cloud>BundleShadedAvro` test to each of the five bundles. It 
checks that the shaded jar no longer contains these entries. It also loads the 
bundle in an isolated class loader, creates the bundled cloud file system, 
reads the annotations of `Path` and `Text`, and writes and reads a local file 
through Hadoop `FileSystem`. The GCP, Aliyun and Tencent bundles get the same 
test setup that the AWS and Azure bundles already use.
   - Remove the two `org.apache.avro/[email protected]` entries from 
`.github/trivy/trivyignore.yaml`. Only these five bundles still reported that 
version.
   
   `StripShadedAvroTransform` cannot be reused for the bundles. The shadow 
plugin resolves the dependency files while it builds the task graph, before 
project jars exist, and the transform then fails with "Transform output ... 
must exist".
   
   ### Why are the changes needed?
   
   `hadoop-client-runtime` 3.3.6 shades Avro 1.7.7. #14532 strips this copy 
from the server-side runtime libraries, but the cloud bundles shade 
`hadoop-client-runtime` into their jars and still ship it. Within Hadoop, the 
shaded Avro only backs Avro serialization (SequenceFile, MapReduce job history, 
`hadoop fs -text`). The bundles do not use these code paths. Outside the Avro 
package, the only references to it in the bundles are from those Avro 
serialization classes, the job history classes, and Avro annotations on `Path`, 
`Text` and `DelegationKey`. The JVM ignores annotations whose classes are 
missing.
   
   Fixes #15051
   
   ### Does this PR introduce _any_ user-facing change?
   
   No. Each bundle jar loses 334 entries (about 455 KB). The jar's 
`META-INF/LICENSE` and `META-INF/NOTICE` are byte-identical to the current ones 
because the removed entries carry no legal documents.
   
   ### How was this patch tested?
   
   - `./gradlew -PskipITs 
:bundles:{aliyun,aws,azure,gcp,tencent}-bundle:build`. All new tests and the 
existing TLS tests pass.
   - Compared the entry lists of the old and new jars for all five bundles. The 
only removed entries are under the two excluded paths, and no entries were 
added.
   - `./gradlew testMavenLegalFiles rat`, `.github/trivy/scan.sh 
check-exemptions`, and `node --test .github/scripts/tests/*.test.cjs` (190 
passed).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to