fluss icon indicating copy to clipboard operation
fluss copied to clipboard

[docs][build] Generate config options docs automatically from `ConfigOptions`

Open michaelkoepf opened this issue 1 year ago • 10 comments

Search before asking

  • [x] I searched in the issues and found nothing similar.

Motivation

Adding or altering configuration options is currently a manual 2-step process.

  1. Add/alter config option in the source code (com.alibaba.fluss.config.ConfigOptions)
  2. Add/alter config option in the docs

With a growing code base and more developers joining, this approach becomes errorprone. Extracting the config options from the source code would automatically keep the docs in sync.

Solution

~1. Evaluate if there is an existing Maven plugin that can be used 2. If 1. is "no", build a small custom Maven plugin~

Take inspiration from Flinks doc generation module and check if adaptions are needed.

Anything else?

No response

Willingness to contribute

  • [x] I'm willing to submit a PR!

michaelkoepf avatar Feb 23 '25 12:02 michaelkoepf

@michaelkoepf, you could follow the way how Flink generates the document of config options to generate document automatically for fluss.

SteNicholas avatar Feb 24 '25 06:02 SteNicholas

+1 for this, are you willing to contribute this @michaelkoepf ?

wuchong avatar Feb 25 '25 09:02 wuchong

@wuchong yes, i'll take the issue

michaelkoepf avatar Feb 25 '25 19:02 michaelkoepf

Hi @michaelkoepf , are you still interested in contributing to this issue? I think we can break it down into several subtasks. For example, we could start by implementing ConfigOptionsDocGenerator to convert ConfigOptions into HTML, then add support for scripting, and finally support inserting the HTML into .md files.

wuchong avatar Mar 14 '25 07:03 wuchong

@wuchong yes, just a bit short on time at the moment. we can split it up into multiple sub-issues.

michaelkoepf avatar Mar 14 '25 10:03 michaelkoepf

"Hi @Giannis Polyzos, @wuchong I've seen how Flink handles this with their flink-docs module, and I'd love to help implement something similar for Fluss to keep the ConfigOptions and documentation in sync.

I'll start by looking at the current ConfigOptions in Fluss and how Flink's documentation generator is structured. I'm definitely interested in taking this on issue

pbanakar avatar Jan 12 '26 10:01 pbanakar

@Prajwal-banakar Thank you for your interest... Assigned to you!

polyzos avatar Jan 12 '26 12:01 polyzos

"Hi @polyzos Polyzos, I’ve spent some time researching how Flink handles this. I'd like to discuss the high-level plan before I start coding:

Module Structure: I'm thinking of creating a fluss-docs module to house the generator logic. Does that align with our project structure? Approach: I plan to follow the Flink model using Reflection to scan ConfigOptions classes. However, I noticed Flink uses a custom annotation processor for some docs—should we start with simple Reflection first? Execution: Should this tool be integrated as a Maven plugin that runs during the build, or a standalone utility for now?

I’d love to hear your thoughts on this so I can draft a small design doc or move straight to a prototype.

pbanakar avatar Jan 13 '26 07:01 pbanakar

Hi @Prajwal-banakar , thanks for taking this issue. This would be a huge contribution to the community.

Quick answers:

  • Module: I suggest fluss-docgen (as we already have fluss-protogen and will introduce fluss-codegen soon). The fluss-docs sounds like it places doc markdown files in it, but not.
  • Approach: The annotation is used to identify the category/section the config belongs to. So I think we may need annotations or adding variables to the ConfigOption class.
  • Execution: +1 for maven plugin.
  • Display: I think table format is hard to display more content, and not compact. I suggest to use list format with default values and types are labeled after the config key. A good example: https://docs.restate.dev/references/server-config#param-log-filter

Besides, Kafka also has config doc generation framework:

  • https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/config/ConfigDef.java
  • https://kafka.apache.org/41/configuration/broker-configs/#updating-ssl-keystore-of-an-existing-listener

wuchong avatar Jan 18 '26 16:01 wuchong

Hi @wuchong , I've just submitted a PR to address this. I followed the reflection-based approach and used the list format as suggested. Looking forward to your feedback!

pbanakar avatar Jan 25 '26 09:01 pbanakar