Skip to content

Commit e54c3bf

Browse files
authored
Skip fields generation for resource_quality_monitor in tf codegen (#3462)
## Why <!-- Why are these changes needed? Provide the context that the reviewer might be missing. For example, were there any decisions behind the change that are not reflected in the code itself? --> When running codegen, a developer who is not aware of the issue with fields of the quality monitor can get confused / spend a lot of time trying to understand the issue with it. Skipping this generation helps to avoid this confusion. The downside of this change is that new changes to the quality monitor will not be automatically picked up by the codegen. To mitigate that a warning line in the log is added, so that if you are looking for changes specifically in the quality monitor, you will get alerted by the message.
1 parent b967fdb commit e54c3bf

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

bundle/internal/tf/codegen/generator/generator.go

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package generator
33
import (
44
"context"
55
"fmt"
6+
"log"
67
"os"
78
"path/filepath"
89
"strings"
@@ -67,9 +68,17 @@ func Run(ctx context.Context, schema *tfjson.ProviderSchema, path string) error
6768
name: k,
6869
block: v.Block,
6970
}
70-
err := b.Generate(path)
71-
if err != nil {
72-
return err
71+
72+
// Skip fields generation for resource_quality_monitor to avoid unwanted changes,
73+
// as of August 2025 the generator turns pointer fields into slices, which breaks the resource behaviour.
74+
// See https://github.com/databricks/cli/pull/3462
75+
if k == "databricks_quality_monitor" {
76+
log.Printf("Warning: Skipping file generation for %s to avoid known unwanted changes", k)
77+
} else {
78+
err := b.Generate(path)
79+
if err != nil {
80+
return err
81+
}
7382
}
7483
resources = append(resources, b)
7584
}

0 commit comments

Comments
 (0)