Skip to content

Commit dd8576a

Browse files
committed
Merge remote-tracking branch 'origin' into feat/swp_rule_mutex
2 parents af38303 + a494af4 commit dd8576a

File tree

175 files changed

+4460
-1239
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

175 files changed

+4460
-1239
lines changed

.ci/magician/cmd/generate_comment.go

+19-9
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ type diffCommentData struct {
7373
Errors []Errors
7474
}
7575

76+
type simpleSchemaDiff struct {
77+
AddedResources, ModifiedResources, RemovedResources []string
78+
}
79+
7680
const allowBreakingChangesLabel = "override-breaking-change"
7781

7882
var gcEnvironmentVariables = [...]string{
@@ -204,24 +208,26 @@ func execGenerateComment(prNumber int, ghTokenMagicModules, buildId, buildStep,
204208
repo.Branch = newBranch
205209
repo.Cloned = true
206210
if err := ctlr.Clone(repo); err != nil {
207-
fmt.Println("Failed to clone repo at new branch: ", err)
211+
fmt.Printf("Failed to clone repo %q at branch %q: %s\n", repo.Name, newBranch, err)
208212
errors[repo.Title] = append(errors[repo.Title], "Failed to clone repo at new branch")
209213
repo.Cloned = false
210214
}
211215
if err := ctlr.Fetch(repo, oldBranch); err != nil {
212-
fmt.Println("Failed to fetch old branch: ", err)
216+
fmt.Printf("Failed to fetch branch %q for repo %q: %s\n", oldBranch, repo.Name, err)
213217
errors[repo.Title] = append(errors[repo.Title], "Failed to clone repo at old branch")
214218
repo.Cloned = false
215219
continue
216220
}
217221
if repo.Name == "terraform-provider-google-beta" || repo.Name == "terraform-provider-google" {
218222
if err := ctlr.Checkout(repo, oldBranch); err != nil {
223+
fmt.Printf("Failed to checkout branch %q for repo %q: %s\n", oldBranch, repo.Name, err)
219224
errors[repo.Title] = append(errors[repo.Title], fmt.Sprintf("Failed to checkout branch %s", oldBranch))
220225
repo.Cloned = false
221226
continue
222227
}
223228
rnr.PushDir(repo.Path)
224229
if _, err := rnr.Run("make", []string{"build"}, nil); err != nil {
230+
fmt.Printf("Failed to build branch %q for repo %q: %s\n", oldBranch, repo.Name, err)
225231
errors[repo.Title] = append(errors[repo.Title], fmt.Sprintf("Failed to build branch %s", oldBranch))
226232
repo.Cloned = false
227233
}
@@ -303,7 +309,7 @@ func execGenerateComment(prNumber int, ghTokenMagicModules, buildId, buildStep,
303309
data.MissingTests = missingTests
304310
}
305311

306-
affectedResources, err := changedSchemaResources(diffProcessorPath, rnr)
312+
affectedResources, err := computeAffectedResources(diffProcessorPath, rnr, repo)
307313
if err != nil {
308314
fmt.Println("computing changed resource schemas: ", err)
309315
errors[repo.Title] = append(errors[repo.Title], "The diff processor crashed while computing changed resource schemas.")
@@ -460,27 +466,31 @@ func computeBreakingChanges(diffProcessorPath string, rnr ExecRunner) ([]Breakin
460466
return changes, rnr.PopDir()
461467
}
462468

463-
func changedSchemaResources(diffProcessorPath string, rnr ExecRunner) ([]string, error) {
469+
func computeAffectedResources(diffProcessorPath string, rnr ExecRunner, repo source.Repo) ([]string, error) {
464470
if err := rnr.PushDir(diffProcessorPath); err != nil {
465471
return nil, err
466472
}
467473

468-
output, err := rnr.Run("bin/diff-processor", []string{"changed-schema-resources"}, nil)
474+
output, err := rnr.Run("bin/diff-processor", []string{"schema-diff"}, nil)
469475
if err != nil {
470476
return nil, err
471477
}
472478

473-
fmt.Println("Resources with changed schemas: " + output)
479+
fmt.Printf("Schema diff for %q: %s\n", repo.Name, output)
474480

475-
var labels []string
476-
if err = json.Unmarshal([]byte(output), &labels); err != nil {
481+
var simpleDiff simpleSchemaDiff
482+
if err = json.Unmarshal([]byte(output), &simpleDiff); err != nil {
477483
return nil, err
478484
}
479485

480486
if err = rnr.PopDir(); err != nil {
481487
return nil, err
482488
}
483-
return labels, nil
489+
var resources []string
490+
resources = append(resources, simpleDiff.AddedResources...)
491+
resources = append(resources, simpleDiff.ModifiedResources...)
492+
resources = append(resources, simpleDiff.RemovedResources...)
493+
return resources, nil
484494
}
485495

486496
// Run the missing test detector and return the results.

.ci/magician/cmd/generate_comment_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,11 @@ func TestExecGenerateComment(t *testing.T) {
8989
{"/mock/dir/tfoics", "git", []string{"diff", "origin/auto-pr-123456-old", "origin/auto-pr-123456", "--shortstat"}, map[string]string(nil)},
9090
{"/mock/dir/magic-modules/tools/diff-processor", "make", []string{"build"}, diffProcessorEnv},
9191
{"/mock/dir/magic-modules/tools/diff-processor", "bin/diff-processor", []string{"breaking-changes"}, map[string]string(nil)},
92-
{"/mock/dir/magic-modules/tools/diff-processor", "bin/diff-processor", []string{"changed-schema-resources"}, map[string]string(nil)},
92+
{"/mock/dir/magic-modules/tools/diff-processor", "bin/diff-processor", []string{"schema-diff"}, map[string]string(nil)},
9393
{"/mock/dir/magic-modules/tools/diff-processor", "make", []string{"build"}, diffProcessorEnv},
9494
{"/mock/dir/magic-modules/tools/diff-processor", "bin/diff-processor", []string{"breaking-changes"}, map[string]string(nil)},
9595
{"/mock/dir/magic-modules/tools/diff-processor", "bin/diff-processor", []string{"detect-missing-tests", "/mock/dir/tpgb/google-beta/services"}, map[string]string(nil)},
96-
{"/mock/dir/magic-modules/tools/diff-processor", "bin/diff-processor", []string{"changed-schema-resources"}, map[string]string(nil)},
96+
{"/mock/dir/magic-modules/tools/diff-processor", "bin/diff-processor", []string{"schema-diff"}, map[string]string(nil)},
9797
},
9898
} {
9999
if actualCalls, ok := mr.Calls(method); !ok {

.ci/magician/cmd/mock_runner_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func NewMockRunner() MockRunner {
7070
"/mock/dir/magic-modules/.ci/magician git [clone -b auto-pr-123456 https://modular-magician:*******@github.com/modular-magician/terraform-provider-google-beta /mock/dir/tpgb] map[]": "",
7171
"/mock/dir/magic-modules/tools/diff-processor bin/diff-processor [breaking-changes] map[]": "",
7272
"/mock/dir/magic-modules/tools/diff-processor make [build] " + sortedEnvString(diffProcessorEnv): "",
73-
"/mock/dir/magic-modules/tools/diff-processor bin/diff-processor [changed-schema-resources] map[]": "[\"google_alloydb_instance\"]",
73+
"/mock/dir/magic-modules/tools/diff-processor bin/diff-processor [schema-diff] map[]": "{\"AddedResources\": [\"google_alloydb_instance\"]}",
7474
"/mock/dir/magic-modules/tools/diff-processor bin/diff-processor [detect-missing-tests /mock/dir/tpgb/google-beta/services] map[]": `{"google_folder_access_approval_settings":{"SuggestedTest":"resource \"google_folder_access_approval_settings\" \"primary\" {\n uncovered_field = # value needed\n}","Tests":["a","b","c"]}}`,
7575
"/mock/dir/tgc git [diff origin/auto-pr-123456-old origin/auto-pr-123456 --shortstat] map[]": " 1 file changed, 10 insertions(+)\n",
7676
"/mock/dir/tgc git [fetch origin auto-pr-123456-old] map[]": "",

.github/workflows/build-downstream.yml

-4
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ on:
99
required: true
1010
type: string
1111

12-
concurrency:
13-
group: ${{ inputs.repo }}-${{ github.event_name == 'merge_group' && format('merge-group-{0}', github.event.merge_group.head_sha) || github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || format('commit-{0}', github.sha) }}
14-
cancel-in-progress: true
15-
1612
jobs:
1713
generate-repository:
1814
runs-on: ubuntu-22.04

mmv1/products/accesscontextmanager/ServicePerimeter.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,10 @@ properties:
348348
description: |
349349
Value for permission should be a valid Cloud IAM permission for the
350350
corresponding `serviceName` in `ApiOperation`.
351+
- name: 'title'
352+
type: 'string'
353+
description: |
354+
Human readable title. Must be unique within the perimeter. Does not affect behavior.
351355
- name: 'egressPolicies'
352356
type: Array
353357
description: |
@@ -472,6 +476,10 @@ properties:
472476
description: |
473477
Value for permission should be a valid Cloud IAM permission for the
474478
corresponding `serviceName` in `ApiOperation`.
479+
- name: 'title'
480+
type: 'string'
481+
description: |
482+
Human readable title. Must be unique within the perimeter. Does not affect behavior.
475483
- name: 'spec'
476484
type: NestedObject
477485
description: |
@@ -666,6 +674,10 @@ properties:
666674
description: |
667675
Value for permission should be a valid Cloud IAM permission for the
668676
corresponding `serviceName` in `ApiOperation`.
677+
- name: 'title'
678+
type: 'string'
679+
description: |
680+
Human readable title. Must be unique within the perimeter. Does not affect behavior.
669681
- name: 'egressPolicies'
670682
type: Array
671683
description: |
@@ -788,6 +800,10 @@ properties:
788800
description: |
789801
Value for permission should be a valid Cloud IAM permission for the
790802
corresponding `serviceName` in `ApiOperation`.
803+
- name: 'title'
804+
type: 'string'
805+
description: |
806+
Human readable title. Must be unique within the perimeter. Does not affect behavior.
791807
- name: 'useExplicitDryRunSpec'
792808
type: Boolean
793809
description: |

mmv1/products/accesscontextmanager/ServicePerimeterDryRunEgressPolicy.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ async:
6262
identity:
6363
- egressFrom
6464
- egressTo
65+
- title
6566
nested_query:
6667
keys:
6768
- spec
@@ -80,6 +81,8 @@ exclude_tgc: true
8081
exclude_sweeper: true
8182
examples:
8283
- name: 'access_context_manager_service_perimeter_dry_run_egress_policy'
84+
vars:
85+
egress_policy_title: 'egress policy title'
8386
exclude_test: true
8487
parameters:
8588
- name: 'perimeter'
@@ -204,6 +207,10 @@ properties:
204207
description: |
205208
Value for permission should be a valid Cloud IAM permission for the
206209
corresponding `serviceName` in `ApiOperation`.
210+
- name: 'title'
211+
type: 'string'
212+
description: |
213+
Human readable title. Must be unique within the perimeter. Does not affect behavior.
207214
immutable: true
208215
- name: 'accessPolicyId'
209216
type: String

mmv1/products/accesscontextmanager/ServicePerimeterDryRunIngressPolicy.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ async:
6363
identity:
6464
- ingressFrom
6565
- ingressTo
66+
- title
6667
nested_query:
6768
keys:
6869
- spec
@@ -81,6 +82,8 @@ exclude_tgc: true
8182
exclude_sweeper: true
8283
examples:
8384
- name: 'access_context_manager_service_perimeter_dry_run_ingress_policy'
85+
vars:
86+
ingress_policy_title: 'ingress policy title'
8487
exclude_test: true
8588
parameters:
8689
- name: 'perimeter'
@@ -204,6 +207,10 @@ properties:
204207
description: |
205208
Value for permission should be a valid Cloud IAM permission for the
206209
corresponding `serviceName` in `ApiOperation`.
210+
- name: 'title'
211+
type: 'string'
212+
description: |
213+
Human readable title. Must be unique within the perimeter. Does not affect behavior.
207214
- name: 'accessPolicyId'
208215
type: String
209216
description: |

mmv1/products/accesscontextmanager/ServicePerimeterEgressPolicy.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ async:
6262
identity:
6363
- egressFrom
6464
- egressTo
65+
- title
6566
nested_query:
6667
keys:
6768
- status
@@ -77,6 +78,8 @@ exclude_tgc: true
7778
exclude_sweeper: true
7879
examples:
7980
- name: 'access_context_manager_service_perimeter_egress_policy'
81+
vars:
82+
egress_policy_title: 'egress policy title'
8083
exclude_test: true
8184
parameters:
8285
- name: 'perimeter'
@@ -202,6 +205,10 @@ properties:
202205
description: |
203206
Value for permission should be a valid Cloud IAM permission for the
204207
corresponding `serviceName` in `ApiOperation`.
208+
- name: 'title'
209+
type: 'string'
210+
description: |
211+
Human readable title. Must be unique within the perimeter. Does not affect behavior.
205212
- name: 'accessPolicyId'
206213
type: String
207214
description: |

mmv1/products/accesscontextmanager/ServicePerimeterIngressPolicy.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ async:
6363
identity:
6464
- ingressFrom
6565
- ingressTo
66+
- title
6667
nested_query:
6768
keys:
6869
- status
@@ -78,6 +79,8 @@ exclude_tgc: true
7879
exclude_sweeper: true
7980
examples:
8081
- name: 'access_context_manager_service_perimeter_ingress_policy'
82+
vars:
83+
ingress_policy_title: 'ingress policy title'
8184
exclude_test: true
8285
parameters:
8386
- name: 'perimeter'
@@ -204,6 +207,10 @@ properties:
204207
description: |
205208
Value for permission should be a valid Cloud IAM permission for the
206209
corresponding `serviceName` in `ApiOperation`.
210+
- name: 'title'
211+
type: 'string'
212+
description: |
213+
Human readable title. Must be unique within the perimeter. Does not affect behavior.
207214
- name: 'accessPolicyId'
208215
type: String
209216
description: |

mmv1/products/accesscontextmanager/ServicePerimeters.yaml

+17-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# limitations under the License.
1313

1414
---
15-
# This is the plural of `ServicePerimeter`, any changes here should be made to `ServicePerimeter` as well
15+
# This is the plural of `ServicePerimeter`, any changes here should be made to `ServicePerimeter` as well
1616
name: 'ServicePerimeters'
1717
api_resource_type_kind: ServicePerimeter
1818
description: |
@@ -329,6 +329,10 @@ properties:
329329
description: |
330330
Value for permission should be a valid Cloud IAM permission for the
331331
corresponding `serviceName` in `ApiOperation`.
332+
- name: 'title'
333+
type: 'string'
334+
description: |
335+
Human readable title. Must be unique within the perimeter. Does not affect behavior.
332336
- name: 'egressPolicies'
333337
type: Array
334338
description: |
@@ -450,6 +454,10 @@ properties:
450454
description: |
451455
Value for permission should be a valid Cloud IAM permission for the
452456
corresponding `serviceName` in `ApiOperation`.
457+
- name: 'title'
458+
type: 'string'
459+
description: |
460+
Human readable title. Must be unique within the perimeter. Does not affect behavior.
453461
- name: 'spec'
454462
type: NestedObject
455463
description: |
@@ -637,6 +645,10 @@ properties:
637645
description: |
638646
Value for permission should be a valid Cloud IAM permission for the
639647
corresponding `serviceName` in `ApiOperation`.
648+
- name: 'title'
649+
type: 'string'
650+
description: |
651+
Human readable title. Must be unique within the perimeter. Does not affect behavior.
640652
- name: 'egressPolicies'
641653
type: Array
642654
description: |
@@ -760,6 +772,10 @@ properties:
760772
description: |
761773
Value for permission should be a valid Cloud IAM permission for the
762774
corresponding `serviceName` in `ApiOperation`.
775+
- name: 'title'
776+
type: 'string'
777+
description: |
778+
Human readable title. Must be unique within the perimeter. Does not affect behavior.
763779
- name: 'useExplicitDryRunSpec'
764780
type: Boolean
765781
description: |

mmv1/products/apihub/product.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
---
1515
name: Apihub
16-
display_name: API hub
16+
display_name: "API Hub"
1717
scopes:
1818
- https://www.googleapis.com/auth/cloud-platform
1919
versions:

mmv1/products/appengine/StandardAppVersion.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,9 @@ properties:
407407
type: Integer
408408
description: |
409409
Maximum number of instances to run for this version. Set to zero to disable maxInstances configuration.
410+
411+
**Note:** Starting from February 17, 2025, App Engine sets the maxInstances default for standard environment deployments to 20. This change doesn't impact existing apps. To override the default, specify a new value between 0 and 2147483647, and deploy a new version or redeploy over an existing version. To disable the maxInstances default configuration setting, specify the maximum permitted value 2147483647.
412+
default_from_api: true
410413
- name: 'basicScaling'
411414
type: NestedObject
412415
description: |

mmv1/products/apphub/Application.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ timeouts:
2929
update_minutes: 20
3030
delete_minutes: 20
3131
autogen_async: true
32+
autogen_status: QXBwbGljYXRpb24=
3233
async:
3334
actions: ['create', 'delete', 'update']
3435
type: 'OpAsync'

mmv1/products/apphub/Service.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ timeouts:
2929
update_minutes: 20
3030
delete_minutes: 20
3131
autogen_async: true
32+
autogen_status: U2VydmljZQ==
3233
async:
3334
actions: ['create', 'delete', 'update']
3435
type: 'OpAsync'

mmv1/products/apphub/ServiceProjectAttachment.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ timeouts:
2828
update_minutes: 20
2929
delete_minutes: 20
3030
autogen_async: true
31+
autogen_status: U2VydmljZVByb2plY3RBdHRhY2htZW50
3132
async:
3233
actions: ['create', 'delete', 'update']
3334
type: 'OpAsync'

mmv1/products/apphub/Workload.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ timeouts:
2929
update_minutes: 20
3030
delete_minutes: 20
3131
autogen_async: true
32+
autogen_status: V29ya2xvYWQK
3233
async:
3334
actions: ['create', 'delete', 'update']
3435
type: 'OpAsync'

mmv1/products/bigqueryanalyticshub/ListingSubscription.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
---
1515
name: 'ListingSubscription'
16+
api_resource_type_kind: Subscription
1617
description: A Bigquery Analytics Hub listing subscription
1718
references:
1819
guides:

mmv1/products/bigqueryanalyticshub/product.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
---
1515
name: 'BigqueryAnalyticsHub'
16-
display_name: 'Bigquery Analytics Hub'
16+
display_name: 'BigQuery Analytics Hub'
1717
versions:
1818
- name: 'beta'
1919
base_url: 'https://analyticshub.googleapis.com/v1/'

0 commit comments

Comments
 (0)