fix: P1 — remove panics in docs gen, remove clickhouse hardcode, empty op logging

This commit is contained in:
“Naeel”
2026-06-30 18:27:06 +04:00
parent a0e4037d7b
commit 3cda6ec479
2 changed files with 10 additions and 7 deletions
+1 -2
View File
@@ -92,7 +92,6 @@ mkdir -p "$DOCS_DIR"
go run ./tools/docs_template_gen_v2 \
-resources "$RESOURCES_YAML_DIR" \
-docs "$DOCS_DIR" \
-services "$SERVICES_LIST_PATH" \
-exclude "clickhouse"
-services "$SERVICES_LIST_PATH"
echo "Resources and docs generated in template format."
@@ -86,7 +86,7 @@ func main() {
resourcesDirFlag := flag.String("resources", "", "Path to resources_yaml")
docsDirFlag := flag.String("docs", "", "Path to docs/30_registry/resources")
servicesListFlag := flag.String("services", "", "Path to devops/config/services_list.txt")
excludeFlag := flag.String("exclude", "clickhouse", "Comma-separated resource names to skip")
excludeFlag := flag.String("exclude", "", "Comma-separated resource names to skip (e.g. clickhouse)")
versionFlag := flag.String("version", "", "Provider version for example block")
flag.Parse()
@@ -109,7 +109,8 @@ func main() {
}
if err := os.MkdirAll(docsDir, 0o755); err != nil {
panic(err)
fmt.Fprintf(os.Stderr, "ERROR: cannot create docs dir %s: %v\n", docsDir, err)
os.Exit(1)
}
var processedSpecs []ServiceSpec
@@ -126,7 +127,8 @@ func main() {
func detectRoot() string {
cwd, err := os.Getwd()
if err != nil {
panic(err)
fmt.Fprintf(os.Stderr, "ERROR: cannot get working directory: %v\n", err)
os.Exit(1)
}
if filepath.Base(cwd) == "universal_rebuild" {
return filepath.Dir(cwd)
@@ -255,7 +257,8 @@ func loadSpecs(dir string, ordered []ServiceMeta) []ServiceSpec {
return nil
})
if walkErr != nil {
panic(walkErr)
fmt.Fprintf(os.Stderr, "ERROR: failed to load specs from %s: %v\n", dir, walkErr)
os.Exit(1)
}
if len(ordered) == 0 {
@@ -317,7 +320,8 @@ func writeResourceDocs(docsDir string, spec ServiceSpec, version string) {
func writeFile(path, content string) {
if err := os.WriteFile(path, []byte(content), 0o644); err != nil {
panic(err)
fmt.Fprintf(os.Stderr, "ERROR: cannot write %s: %v\n", path, err)
os.Exit(1)
}
}