Skip to content

Commit 4557cc1

Browse files
Add dynamic lookup for enterprise SASL mechanisms from source code (#137)
* fix(property-extractor): Dynamic enterprise value resolution and improved type extraction - Add dynamic lookup for enterprise SASL mechanisms from source code - Fix template type extraction with proper bracket-counting for nested templates - Implement constexpr identifier resolution for accurate default values - Refactor FriendlyDefaultTransformer with production-ready architecture - Eliminate hardcoded values in favor of dynamic source code analysis - Add comprehensive error handling and performance optimizations - Bump package version to 4.10.1 Resolves issues where enterprise properties showed function names instead of actual values and improves overall code quality with zero hardcoded fallbacks. * Apply suggestions * 📝 Add docstrings to `config-prop-fixes` (#138) Docstrings generation was requested by @JakeSCahill. * #137 (comment) The following files were modified: * `tools/property-extractor/property_extractor.py` * `tools/property-extractor/transformers.py` Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update paths * Fix paths --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent f3f1a6d commit 4557cc1

File tree

7 files changed

+547
-85
lines changed

7 files changed

+547
-85
lines changed

bin/doc-tools.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,6 +1111,8 @@ automation
11111111
} else {
11121112
env.OUTPUT_JSON_DIR = path.resolve(outputDir, 'examples');
11131113
env.OUTPUT_AUTOGENERATED_DIR = path.resolve(outputDir);
1114+
// Set property files to go to properties subdirectory
1115+
env.OUTPUT_ASCIIDOC_DIR = path.resolve(outputDir, 'pages', 'properties');
11141116
}
11151117

11161118
const r = spawnSync('make', args, { cwd, stdio: 'inherit', env });

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@redpanda-data/docs-extensions-and-macros",
3-
"version": "4.10.0",
3+
"version": "4.10.1",
44
"description": "Antora extensions and macros developed for Redpanda documentation.",
55
"keywords": [
66
"antora",

tools/property-extractor/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,10 @@ generate-docs: node-deps
111111
@# Use the enhanced properties file (with overrides) for documentation generation if it exists
112112
@if [ -f "$(TOOL_ROOT)/gen/$(TAG)-properties.json" ]; then \
113113
cd $(TOOL_ROOT) && \
114-
node generate-handlebars-docs.js "gen/$(TAG)-properties.json" "$(OUTPUT_AUTOGENERATED_DIR)"; \
114+
node generate-handlebars-docs.js "gen/$(TAG)-properties.json" "$(OUTPUT_ASCIIDOC_DIR)"; \
115115
else \
116116
cd $(TOOL_ROOT) && \
117-
node generate-handlebars-docs.js "gen/properties-output.json" "$(OUTPUT_AUTOGENERATED_DIR)"; \
117+
node generate-handlebars-docs.js "gen/properties-output.json" "$(OUTPUT_ASCIIDOC_DIR)"; \
118118
fi
119119
@echo "📄 Copying properties JSON files to $(OUTPUT_JSON_DIR)"
120120
@if [ -f "$(TOOL_ROOT)/gen/$(TAG)-properties.json" ]; then \

tools/property-extractor/generate-handlebars-docs.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,17 @@ NOTE: Some cluster properties require that you restart the cluster for any updat
6060
sectionTitle: 'Cluster configuration',
6161
groups: [
6262
{
63-
filter: (prop) => prop.config_scope === 'cluster' && !prop.is_deprecated
63+
filter: (prop) => prop.config_scope === 'cluster' && !prop.is_deprecated && !(
64+
prop.name && (
65+
prop.name.includes('cloud_storage') ||
66+
prop.name.includes('s3_') ||
67+
prop.name.includes('azure_') ||
68+
prop.name.includes('gcs_') ||
69+
prop.name.includes('archival_') ||
70+
prop.name.includes('remote_') ||
71+
prop.name.includes('tiered_')
72+
)
73+
)
6474
}
6575
],
6676
filename: 'cluster-properties.adoc'
@@ -269,7 +279,8 @@ function generateDeprecatedDocs(properties, outputDir) {
269279
};
270280

271281
const output = template(data);
272-
const outputPath = path.join(outputDir, 'deprecated', 'partials', 'deprecated-properties.adoc');
282+
// Navigate back from pages/properties to reference, then into partials/deprecated
283+
const outputPath = path.join(path.dirname(path.dirname(outputDir)), 'partials', 'deprecated', 'deprecated-properties.adoc');
273284

274285
fs.mkdirSync(path.dirname(outputPath), { recursive: true });
275286
fs.writeFileSync(outputPath, output, 'utf8');
@@ -332,7 +343,7 @@ function generateAllDocs(inputFile, outputDir) {
332343

333344
// Generate each type of documentation
334345
for (const [type, config] of Object.entries(PROPERTY_CONFIG)) {
335-
const count = generatePropertyDocs(properties, config, path.join(outputDir, 'pages'));
346+
const count = generatePropertyDocs(properties, config, outputDir);
336347
totalProperties += count;
337348

338349
if (type === 'broker') totalBrokerProperties = count;
@@ -342,7 +353,7 @@ function generateAllDocs(inputFile, outputDir) {
342353
}
343354

344355
// Generate deprecated properties documentation
345-
const deprecatedCount = generateDeprecatedDocs(properties, path.join(outputDir, 'pages'));
356+
const deprecatedCount = generateDeprecatedDocs(properties, outputDir);
346357

347358
// Generate summary file
348359
const allPropertiesContent = Object.keys(properties).sort().join('\n');

0 commit comments

Comments
 (0)