HBASE-30338 Restore the shaded jar content check - #8561
Open
junegunn wants to merge 1 commit into
Open
Conversation
HBASE-29226 changed the line to a plain assignment and wrapped the new rule in a group with an empty alternative: allowed_expr="(|^javax/$)" The assignment discarded every rule built up above it. The empty alternative makes grep abort with "empty (sub)expression", and the `|| true` on that grep swallows the failure, so bad_contents comes back empty and every artifact is reported correct. The check has enforced nothing since. Restoring it exposes 139 javax/servlet entries in hbase-shaded-mapreduce, which jetty 12 on ee8 requires unrelocated. The original line was trying to allow those but ^javax/$ only matches the bare directory, so allow the package too. master and branch-3 only; branch-2 never carried the change.
There was a problem hiding this comment.
Pull request overview
Restores enforcement of shaded-jar content invariants in the hbase-shaded build by fixing the allowlist regex construction in the jar-contents check scripts, and explicitly allowing the unrelocated Servlet API entries required for Jetty 12 (EE8).
Changes:
- Fixes the allowlist construction so it appends Jetty/Servlet-related allowances instead of overwriting the entire allowlist (which previously effectively disabled the check).
- Allows
javax/servlet/contents (and thejavax/directory entry) as expected for the unrelocated Servlet API shipped inhbase-shaded-mapreduce. - Applies the same correction to both invariant-check modules (with and without Hadoop allowances).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| hbase-shaded/hbase-shaded-with-hadoop-check-invariants/src/test/resources/ensure-jars-have-correct-contents.sh | Restores correct allowlist regex behavior and permits javax/servlet/ entries needed by Jetty 12 (EE8). |
| hbase-shaded/hbase-shaded-check-invariants/src/test/resources/ensure-jars-have-correct-contents.sh | Same allowlist fix and Servlet API allowance for the non-Hadoop variant of the invariants check. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://issues.apache.org/jira/browse/HBASE-30338