-
Notifications
You must be signed in to change notification settings - Fork 310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto generate Global Server Settings markdown from source #2732
Comments
Not wont cover all settings e.g. Added in but without docs for the config setting: ClickHouse/ClickHouse#60117 Server setting in config.xml: https://github.com/ClickHouse/ClickHouse/blob/9caac43b2aa5e7c5474a87b7596dea95f5a2569a/programs/server/config.xml#L775-L777 Should be on https://clickhouse.com/docs/en/operations/server-configuration-parameters/settings |
Used to generate markdown file with settings outside of ServerSettings.cpp. We will use it to create a markdown file with combined settings from ServerSettings.cpp and this one. List of settings outside of ServerSettings.cpp:
WITH
'settings.md' AS doc_file, settings_from_docs AS
(
WITH
arrayJoin(extractAllGroups(raw_blob, '## (\\w+)(?:\\s[^\n]+)?\n\\s+((?:[^#]|#[^#]|##[^ ])+)')) AS g, g[1] AS name, replaceRegexpAll(replaceRegexpAll(g[2], '\n(Type|Default( value)?): [^\n]+\n', ''), '^\n+|\n+$', '') AS doc
SELECT
name, doc
FROM file(doc_file, RawBLOB)
ORDER BY name ASC
),
settings_outside_source AS
(
SELECT line AS name FROM file('settings_outside_server_settings.txt', LineAsString)
),
content AS
(
SELECT *
FROM settings_from_docs
WHERE name IN settings_outside_source
),
main_content AS
(
SELECT format('\n## {}\n\n{}\n', name, doc)
FROM content
ORDER BY name
),
'<!-- Note: These settings are used to autogenerate Global Server Settings. They are the server settings which are not found in ServerSettings.cpp -->\n<!-- Please only add settings to this file if they do not exist in core/ServerSettings.cpp -->\n'
AS prefix
SELECT prefix || (SELECT groupConcat(*) FROM main_content)
INTO OUTFILE 'settings_outside_of_source.md' TRUNCATE FORMAT LineAsString N.B - don't use |
As part of this, we want to generate sublist of beta and experimental settings. This produces a markdown snippets which we can import into a relevant page cc @melvynator @Blargian e.g. beta/experimental page |
@gingerwizard server settings (both defined in core/ServerSettings.cpp and outside in config.xml) don't currently have a tier level attached to them I believe: DESCRIBE TABLE system.server_settings
Query id: b3756f6c-bf3b-4a3c-8eee-31ba567c56e9
┌─name───────────────────────┬─type───────────────────────────────────────────────────────────────┬─default_type─┬─default_expression─┬─comment─────────────────────────────────────────────┬─codec_expression─┬─ttl_expression─┐
1. │ name │ String │ │ │ Server setting name. │ │ │
2. │ value │ String │ │ │ Server setting value. │ │ │
3. │ default │ String │ │ │ Server setting default value. │ │ │
4. │ changed │ UInt8 │ │ │ Shows whether a setting was specified in config.xml │ │ │
5. │ description │ String │ │ │ Short server setting description. │ │ │
6. │ type │ String │ │ │ Server setting value type. │ │ │
7. │ changeable_without_restart │ Enum8('No' = 0, 'IncreaseOnly' = 1, 'DecreaseOnly' = 2, 'Yes' = 3) │ │ │ Shows whether a setting can be changed at runtime. │ │ │
8. │ is_obsolete │ UInt8 │ │ │ Shows whether a setting is obsolete. │ │ │
└────────────────────────────┴────────────────────────────────────────────────────────────────────┴──────────────┴────────────────────┴─────────────────────────────────────────────────────┴──────────────────┴────────────────┘ To clarify, is the intention to identify which ones are beta/experimental so that the functionality for tier levels can be added to these? Or is the comment about settings more generally? (not specifically global server settings) |
@Blargian A separate
The experimental/beta badge was recently added for full-blown features here: ClickHouse/ClickHouse#73978. I guess the question is if we should add a corresponding badge to auto-generated setting docs. If you look at src/Core/Settings.cpp, there is a block for experimental features already and each of it is marked EXPERIMENTAL (beta and prod settings are not distinguished). No such block/tag exists in src/Core/ServerSettings.cpp. Afaik, the reason is that there are much fewer server settings and I don't even find an experimental ones. |
Hi @rschu1ze Thanks for clarifying. Regarding |
How is My proposal is this:
|
Yes it's all of the settings currently on Global server settings minus those which are in It's clear to me. The whole |
Child of #2730. Auto generate Global Server Settings markdown from source.
The text was updated successfully, but these errors were encountered: