Repository navigation
refactor(build): compile the examples as their own module - #475
Merged
Merged
Conversation
They were a second source root of the library, so mvn package folded their packages into the module while -P release did not, and CI validated a module that was never published. As a separate project they compile against the built library the way a consumer does, which also makes a missing export fail here instead of downstream.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## beta #475 +/- ##
=============================================
+ Coverage 31.65% 46.11% +14.46%
Complexity 683 683
=============================================
Files 324 209 -115
Lines 9109 6252 -2857
Branches 777 753 -24
=============================================
Hits 2883 2883
+ Misses 5669 2812 -2857
Partials 557 557 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
dargmuesli
force-pushed
the
refactor/build/examples-module
branch
from
September 2, 2026 08:35
d22d22b to
9ddc427
Compare
The release section predated the examples project and the module descriptor, and the Javadoc rule contradicted what doclint enforces. AGENTS.md was the only file agents read and never mentioned the guide, so it now links to it and stops restating the release steps.
dargmuesli
force-pushed
the
refactor/build/examples-module
branch
from
September 2, 2026 08:39
9ddc427 to
d73b7d3
Compare
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.
The examples were a second source root of the library, added by
build-helperin thedefaultprofile. Oncemodule-info.javalanded insrc/main/java, javac compiled them as part of modulese.michaelthelin.spotify, so their root packages (data.*,authorization.*) ended up inside the module. Thereleaseprofile has nobuild-helper, so the published module never contained them:mvn packageproduced a 3351-byte descriptor against 2828 from-P release. CI was validating a module that was never published, and the CI jar shipped 115 example classes that were not meant to be in it.They are now their own Maven project with their own module descriptor, compiling against the installed library rather than alongside it. Both profiles produce a 2828-byte descriptor and the jar carries no example classes.
Making them a separate module buys something the previous arrangement could not.
examples/module-info.javarequires onlyse.michaelthelin.spotify, so everything else they touch, Gson and HttpComponents among it, has to reach them through the library's ownrequires transitive. A package the library forgets to export, or arequiresthat should have been transitive, now fails this build instead of someone else's. Deleting a singleexportsline from the library and rebuilding givespackage se.michaelthelin.spotify.enums is not visibleacross six examples, which is a class of mistake nothing caught before.The files stay exactly where they are.
README.mdlinks all 115 of them by path andci/check-docs.pyvalidates those links, so the project pointssourceDirectoryatexamples/and sends build output totarget/examplesrather than moving everything under a conventionalsrc/main/javaand rewriting the index.CI installs the library and then runs
mvn -f examples/pom.xml clean compile. Thecleanis load-bearing: an incremental build reuses classes compiled against the previous descriptor and reports nothing, which is how the first version of this passed when it should have failed.The examples version is a third place the release version lives, so
ci/check-docs.pynow fails when it falls behindpom.xml, andAGENTS.mdrecords both that and how to build the examples.Build-only, no library code changes: 402 tests, 116 example sources compiled on the module path, check-docs clean and javadoc without warnings.
CONTRIBUTING.mdis brought back in line at the same time, because this change is one of the things that dated it. Its release section named the wrong number of files to bump and said nothing aboutci/check-docs.pynow catching a missed one; its documentation rule asked for complete Javadoc, which contradicts a codebase that deliberately leaves model builder setters undocumented and runsdoclintasall,-missing; it pointed at Spotify's live documentation for questionsspec/openapi.yamlnow answers; and it described neither the module descriptor, though a class in a new package is unreachable until that package is exported, nor which branch a contribution belongs on. That last one is now spelled out:maintakes anything that can ship in a patch or minor release, new endpoints and parameters included, whilebetatakes changes that break the published API and accumulates the next major; pre-releases are tagged frombetaand stable releases frommain.AGENTS.mdis the file agents load at startup and it never referenced the guide at all, so it now links to it up front and defers the release steps to it rather than keeping a second copy that can drift.