← 输入框|github.com|刷新
Skip to content

refactor(build): move the generated request classes to src/generated/java - #492

Merged
dargmuesli merged 2 commits into
betafrom
refactor/build/generated-source-root
Nov 5, 2026
Merged

dargmuesli merged 2 commits into
betafrom
refactor/build/generated-source-root

Conversation

@dargmuesli

@dargmuesli dargmuesli commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Follow-up to #487, stacked on feat/codegen. The 106 generated data request classes move from src/main/java to a dedicated committed source root src/generated/java, keeping the same Java package. The package is unchanged, so this is a build change only: the JAR, the module and every caller see the same classes.

Today "is this file generated" is a content fact, a marker comment, and every tool that needs to treat the generated and the hand-written classes differently has to parse it or keep a file list. With the move it is a path fact: everything under src/generated/java is regenerable, the 9 hand-written files (the Abstract*Request bases, the paging interfaces, the two non-generated concrete classes) stay in src/main/java, and no list has to be maintained as codegen adds or drops endpoints. The root is committed rather than under target/, because the build deliberately needs no Python.

pom.xml adds the root via build-helper-maven-plugin, which the compiler and the Javadoc pick up from the compile sources. codegen/generate.py writes the request classes to the new root and still splices SpotifyApi.java in place. ci/check-docs.py scans both roots. .codecov.yml excludes src/generated/** from coverage, because the generated classes are pinned by the generator check rather than by line coverage. AGENTS.md, CONTRIBUTING.md and README.md note the two-root layout.

Verified locally: 426 tests pass, codegen/generate.py --check reports no drift, ci/check-docs.py checks all 115 examples, the Javadoc build includes the moved classes, and the examples module compiles against the rebuilt JAR.

@codecov

codecov Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 35.82%. Comparing base (903664a) to head (21f14fd).

❗ There is a different number of reports uploaded between BASE (903664a) and HEAD (21f14fd). Click for more details.

HEAD has 2 uploads less than BASE
Flag BASE (903664a) HEAD (21f14fd)
4 2
Additional details and impacted files
@@              Coverage Diff              @@
##               beta     #492       +/-   ##
=============================================
- Coverage     47.78%   35.82%   -11.96%     
+ Complexity      721      509      -212     
=============================================
  Files           213      107      -106     
  Lines          6171     4446     -1725     
  Branches        524      205      -319     
=============================================
- Hits           2949     1593     -1356     
+ Misses         2905     2763      -142     
+ Partials        317       90      -227     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Base automatically changed from feat/codegen to beta November 5, 2026 12:31
…java

The 106 generated data request classes keep their package, so nothing
changes for callers: src/generated/java now holds them, src/main/java
keeps the hand-written request infrastructure, and pom.xml adds the root
via build-helper-maven-plugin, which the compiler and the Javadoc pick
up from the compile sources.

codegen/generate.py writes to the new root, ci/check-docs.py scans both
roots, and AGENTS.md, CONTRIBUTING.md and README.md note the two-root
layout.
The generated request classes are pinned by codegen/generate.py --check,
and their optional setter boilerplate is exercised only where a fixture
uses the parameter, so counting it toward coverage reports a gap the
tests cannot close without covering every setter.
@dargmuesli
dargmuesli force-pushed the refactor/build/generated-source-root branch from 8df3f20 to 21f14fd Compare November 5, 2026 12:36
@dargmuesli
dargmuesli merged commit ecacb1d into beta Nov 5, 2026
11 checks passed
@dargmuesli
dargmuesli deleted the refactor/build/generated-source-root branch November 5, 2026 12:38
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.

1 participant