[FLINK-40687][build] Relocate the packages the model uber jars actually bundle - #29227
Open
MartijnVisser wants to merge 7 commits into
Open
MartijnVisser wants to merge 7 commits into
MartijnVisser wants to merge 7 commits into
Conversation
…odel uber jars
Both model poms declared <filters> without combine.children="append", which the
root pom explicitly warns against ("Filters MUST be appended; merging filters does
not work properly, see MSHADE-305"). The inherited excludes do survive today, because
Maven's merge happens to line up the two single <artifact>*</artifact> filters, so
this changes nothing in the built jars. It stops the result depending on that.
Generated-by: Claude Code (Claude Opus 5)
… shaded package Every other relocating module in the repo puts a "shaded" segment in the target package, and it is load-bearing here: flink-architecture-tests-production depends on the shaded flink-model-openai jar, and ExcludeShadedImportOption only skips paths matching .*/shaded/.*. Without the segment the relocated jackson classes are imported as if they were Flink production code, which also puts every package relocated from here on into that scan. Generated-by: Claude Code (Claude Opus 5)
…ly bundle The relocations named Maven groupIds, not Java packages, so they never matched and only jackson was relocated: 1405 unrelocated classes in triton, 13250 in openai. No org.apache.hc, which openai-java 4.63.1 no longer pulls. Patterns carry a trailing dot because shade matches them as a bare prefix against string constants too. com.openai and kotlin stay unrelocated in openai; the pom says why. Generated-by: Claude Code (Claude Opus 5)
…iton okhttp 4.12.0 asks for kotlin-stdlib-jdk8 1.8.21 and wins the mediation, while the okio-jvm 3.6.0 it pulls in is built against 1.9.10 and contributes kotlin-stdlib-common at that version. The jar therefore bundled a 1.8.21 runtime with 1.9.10 metadata. Pin both to 1.9.10, the version okio-jvm expects, the way flink-model-openai already does. The dependencyConvergence enforcer does not catch this: Maven's mediation resolves the split before the rule sees the tree, and it passes either way. Generated-by: Claude Code (Claude Opus 5)
…enai-java bump openai-java 4.63.1 dropped httpclient5, httpcore5, httpcore5-h2 and the okhttp3 logging-interceptor, but FLINK-40680 only added the new entries. The shade log lists 25 bundled dependencies against 29 in the NOTICE. NoticeFileChecker rates "listed but not bundled" as TOLERATED and only fails on the reverse, so the licence gate stayed green. Generated-by: Claude Code (Claude Opus 5)
…ifacts kotlin-stdlib-jdk7 and -jdk8 have been empty since Kotlin 1.8. kotlin-stdlib-common and com.squareup.okio:okio are multiplatform metadata artifacts, holding 402 .kotlin_metadata resources and no classes. okio-jvm carries the actual okio code and stays. Both NOTICE files now match the shade log exactly, 21 entries for openai and 7 for triton. Generated-by: Claude Code (Claude Opus 5)
…ed dependencies Nothing in the build looked at these jars, which is how patterns that never matched survived two releases. The check is an allowlist, so a new dependency cannot ship unrelocated unnoticed. Sources and javadoc jars are skipped; they sort before the shaded jar and would make it pass without inspecting anything. Generated-by: Claude Code (Claude Opus 5)
Collaborator
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.
What is the purpose of the change
The shade relocations in both flink-model poms name Maven groupIds,
com.squareupandorg.apache.httpcomponents, not Java packages. They never match, so jackson is the only thingrelocated and both jars publish the rest in the default namespace: 1405 unrelocated classes in
flink-model-triton, 13250 in flink-model-openai.
Brief change log
bare prefix against string constants too
org.apache.hc: openai-java 4.63.1 no longer pulls httpclient5.io.swagger,com.github.victoolsandcom.fasterxml:classmateare added, because it now pulls thoseshadedsegment, which is what stops ArchUnit importing relocatedclasses as production code. It imports 1336 of them today
com.openaiandkotlinstay unrelocated in flink-model-openai; the pom records whyno longer bundles empty or metadata-only Kotlin artifacts
check_shaded_artifacts_modelfails the build on any unrelocated dependencyVerifying this change
Nothing in the build inspected these jars. The new check is red on both modules before this
change and green after.
The relocation set was measured by running each module's tests against the shaded jar instead of
target/classes. flink-model-openai is 22/22 on master and as proposed, but 10/22 withcom.openairelocated, and relocatingkotlinbreaks kotlin-reflect once no otherkotlin-stdlib is on the classpath. flink-model-triton bundles no kotlin-reflect and relocates
Kotlin safely.
Both NOTICE files now match the shade log exactly. Aggregate javadoc, flink-docs and
flink-architecture-tests-production were run as well.
Does this pull request potentially affect one of the following parts:
no classes are no longer bundled and flink-model-triton's Kotlin is pinned to 1.9.10
@Public(Evolving): no. Relocatedtypes do appear in public signatures of the shaded jars, as jackson already does
Documentation
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Claude Opus 5)