Skip to content

[docs] Skip options classes whose dependencies are missing from the classpath - #11567

Open
sundapeng wants to merge 1 commit into
apache:masterfrom
sundapeng:docs-options-classpath-skip
Open

sundapeng wants to merge 1 commit into
apache:masterfrom
sundapeng:docs-options-classpath-skip

Conversation

@sundapeng

@sundapeng sundapeng commented Nov 30, 2026 •

Copy link
Copy Markdown
Member

Problem

Master's Java / Core and integrations lanes are red, and so is every open PR merging with current master.

ConfigOptionsDocsCompletenessITCase fails with:

java.lang.NoClassDefFoundError: org/apache/flink/table/catalog/IntervalFreshness$TimeUnit
	at org.apache.paimon.flink.FlinkMaterializedTableOptions.<clinit>(FlinkMaterializedTableOptions.java:46)
	at java.base/java.lang.Class.forName0(Native Method)
	at org.apache.paimon.docs.configuration.ConfigOptionsDocGenerator.processConfigOptions(ConfigOptionsDocGenerator.java:285)

#11551 moved the materialized table refresh options into FlinkMaterializedTableOptions, whose static initializer references Flink's IntervalFreshness and CatalogMaterializedTable enums. The docs generator and the completeness ITCase Class.forName every scanned *Options class, but paimon-docs has paimon-flink-common in provided scope and no Flink dependency, so the class fails to initialize.

Evidence: master run 46392316689, job Java / Core and integrations / JDK 11, same failure (the run was merged with a failing CI); the same failure also shows up in unrelated open PRs, e.g. #11563.

Change

processConfigOptions now skips a scanned options class whose dependencies are missing from the classpath (NoClassDefFoundError) and logs a warning. An options class that cannot be loaded contributes no documentable options, and every option of the class triggering this is already annotated with @ExcludeFromDocumentation.

Tests

  • ConfigOptionsDocGeneratorTest#testProcessConfigOptionsSkipsClassesWithMissingDependencies: a consumer failing with NoClassDefFoundError for one class must not abort the scan.
  • ConfigOptionsDocsCompletenessITCase passes locally against this branch (it fails on master with the stack above).

…lasspath

FlinkMaterializedTableOptions, introduced by apache#11551, references Flink's
IntervalFreshness and CatalogMaterializedTable enums in its static
initializer. The docs generator and the completeness ITCase load every
scanned *Options class with Class.forName, but paimon-docs has
paimon-flink-common only in provided scope and no Flink dependency, so
loading that class fails with NoClassDefFoundError and master's
'Core and integrations' lanes fail, along with every open PR merging
with current master.

Skip the class with a warning instead: an options class that cannot be
loaded contributes no documentable options, and all options of the class
triggering this are annotated with ExcludeFromDocumentation.

@JingsongLi JingsongLi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Keep documented options visible to the completeness check

ConfigOptionsDocsCompletenessITCase.findExistingOptions uses the same scanner. If the initializer of a class with a public, documentable option needs an engine dependency absent from the docs classpath, the catch skips that class in both generation and validation. I ran a fixture with a public review.engine.mode option whose default needed the missing Flink enum. The parent failed with NoClassDefFoundError. This head returned an empty set, so the completeness check has no missing option to report. Scanner

Please consider loading classes without initialization, as in #11560, and leaving failures visible when reading a documentable field. All of FlinkMaterializedTableOptions' fields are already excluded, so they can be filtered before the class is initialized.

I ran ConfigOptionsDocGeneratorTest and ConfigOptionsDocsCompletenessITCase together on 43924dcf1f with JDK 11. All 11 tests passed.

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.

2 participants