Skip to content

Commit b4b0c59

Browse files
tas50claude
andcommitted
🧹 Address PR review: fix hardcoded defaults and disk region URL
- bigquery: change defaultRoundingMode, satisfiesPzi, satisfiesPzs to computed methods returning null (not available in high-level SDK) - cloud_functions: change uid, satisfiesPzs to computed methods returning null (not available in v1 API) - compute: extract region name from disk.Region URL using RegionNameFromRegionUrl - spelling: add backupdr, metageneration, vertexai; lowercase pzi Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8453cd0 commit b4b0c59

File tree

6 files changed

+55
-17
lines changed

6 files changed

+55
-17
lines changed

.github/actions/spelling/expect.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ awsapps
2222
awslogs
2323
awsvpc
2424
backupconfiguration
25+
backupdr
2526
backupsetting
2627
backupshorttermretentionpolicy
2728
bigquery
@@ -135,6 +136,7 @@ maxmemory
135136
mcp
136137
mcr
137138
meid
139+
metageneration
138140
memorydb
139141
messagestoragepolicy
140142
mfs
@@ -188,7 +190,7 @@ priorityclass
188190
psc
189191
PTn
190192
pushconfig
191-
Pzi
193+
pzi
192194
pzs
193195
querypack
194196
RABBITMQ
@@ -249,6 +251,7 @@ Uocm
249251
usb
250252
Utc
251253
valkey
254+
vertexai
252255
VAULTNAME
253256
vdcs
254257
vdev

providers/gcp/resources/bigquery.go

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,7 @@ func (g *mqlGcpProjectBigqueryService) datasets() ([]any, error) {
182182
"storageBillingModel": llx.StringData(metadata.StorageBillingModel),
183183
"defaultCollation": llx.StringData(metadata.DefaultCollation),
184184
"defaultPartitionExpirationMs": llx.IntData(metadata.DefaultPartitionExpiration.Milliseconds()),
185-
"defaultRoundingMode": llx.StringData(""),
186185
"isCaseInsensitive": llx.BoolData(metadata.IsCaseInsensitive),
187-
"satisfiesPzi": llx.BoolData(false),
188-
"satisfiesPzs": llx.BoolData(false),
189186
})
190187
if err != nil {
191188
return nil, err
@@ -196,6 +193,24 @@ func (g *mqlGcpProjectBigqueryService) datasets() ([]any, error) {
196193
return res, nil
197194
}
198195

196+
// defaultRoundingMode is not yet exposed by the high-level bigquery.DatasetMetadata struct.
197+
func (g *mqlGcpProjectBigqueryServiceDataset) defaultRoundingMode() (string, error) {
198+
g.DefaultRoundingMode.State = plugin.StateIsNull | plugin.StateIsSet
199+
return "", nil
200+
}
201+
202+
// satisfiesPzi is not yet exposed by the high-level bigquery.DatasetMetadata struct.
203+
func (g *mqlGcpProjectBigqueryServiceDataset) satisfiesPzi() (bool, error) {
204+
g.SatisfiesPzi.State = plugin.StateIsNull | plugin.StateIsSet
205+
return false, nil
206+
}
207+
208+
// satisfiesPzs is not yet exposed by the high-level bigquery.DatasetMetadata struct.
209+
func (g *mqlGcpProjectBigqueryServiceDataset) satisfiesPzs() (bool, error) {
210+
g.SatisfiesPzs.State = plugin.StateIsNull | plugin.StateIsSet
211+
return false, nil
212+
}
213+
199214
type mqlGcpProjectBigqueryServiceDatasetInternal struct {
200215
clientOnce sync.Once
201216
client *bigquery.Client

providers/gcp/resources/cloud_functions.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,6 @@ func (g *mqlGcpProject) cloudFunctions() ([]any, error) {
178178
"secretVolumes": llx.ArrayData(secretVolumes, types.Dict),
179179
"dockerRepository": llx.StringData(f.DockerRepository),
180180
"dockerRegistry": llx.StringData(f.DockerRegistry.String()),
181-
"uid": llx.StringData(""),
182-
"satisfiesPzs": llx.BoolData(false),
183181
})
184182
if err != nil {
185183
return nil, err
@@ -189,6 +187,18 @@ func (g *mqlGcpProject) cloudFunctions() ([]any, error) {
189187
return cloudFunctions, nil
190188
}
191189

190+
// uid is not available in the Cloud Functions v1 API.
191+
func (g *mqlGcpProjectCloudFunction) uid() (string, error) {
192+
g.Uid.State = plugin.StateIsNull | plugin.StateIsSet
193+
return "", nil
194+
}
195+
196+
// satisfiesPzs is not available in the Cloud Functions v1 API.
197+
func (g *mqlGcpProjectCloudFunction) satisfiesPzs() (bool, error) {
198+
g.SatisfiesPzs.State = plugin.StateIsNull | plugin.StateIsSet
199+
return false, nil
200+
}
201+
192202
func (g *mqlGcpProjectCloudFunction) id() (string, error) {
193203
if g.ProjectId.Error != nil {
194204
return "", g.ProjectId.Error

providers/gcp/resources/compute.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -920,7 +920,7 @@ func (g *mqlGcpProjectComputeService) disks() ([]any, error) {
920920
"licenses": llx.ArrayData(convert.SliceAnyToInterface(disk.Licenses), types.String),
921921
"physicalBlockSizeBytes": llx.IntData(disk.PhysicalBlockSizeBytes),
922922
"provisionedIops": llx.IntData(disk.ProvisionedIops),
923-
"region": llx.StringData(disk.Region),
923+
"region": llx.StringData(RegionNameFromRegionUrl(disk.Region)),
924924
"replicaZones": llx.ArrayData(convert.SliceAnyToInterface(disk.ReplicaZones), types.String),
925925
"resourcePolicies": llx.ArrayData(convert.SliceAnyToInterface(disk.ResourcePolicies), types.String),
926926
"satisfiesPzi": llx.BoolData(disk.SatisfiesPzi),

providers/gcp/resources/gcp.lr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1825,13 +1825,13 @@ private gcp.project.bigqueryService.dataset @defaults("id name") {
18251825
// Default partition expiration time in milliseconds
18261826
defaultPartitionExpirationMs int
18271827
// Default rounding mode for the dataset
1828-
defaultRoundingMode string
1828+
defaultRoundingMode() string
18291829
// Whether field names are treated as case insensitive
18301830
isCaseInsensitive bool
18311831
// Whether the dataset satisfies Google's Protected Zone Integration requirements
1832-
satisfiesPzi bool
1832+
satisfiesPzi() bool
18331833
// Whether the dataset satisfies Google's Protected Zone Separation requirements
1834-
satisfiesPzs bool
1834+
satisfiesPzs() bool
18351835
}
18361836

18371837
// Google Cloud (GCP) BigQuery dataset access entry
@@ -3046,9 +3046,9 @@ private gcp.project.cloudFunction @defaults("name") {
30463046
// Docker registry to use for this deployment
30473047
dockerRegistry string
30483048
// Unique identifier
3049-
uid string
3049+
uid() string
30503050
// Satisfies PZS
3051-
satisfiesPzs bool
3051+
satisfiesPzs() bool
30523052
}
30533053
// Google Cloud (GCP) Dataproc resources
30543054
private gcp.project.dataprocService {

providers/gcp/resources/gcp.lr.go

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

0 commit comments

Comments
 (0)