@redpanda-data/docs-extensions-and-macros 4.12.4 → 4.12.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/extensions/process-context-switcher.js +1 -1
- package/extensions/version-fetcher/get-latest-redpanda-helm-version-from-operator.js +1 -1
- package/package.json +1 -1
- package/tools/property-extractor/Makefile +2 -1
- package/tools/property-extractor/helpers/capitalize.js +13 -0
- package/tools/property-extractor/helpers/index.js +2 -0
- package/tools/property-extractor/helpers/length.js +11 -0
- package/tools/property-extractor/templates/property.hbs +69 -26
- package/tools/property-extractor/templates/topic-property-mappings.hbs +3 -6
- package/tools/property-extractor/templates/topic-property.hbs +57 -24
- package/tools/property-extractor/topic_property_extractor.py +10 -3
- package/tools/property-extractor/transformers.py +69 -43
- package/tools/property-extractor/COMPUTED_CONSTANTS.md +0 -173
- package/tools/property-extractor/tests/test_known_values.py +0 -617
- package/tools/property-extractor/tests/transformers_test.py +0 -451
|
@@ -205,7 +205,7 @@ module.exports.register = function ({ config }) {
|
|
|
205
205
|
function injectContextSwitcherToTargetPage(targetPage, contextSwitcher, currentPageResourceId, logger) {
|
|
206
206
|
// Check if target page already has context-switcher attribute
|
|
207
207
|
if (targetPage.asciidoc.attributes['page-context-switcher']) {
|
|
208
|
-
logger.
|
|
208
|
+
logger.info(`Target page ${buildResourceId(targetPage)} already has context-switcher attribute. Skipping injection to avoid overwriting existing configuration: ${targetPage.asciidoc.attributes['page-context-switcher']}`);
|
|
209
209
|
return;
|
|
210
210
|
}
|
|
211
211
|
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
module.exports = async (github, owner, repo, stableDockerTag, betaDockerTag) => {
|
|
14
14
|
const yaml = require('js-yaml');
|
|
15
|
-
const path = 'charts/redpanda/Chart.yaml';
|
|
15
|
+
const path = 'charts/redpanda/chart/Chart.yaml';
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Helper function to fetch chart version from a branch derived from a docker tag
|
package/package.json
CHANGED
|
@@ -92,7 +92,8 @@ redpanda-git:
|
|
|
92
92
|
# --- Clone Tree-sitter grammar & generate parser ---
|
|
93
93
|
treesitter:
|
|
94
94
|
@echo "🌲 Ensuring tree-sitter-cpp grammar…"
|
|
95
|
-
@if [ ! -d "$(TREESITTER_DIR)" ]; then \
|
|
95
|
+
@if [ ! -d "$(TREESITTER_DIR)/.git" ]; then \
|
|
96
|
+
rm -rf "$(TREESITTER_DIR)"; \
|
|
96
97
|
git clone https://github.com/tree-sitter/tree-sitter-cpp.git "$(TREESITTER_DIR)"; \
|
|
97
98
|
fi
|
|
98
99
|
@echo "🔄 Ensuring tree-sitter-cpp is at compatible version v0.20.5…"
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Capitalizes the first letter of a string
|
|
5
|
+
* @param {string} str - The string to capitalize
|
|
6
|
+
* @returns {string} The string with first letter capitalized
|
|
7
|
+
*/
|
|
8
|
+
module.exports = function capitalize(str) {
|
|
9
|
+
if (typeof str !== 'string' || str.length === 0) {
|
|
10
|
+
return str;
|
|
11
|
+
}
|
|
12
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
13
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Handlebars helper to get the length of an array
|
|
3
|
+
* @param {Array} arr - The array
|
|
4
|
+
* @returns {number} The length of the array
|
|
5
|
+
*/
|
|
6
|
+
module.exports = function length(arr) {
|
|
7
|
+
if (!arr) return 0;
|
|
8
|
+
if (Array.isArray(arr)) return arr.length;
|
|
9
|
+
if (typeof arr === 'object' && arr.length !== undefined) return arr.length;
|
|
10
|
+
return 0;
|
|
11
|
+
};
|
|
@@ -61,7 +61,7 @@ endif::[]
|
|
|
61
61
|
|
|
62
62
|
{{/if}}
|
|
63
63
|
|
|
64
|
-
[cols="
|
|
64
|
+
[cols="1s,2a"]
|
|
65
65
|
|===
|
|
66
66
|
| Property | Value
|
|
67
67
|
|
|
@@ -70,10 +70,22 @@ endif::[]
|
|
|
70
70
|
|
|
71
71
|
{{#if enum}}
|
|
72
72
|
| Accepted values
|
|
73
|
-
|
|
|
73
|
+
|
|
|
74
|
+
ifndef::env-cloud[]
|
|
75
|
+
{{#each enum}}`{{this}}`{{#if (isEnterpriseEnum this ../x-enum-metadata)}} (Enterprise){{else}}{{#if ../is_enterprise}}{{#if (includes ../enterprise_restricted_value this)}} (Enterprise){{/if}}{{/if}}{{/if}}{{#unless @last}}, {{/unless}}{{/each}}
|
|
76
|
+
endif::[]
|
|
77
|
+
ifdef::env-cloud[]
|
|
78
|
+
{{#each enum}}`{{this}}`{{#unless @last}}, {{/unless}}{{/each}}
|
|
79
|
+
endif::[]
|
|
74
80
|
{{else}}{{#if items.enum}}
|
|
75
81
|
| Accepted values
|
|
76
|
-
|
|
|
82
|
+
|
|
|
83
|
+
ifndef::env-cloud[]
|
|
84
|
+
{{#each items.enum}}`{{this}}`{{#if (isEnterpriseEnum this ../items.x-enum-metadata)}} (Enterprise){{/if}}{{#unless @last}}, {{/unless}}{{/each}}
|
|
85
|
+
endif::[]
|
|
86
|
+
ifdef::env-cloud[]
|
|
87
|
+
{{#each items.enum}}`{{this}}`{{#unless @last}}, {{/unless}}{{/each}}
|
|
88
|
+
endif::[]
|
|
77
89
|
{{/if}}{{/if}}
|
|
78
90
|
{{#if (and minimum maximum)}}
|
|
79
91
|
|
|
@@ -93,31 +105,34 @@ endif::[]
|
|
|
93
105
|
{{/if}}
|
|
94
106
|
|
|
95
107
|
| Default
|
|
96
|
-
|
|
|
108
|
+
|
|
|
109
|
+
{{#if is_enterprise}}
|
|
97
110
|
ifdef::env-cloud[]
|
|
98
|
-
Available in the Redpanda Cloud Console
|
|
111
|
+
Available in the Redpanda Cloud Console{{#if cloud_readonly}} (read-only){{else if cloud_editable}} (editable){{/if}}
|
|
99
112
|
endif::[]
|
|
100
113
|
ifndef::env-cloud[]
|
|
101
114
|
`{{formatPropertyValue default type}}`{{#if default_human_readable}} ({{default_human_readable}}){{/if}}
|
|
102
|
-
endif::[]
|
|
115
|
+
endif::[]
|
|
116
|
+
{{else}}
|
|
103
117
|
ifdef::env-cloud[]
|
|
104
|
-
Available in the Redpanda Cloud Console
|
|
118
|
+
Available in the Redpanda Cloud Console{{#if cloud_readonly}} (read-only){{else if cloud_editable}} (editable){{/if}}
|
|
105
119
|
endif::[]
|
|
106
120
|
ifndef::env-cloud[]
|
|
107
121
|
`{{formatPropertyValue default type}}`{{#if default_human_readable}} ({{default_human_readable}}){{/if}}
|
|
108
|
-
endif::[]
|
|
122
|
+
endif::[]
|
|
123
|
+
{{/if}}
|
|
109
124
|
|
|
110
125
|
| Nullable
|
|
111
126
|
| {{#if nullable}}Yes{{else}}No{{/if}}
|
|
112
127
|
{{#if units}}
|
|
113
128
|
|
|
114
129
|
| Unit
|
|
115
|
-
| {{units}}
|
|
130
|
+
| {{capitalize units}}
|
|
116
131
|
{{else}}
|
|
117
132
|
{{#if (formatUnits name)}}
|
|
118
133
|
|
|
119
134
|
| Unit
|
|
120
|
-
| {{formatUnits name}}
|
|
135
|
+
| {{capitalize (formatUnits name)}}
|
|
121
136
|
{{/if}}
|
|
122
137
|
{{/if}}
|
|
123
138
|
{{#if (ne defined_in "src/v/config/node_config.cc")}}
|
|
@@ -134,22 +149,23 @@ ifndef::env-cloud[]
|
|
|
134
149
|
endif::[]
|
|
135
150
|
{{#if visibility}}
|
|
136
151
|
|
|
137
|
-
|
|
152
|
+
ifndef::env-cloud[]
|
|
138
153
|
| Visibility
|
|
139
|
-
|
|
|
140
|
-
|
|
154
|
+
| {{capitalize visibility}}
|
|
155
|
+
endif::[]
|
|
141
156
|
{{/if}}
|
|
142
157
|
{{#if aliases}}
|
|
143
158
|
|
|
144
|
-
|
|
159
|
+
ifndef::env-cloud[]
|
|
145
160
|
| Aliases
|
|
146
|
-
| {{
|
|
147
|
-
|
|
161
|
+
| {{#each aliases}}`{{this}}`{{#unless @last}}, {{/unless}}{{/each}}
|
|
162
|
+
endif::[]
|
|
148
163
|
{{/if}}
|
|
149
164
|
{{#if example}}
|
|
150
165
|
|
|
151
166
|
| Example
|
|
152
|
-
|
|
|
167
|
+
|
|
|
168
|
+
{{{example}}}
|
|
153
169
|
{{/if}}
|
|
154
170
|
{{#if related_topics}}
|
|
155
171
|
{{#with (allTopicsConditional related_topics) as |sectionType|}}
|
|
@@ -157,48 +173,75 @@ endif::[]
|
|
|
157
173
|
{{#if (eq sectionType "cloud")}}
|
|
158
174
|
ifdef::env-cloud[]
|
|
159
175
|
| Related topics
|
|
160
|
-
|
|
|
176
|
+
|{{#if (gt (length ../related_topics) 1)}}{{#each ../related_topics}}
|
|
177
|
+
{{#with (parseRelatedTopic this)}}
|
|
178
|
+
* {{{value}}}
|
|
179
|
+
{{/with}}
|
|
180
|
+
{{/each}}
|
|
181
|
+
{{else}}
|
|
161
182
|
{{#each ../related_topics}}
|
|
162
183
|
{{#with (parseRelatedTopic this)}}
|
|
163
|
-
{{
|
|
184
|
+
{{{value}}}
|
|
164
185
|
{{/with}}
|
|
165
186
|
{{/each}}
|
|
187
|
+
{{/if}}
|
|
166
188
|
endif::[]
|
|
167
189
|
{{else if (eq sectionType "self-managed")}}
|
|
168
190
|
ifndef::env-cloud[]
|
|
169
191
|
| Related topics
|
|
170
|
-
|
|
|
192
|
+
|{{#if (gt (length ../related_topics) 1)}}{{#each ../related_topics}}
|
|
193
|
+
{{#with (parseRelatedTopic this)}}
|
|
194
|
+
* {{{value}}}
|
|
195
|
+
{{/with}}
|
|
196
|
+
{{/each}}
|
|
197
|
+
{{else}}
|
|
171
198
|
{{#each ../related_topics}}
|
|
172
199
|
{{#with (parseRelatedTopic this)}}
|
|
173
|
-
{{
|
|
200
|
+
{{{value}}}
|
|
174
201
|
{{/with}}
|
|
175
202
|
{{/each}}
|
|
203
|
+
{{/if}}
|
|
176
204
|
endif::[]
|
|
177
205
|
{{else}}
|
|
178
206
|
| Related topics
|
|
179
|
-
|
|
|
207
|
+
|{{#if (gt (length ../related_topics) 1)}}{{#each ../related_topics}}
|
|
208
|
+
{{#with (parseRelatedTopic this)}}
|
|
209
|
+
{{#if (eq type "cloud")}}
|
|
210
|
+
ifdef::env-cloud[]
|
|
211
|
+
* {{{value}}}
|
|
212
|
+
endif::[]
|
|
213
|
+
{{else if (eq type "self-managed")}}
|
|
214
|
+
ifndef::env-cloud[]
|
|
215
|
+
* {{{value}}}
|
|
216
|
+
endif::[]
|
|
217
|
+
{{else}}
|
|
218
|
+
* {{{value}}}
|
|
219
|
+
{{/if}}
|
|
220
|
+
{{/with}}
|
|
221
|
+
{{/each}}
|
|
222
|
+
{{else}}
|
|
180
223
|
{{#each ../related_topics}}
|
|
181
224
|
{{#with (parseRelatedTopic this)}}
|
|
182
225
|
{{#if (eq type "cloud")}}
|
|
183
226
|
ifdef::env-cloud[]
|
|
184
|
-
{{
|
|
227
|
+
{{{value}}}
|
|
185
228
|
endif::[]
|
|
186
229
|
{{else if (eq type "self-managed")}}
|
|
187
230
|
ifndef::env-cloud[]
|
|
188
|
-
{{
|
|
231
|
+
{{{value}}}
|
|
189
232
|
endif::[]
|
|
190
233
|
{{else}}
|
|
191
|
-
{{
|
|
234
|
+
{{{value}}}
|
|
192
235
|
{{/if}}
|
|
193
236
|
{{/with}}
|
|
194
237
|
{{/each}}
|
|
195
238
|
{{/if}}
|
|
239
|
+
{{/if}}
|
|
196
240
|
{{/with}}
|
|
197
241
|
{{/if}}
|
|
198
242
|
|
|
199
243
|
|===
|
|
200
244
|
|
|
201
|
-
---
|
|
202
245
|
{{#if is_experimental_property}}
|
|
203
246
|
// end::experimental[]
|
|
204
247
|
{{/if}}
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
[cols="1a,1a"]
|
|
2
2
|
|===
|
|
3
|
-
| Topic
|
|
3
|
+
| Topic Property | Corresponding Cluster Property
|
|
4
4
|
|
|
5
5
|
{{#each topicProperties}}
|
|
6
6
|
| <<{{anchorName name}},`{{name}}`>>
|
|
7
|
-
| {{#if alternate_cluster_property
|
|
8
|
-
|
|
9
|
-
{{~else~}}
|
|
10
|
-
xref:./{{cluster_property_doc_file}}#{{corresponding_cluster_property}}[`{{corresponding_cluster_property}}`]
|
|
11
|
-
{{~/if}}
|
|
7
|
+
| {{#if alternate_cluster_property}}xref:./{{cluster_property_doc_file}}#{{corresponding_cluster_property}}[`{{corresponding_cluster_property}}`] or xref:./{{alternate_cluster_property_doc_file}}#{{alternate_cluster_property}}[`{{alternate_cluster_property}}`]{{else}}xref:./{{cluster_property_doc_file}}#{{corresponding_cluster_property}}[`{{corresponding_cluster_property}}`]{{/if}}
|
|
8
|
+
|
|
12
9
|
{{/each}}
|
|
13
10
|
|
|
14
11
|
|===
|
|
@@ -46,7 +46,7 @@ endif::[]
|
|
|
46
46
|
|
|
47
47
|
{{/if}}
|
|
48
48
|
|
|
49
|
-
[cols="
|
|
49
|
+
[cols="1s,2a"]
|
|
50
50
|
|===
|
|
51
51
|
| Property | Value
|
|
52
52
|
|
|
@@ -55,10 +55,21 @@ endif::[]
|
|
|
55
55
|
|
|
56
56
|
{{#if enum}}
|
|
57
57
|
| Accepted Values
|
|
58
|
-
|
|
|
58
|
+
|
|
|
59
|
+
ifndef::env-cloud[]
|
|
60
|
+
{{#each enum}}`{{this}}`{{#if (isEnterpriseEnum this ../x-enum-metadata)}} (Enterprise){{/if}}{{#unless @last}}, {{/unless}}{{/each}}
|
|
61
|
+
endif::[]
|
|
62
|
+
ifdef::env-cloud[]
|
|
63
|
+
{{#each enum}}`{{this}}`{{#unless @last}}, {{/unless}}{{/each}}
|
|
64
|
+
endif::[]
|
|
59
65
|
{{else}}{{#if items.enum}}
|
|
60
66
|
| Accepted Values
|
|
61
|
-
|
|
|
67
|
+
|ifndef::env-cloud[]
|
|
68
|
+
{{#each items.enum}}`{{this}}`{{#if (isEnterpriseEnum this ../items.x-enum-metadata)}} (Enterprise){{/if}}{{#unless @last}}, {{/unless}}{{/each}}
|
|
69
|
+
endif::[]
|
|
70
|
+
ifdef::env-cloud[]
|
|
71
|
+
{{#each items.enum}}`{{this}}`{{#unless @last}}, {{/unless}}{{/each}}
|
|
72
|
+
endif::[]
|
|
62
73
|
{{else}}{{#if acceptable_values}}
|
|
63
74
|
| Accepted values
|
|
64
75
|
| {{{acceptable_values}}}
|
|
@@ -87,19 +98,13 @@ endif::[]
|
|
|
87
98
|
{{#if (ne default undefined)}}
|
|
88
99
|
|
|
89
100
|
| Default
|
|
90
|
-
|
|
|
101
|
+
|
|
|
91
102
|
ifdef::env-cloud[]
|
|
92
|
-
Available in the Redpanda Cloud Console
|
|
103
|
+
Available in the Redpanda Cloud Console{{#if cloud_readonly}} (read-only){{else if cloud_editable}} (editable){{/if}}
|
|
93
104
|
endif::[]
|
|
94
105
|
ifndef::env-cloud[]
|
|
95
106
|
`{{formatPropertyValue default type}}`{{#if default_human_readable}} ({{default_human_readable}}){{/if}}
|
|
96
|
-
endif::[]{{else}}
|
|
97
|
-
ifdef::env-cloud[]
|
|
98
|
-
Available in the Redpanda Cloud Console
|
|
99
107
|
endif::[]
|
|
100
|
-
ifndef::env-cloud[]
|
|
101
|
-
`{{formatPropertyValue default type}}`{{#if default_human_readable}} ({{default_human_readable}}){{/if}}
|
|
102
|
-
endif::[]{{/if}}
|
|
103
108
|
{{/if}}
|
|
104
109
|
|
|
105
110
|
| Nullable
|
|
@@ -112,7 +117,8 @@ endif::[]
|
|
|
112
117
|
{{#if example}}
|
|
113
118
|
|
|
114
119
|
| Example
|
|
115
|
-
|
|
|
120
|
+
|
|
|
121
|
+
{{{example}}}
|
|
116
122
|
{{/if}}
|
|
117
123
|
{{#if related_topics}}
|
|
118
124
|
{{#with (allTopicsConditional related_topics) as |sectionType|}}
|
|
@@ -120,55 +126,82 @@ endif::[]
|
|
|
120
126
|
{{#if (eq sectionType "cloud")}}
|
|
121
127
|
ifdef::env-cloud[]
|
|
122
128
|
| Related topics
|
|
123
|
-
|
|
|
129
|
+
|{{#if (gt (length ../related_topics) 1)}}{{#each ../related_topics}}
|
|
130
|
+
{{#with (parseRelatedTopic this)}}
|
|
131
|
+
* {{{value}}}
|
|
132
|
+
{{/with}}
|
|
133
|
+
{{/each}}
|
|
134
|
+
{{else}}
|
|
124
135
|
{{#each ../related_topics}}
|
|
125
136
|
{{#with (parseRelatedTopic this)}}
|
|
126
|
-
{{
|
|
137
|
+
{{{value}}}
|
|
127
138
|
{{/with}}
|
|
128
139
|
{{/each}}
|
|
140
|
+
{{/if}}
|
|
129
141
|
endif::[]
|
|
130
142
|
{{else if (eq sectionType "self-managed")}}
|
|
131
143
|
ifndef::env-cloud[]
|
|
132
144
|
| Related topics
|
|
133
|
-
|
|
|
145
|
+
|{{#if (gt (length ../related_topics) 1)}}{{#each ../related_topics}}
|
|
146
|
+
{{#with (parseRelatedTopic this)}}
|
|
147
|
+
* {{{value}}}
|
|
148
|
+
{{/with}}
|
|
149
|
+
{{/each}}
|
|
150
|
+
{{else}}
|
|
134
151
|
{{#each ../related_topics}}
|
|
135
152
|
{{#with (parseRelatedTopic this)}}
|
|
136
|
-
{{
|
|
153
|
+
{{{value}}}
|
|
137
154
|
{{/with}}
|
|
138
155
|
{{/each}}
|
|
156
|
+
{{/if}}
|
|
139
157
|
endif::[]
|
|
140
158
|
{{else}}
|
|
141
159
|
| Related topics
|
|
142
|
-
|
|
|
160
|
+
|{{#if (gt (length ../related_topics) 1)}}{{#each ../related_topics}}
|
|
161
|
+
{{#with (parseRelatedTopic this)}}
|
|
162
|
+
{{#if (eq type "cloud")}}
|
|
163
|
+
ifdef::env-cloud[]
|
|
164
|
+
* {{{value}}}
|
|
165
|
+
endif::[]
|
|
166
|
+
{{else if (eq type "self-managed")}}
|
|
167
|
+
ifndef::env-cloud[]
|
|
168
|
+
* {{{value}}}
|
|
169
|
+
endif::[]
|
|
170
|
+
{{else}}
|
|
171
|
+
* {{{value}}}
|
|
172
|
+
{{/if}}
|
|
173
|
+
{{/with}}
|
|
174
|
+
{{/each}}
|
|
175
|
+
{{else}}
|
|
143
176
|
{{#each ../related_topics}}
|
|
144
177
|
{{#with (parseRelatedTopic this)}}
|
|
145
178
|
{{#if (eq type "cloud")}}
|
|
146
179
|
ifdef::env-cloud[]
|
|
147
|
-
{{
|
|
180
|
+
{{{value}}}
|
|
148
181
|
endif::[]
|
|
149
182
|
{{else if (eq type "self-managed")}}
|
|
150
183
|
ifndef::env-cloud[]
|
|
151
|
-
{{
|
|
184
|
+
{{{value}}}
|
|
152
185
|
endif::[]
|
|
153
186
|
{{else}}
|
|
154
|
-
{{
|
|
187
|
+
{{{value}}}
|
|
155
188
|
{{/if}}
|
|
156
189
|
{{/with}}
|
|
157
190
|
{{/each}}
|
|
158
191
|
{{/if}}
|
|
192
|
+
{{/if}}
|
|
159
193
|
{{/with}}
|
|
160
194
|
{{/if}}
|
|
161
195
|
{{#if aliases}}
|
|
162
196
|
|
|
163
|
-
|
|
197
|
+
ifndef::env-cloud[]
|
|
164
198
|
| Aliases
|
|
165
|
-
| {{
|
|
166
|
-
|
|
199
|
+
| {{#each aliases}}`{{this}}`{{#unless @last}}, {{/unless}}{{/each}}
|
|
200
|
+
endif::[]
|
|
167
201
|
{{/if}}
|
|
168
202
|
|
|
169
203
|
|===
|
|
170
204
|
|
|
171
|
-
---
|
|
172
205
|
{{#if is_experimental_property}}
|
|
173
206
|
// end::experimental[]
|
|
174
207
|
{{/if}}
|
|
@@ -677,7 +677,7 @@ class TopicPropertyExtractor:
|
|
|
677
677
|
prop_data["corresponding_cluster_property"] = cluster_prop
|
|
678
678
|
prop_data["cluster_property_doc_file"] = self._get_cluster_property_doc_file(cluster_prop)
|
|
679
679
|
|
|
680
|
-
# Populate default value from cluster property if available
|
|
680
|
+
# Populate default value and type from cluster property if available
|
|
681
681
|
if self.cluster_properties:
|
|
682
682
|
cluster_props = self.cluster_properties.get("properties", {})
|
|
683
683
|
if cluster_prop in cluster_props:
|
|
@@ -686,6 +686,9 @@ class TopicPropertyExtractor:
|
|
|
686
686
|
# Also copy default_human_readable if available
|
|
687
687
|
if "default_human_readable" in cluster_prop_data:
|
|
688
688
|
prop_data["default_human_readable"] = cluster_prop_data["default_human_readable"]
|
|
689
|
+
# Inherit type from cluster property (more reliable than heuristics)
|
|
690
|
+
if "type" in cluster_prop_data:
|
|
691
|
+
prop_data["type"] = cluster_prop_data["type"]
|
|
689
692
|
|
|
690
693
|
# Add alternate cluster property if this has conditional mapping
|
|
691
694
|
if prop_name in self.alternate_mappings:
|
|
@@ -706,8 +709,12 @@ class TopicPropertyExtractor:
|
|
|
706
709
|
if "compression" in prop_name:
|
|
707
710
|
if "compression" in self.enum_values:
|
|
708
711
|
values = self.enum_values["compression"]["values"]
|
|
709
|
-
# Filter out
|
|
710
|
-
filtered_values = [v for v in values if v not in ['count'
|
|
712
|
+
# Filter out internal values like 'count', but keep 'producer' (it's a valid Kafka value)
|
|
713
|
+
filtered_values = [v for v in values if v not in ['count']]
|
|
714
|
+
# Ensure 'producer' is first if present (it's the default and most common)
|
|
715
|
+
if 'producer' in filtered_values:
|
|
716
|
+
filtered_values.remove('producer')
|
|
717
|
+
filtered_values.insert(0, 'producer')
|
|
711
718
|
return f"[`{'`, `'.join(filtered_values)}`]"
|
|
712
719
|
|
|
713
720
|
elif "cleanup.policy" in prop_name:
|
|
@@ -538,6 +538,51 @@ def get_meta_value(info, key, default=None):
|
|
|
538
538
|
return val
|
|
539
539
|
|
|
540
540
|
|
|
541
|
+
def resolve_cpp_literal(value_str):
|
|
542
|
+
"""
|
|
543
|
+
Resolve C++ literal expressions to their actual values.
|
|
544
|
+
|
|
545
|
+
Handles:
|
|
546
|
+
- Size literals: 5_MiB → 5242880
|
|
547
|
+
- std::to_string() wrapper: std::to_string(5_MiB) → 5242880
|
|
548
|
+
- Plain integers: 42 → 42
|
|
549
|
+
- Plain floats: 3.14 → 3.14
|
|
550
|
+
|
|
551
|
+
Args:
|
|
552
|
+
value_str: String containing C++ literal expression
|
|
553
|
+
|
|
554
|
+
Returns:
|
|
555
|
+
Resolved value (int, float, or original string if can't resolve)
|
|
556
|
+
"""
|
|
557
|
+
if not isinstance(value_str, str):
|
|
558
|
+
return value_str
|
|
559
|
+
|
|
560
|
+
val = value_str.strip()
|
|
561
|
+
|
|
562
|
+
# Handle std::to_string() wrapper
|
|
563
|
+
to_string_match = re.match(r"std::to_string\((.+)\)", val)
|
|
564
|
+
if to_string_match:
|
|
565
|
+
val = to_string_match.group(1).strip()
|
|
566
|
+
|
|
567
|
+
# Try size literals like 5_MiB
|
|
568
|
+
size_match = re.match(r"(\d+)_([KMGTP])iB", val)
|
|
569
|
+
if size_match:
|
|
570
|
+
num, unit = int(size_match.group(1)), size_match.group(2)
|
|
571
|
+
mult = {"K": 1024, "M": 1024**2, "G": 1024**3, "T": 1024**4, "P": 1024**5}[unit]
|
|
572
|
+
return num * mult
|
|
573
|
+
|
|
574
|
+
# Try plain integer
|
|
575
|
+
if re.fullmatch(r"-?\d+", val):
|
|
576
|
+
return int(val)
|
|
577
|
+
|
|
578
|
+
# Try plain float
|
|
579
|
+
if re.fullmatch(r"-?\d+\.\d+", val):
|
|
580
|
+
return float(val)
|
|
581
|
+
|
|
582
|
+
# Return original if can't resolve
|
|
583
|
+
return value_str
|
|
584
|
+
|
|
585
|
+
|
|
541
586
|
def get_resolve_constexpr_identifier():
|
|
542
587
|
"""
|
|
543
588
|
Lazily import constexpr identifier resolution function to avoid circular imports.
|
|
@@ -1965,9 +2010,12 @@ class EnterpriseTransformer:
|
|
|
1965
2010
|
info["params"] = params[:-1]
|
|
1966
2011
|
|
|
1967
2012
|
# --- restricted_with_sanctioned (scalar form) ---
|
|
2013
|
+
# Pattern: (restricted, sanctioned, name, description, meta, default)
|
|
2014
|
+
# Must check that params[1] is NOT the property name (which would make it restricted_only)
|
|
1968
2015
|
elif (
|
|
1969
2016
|
len(params) >= 6
|
|
1970
2017
|
and all(p["type"] in ("true", "false", "integer_literal", "string_literal", "qualified_identifier") for p in params[:2])
|
|
2018
|
+
and self._clean_value(params[1]["value"]) != info.get("name_in_file")
|
|
1971
2019
|
):
|
|
1972
2020
|
enterprise_constructor = "restricted_with_sanctioned"
|
|
1973
2021
|
restricted_vals = [self._clean_value(params[0]["value"])]
|
|
@@ -1982,13 +2030,15 @@ class EnterpriseTransformer:
|
|
|
1982
2030
|
restricted_vals = [self._clean_value(params[0]["value"])]
|
|
1983
2031
|
info["params"] = params[1:]
|
|
1984
2032
|
|
|
1985
|
-
# --- simple enterprise property (lambda validator pattern) ---
|
|
1986
|
-
|
|
1987
|
-
|
|
2033
|
+
# --- simple enterprise property (function/lambda validator pattern) ---
|
|
2034
|
+
# Pattern: (validator_function, name, description, meta, default, ...)
|
|
2035
|
+
# The validator can be a lambda or a function identifier
|
|
2036
|
+
elif (len(params) >= 3 and
|
|
2037
|
+
params[0].get("type") in ("lambda_expression", "identifier", "qualified_identifier") and
|
|
1988
2038
|
params[1].get("type") == "string_literal"):
|
|
1989
2039
|
enterprise_constructor = "simple"
|
|
1990
2040
|
# Don't modify params for simple enterprise properties - they have normal structure
|
|
1991
|
-
# Remove the
|
|
2041
|
+
# Remove the validator from parameters as it's not needed for documentation
|
|
1992
2042
|
info["params"] = params[1:]
|
|
1993
2043
|
|
|
1994
2044
|
if not enterprise_constructor:
|
|
@@ -2007,28 +2057,6 @@ class EnterpriseTransformer:
|
|
|
2007
2057
|
if sanctioned_vals is not None:
|
|
2008
2058
|
property["enterprise_sanctioned_value"] = sanctioned_vals
|
|
2009
2059
|
|
|
2010
|
-
# Add friendly description (values are already cleaned by _clean_value)
|
|
2011
|
-
if enterprise_constructor == "restricted_with_sanctioned":
|
|
2012
|
-
r = restricted_vals[0]
|
|
2013
|
-
s = sanctioned_vals[0]
|
|
2014
|
-
property["enterprise_default_description"] = (
|
|
2015
|
-
f"Default: `{s}` (Community) or `{r}` (Enterprise)"
|
|
2016
|
-
)
|
|
2017
|
-
elif enterprise_constructor == "restricted_only":
|
|
2018
|
-
if len(restricted_vals) > 1:
|
|
2019
|
-
vals = ", ".join(f"`{v}`" for v in restricted_vals)
|
|
2020
|
-
property["enterprise_default_description"] = (
|
|
2021
|
-
f"Available only with Enterprise license: {vals}"
|
|
2022
|
-
)
|
|
2023
|
-
else:
|
|
2024
|
-
property["enterprise_default_description"] = (
|
|
2025
|
-
f"Available only with Enterprise license: `{restricted_vals[0]}`"
|
|
2026
|
-
)
|
|
2027
|
-
elif enterprise_constructor == "sanctioned_only":
|
|
2028
|
-
property["enterprise_default_description"] = (
|
|
2029
|
-
f"Community-only configuration. Sanctioned value: `{sanctioned_vals[0]}`"
|
|
2030
|
-
)
|
|
2031
|
-
|
|
2032
2060
|
return property
|
|
2033
2061
|
|
|
2034
2062
|
# --- Helper: clean literal/identifier values ---
|
|
@@ -2134,6 +2162,8 @@ class MetaParamTransformer:
|
|
|
2134
2162
|
|
|
2135
2163
|
key, value = [s.strip() for s in field.split("=", 1)]
|
|
2136
2164
|
clean_key = key.replace(".", "")
|
|
2165
|
+
# Strip trailing commas from value (last field in meta block has trailing comma)
|
|
2166
|
+
value = value.rstrip(",").strip()
|
|
2137
2167
|
meta_dict[clean_key] = value
|
|
2138
2168
|
|
|
2139
2169
|
# 🔹 Inline special handlers for known meta keys
|
|
@@ -2142,13 +2172,12 @@ class MetaParamTransformer:
|
|
|
2142
2172
|
# Example values
|
|
2143
2173
|
if clean_key == "example":
|
|
2144
2174
|
val_clean = value.strip().strip('"')
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
property["example"] = float(val_clean)
|
|
2175
|
+
resolved = resolve_cpp_literal(val_clean)
|
|
2176
|
+
# Wrap in backticks for inline code formatting (handles overrides with AsciiDoc blocks)
|
|
2177
|
+
if isinstance(resolved, str):
|
|
2178
|
+
property["example"] = f"`{normalize_string(resolved)}`"
|
|
2150
2179
|
else:
|
|
2151
|
-
property["example"] =
|
|
2180
|
+
property["example"] = f"`{resolved}`"
|
|
2152
2181
|
|
|
2153
2182
|
# Gets_restored / restored flags
|
|
2154
2183
|
elif clean_key in ("gets_restored", "restored"):
|
|
@@ -2231,21 +2260,18 @@ class ExampleTransformer:
|
|
|
2231
2260
|
meta_dict = param["value"]
|
|
2232
2261
|
if "example" in meta_dict:
|
|
2233
2262
|
example_val = meta_dict["example"]
|
|
2234
|
-
|
|
2263
|
+
|
|
2235
2264
|
# Clean up the value (remove quotes, etc.)
|
|
2236
2265
|
if isinstance(example_val, str):
|
|
2237
2266
|
example_val = example_val.strip().strip('"\'')
|
|
2238
|
-
|
|
2239
|
-
#
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
property["example"] = float(example_val)
|
|
2245
|
-
else:
|
|
2246
|
-
property["example"] = example_val
|
|
2267
|
+
|
|
2268
|
+
# Use shared resolution logic
|
|
2269
|
+
resolved = resolve_cpp_literal(example_val)
|
|
2270
|
+
# Wrap in backticks for inline code formatting
|
|
2271
|
+
if isinstance(resolved, str):
|
|
2272
|
+
property["example"] = f"`{normalize_string(resolved)}`"
|
|
2247
2273
|
else:
|
|
2248
|
-
property["example"] =
|
|
2274
|
+
property["example"] = f"`{resolved}`"
|
|
2249
2275
|
break
|
|
2250
2276
|
|
|
2251
2277
|
return property
|