Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renaming all remaining skip_* attributes #11696

Merged
merged 5 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions mmv1/api/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ type Resource struct {
StateUpgraders bool `yaml:"state_upgraders"`

// Do not apply the default attribution label
SkipAttributionLabel bool `yaml:"skip_attribution_label"`
ExcludeAttributionLabel bool `yaml:"exclude_attribution_label"`

// This block inserts the named function and its attribute into the
// resource schema -- the code for the migrate_state function must
Expand All @@ -267,12 +267,12 @@ type Resource struct {

// Set to true for resources that are unable to be read from the API, such as
// public ca external account keys
SkipRead bool `yaml:"skip_read"`
ExcludeRead bool `yaml:"exclude_read"`

// Set to true for resources that wish to disable automatic generation of default provider
// value customdiff functions
// TODO rewrite: 1 instance used
SkipDefaultCdiff bool `yaml:"skip_default_cdiff"`
ExcludeDefaultCdiff bool `yaml:"exclude_default_cdiff"`

// This enables resources that get their project via a reference to a different resource
// instead of a project field to use User Project Overrides
Expand Down Expand Up @@ -604,7 +604,7 @@ func (r *Resource) AddLabelsRelatedFields(props []*Type, parent *Type) []*Type {

func (r *Resource) addLabelsFields(props []*Type, parent *Type, labels *Type) []*Type {
if parent == nil || parent.FlattenObject {
if r.SkipAttributionLabel {
if r.ExcludeAttributionLabel {
r.CustomDiff = append(r.CustomDiff, "tpgresource.SetLabelsDiffWithoutAttributionLabel")
} else {
r.CustomDiff = append(r.CustomDiff, "tpgresource.SetLabelsDiff")
Expand Down Expand Up @@ -1291,7 +1291,7 @@ func (r Resource) IamAttributes() []string {
// we can reuse that config to create a resource to test IAM resources with.
func (r Resource) FirstTestExample() resource.Examples {
examples := google.Reject(r.Examples, func(e resource.Examples) bool {
return e.SkipTest
return e.ExcludeTest
})
examples = google.Reject(examples, func(e resource.Examples) bool {
return (r.ProductMetadata.VersionObjOrClosest(r.TargetVersionName).CompareTo(r.ProductMetadata.VersionObjOrClosest(e.MinVersion)) < 0)
Expand All @@ -1302,7 +1302,7 @@ func (r Resource) FirstTestExample() resource.Examples {

func (r Resource) ExamplePrimaryResourceId() string {
examples := google.Reject(r.Examples, func(e resource.Examples) bool {
return e.SkipTest
return e.ExcludeTest
})
examples = google.Reject(examples, func(e resource.Examples) bool {
return (r.ProductMetadata.VersionObjOrClosest(r.TargetVersionName).CompareTo(r.ProductMetadata.VersionObjOrClosest(e.MinVersion)) < 0)
Expand Down Expand Up @@ -1580,7 +1580,7 @@ func (r Resource) IsExcluded() bool {

func (r Resource) TestExamples() []resource.Examples {
return google.Reject(google.Reject(r.Examples, func(e resource.Examples) bool {
return e.SkipTest
return e.ExcludeTest
}), func(e resource.Examples) bool {
return e.MinVersion != "" && slices.Index(product.ORDER, r.TargetVersionName) < slices.Index(product.ORDER, e.MinVersion)
})
Expand Down
6 changes: 3 additions & 3 deletions mmv1/api/resource/examples.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,13 @@ type Examples struct {
IgnoreReadExtra []string `yaml:"ignore_read_extra"`

// Whether to skip generating tests for this resource
SkipTest bool `yaml:"skip_test"`
ExcludeTest bool `yaml:"exclude_test"`

// Whether to skip generating docs for this example
SkipDocs bool `yaml:"skip_docs"`
ExcludeDocs bool `yaml:"exclude_docs"`

// Whether to skip import tests for this example
SkipImportTest bool `yaml:"skip_import_test"`
ExcludeImportTest bool `yaml:"exclude_import_test"`

// The name of the primary resource for use in IAM tests. IAM tests need
// a reference to the primary resource to create IAM policies for
Expand Down
2 changes: 1 addition & 1 deletion mmv1/api/resource/iam_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type IamPolicy struct {
// Boolean of if tests for IAM resources should exclude import test steps
// Used to handle situations where typical generated IAM tests cannot import
// due to the parent resource having an API-generated id
SkipImportTest bool `yaml:"skip_import_test"`
ExcludeImportTest bool `yaml:"exclude_import_test"`

// Character that separates resource identifier from method call in URL
// For example, PubSub subscription uses {resource}:getIamPolicy
Expand Down
2 changes: 1 addition & 1 deletion mmv1/api/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ type Type struct {

EnumValues []string `yaml:"enum_values"`

SkipDocsValues bool `yaml:"skip_docs_values"`
ExcludeDocsValues bool `yaml:"exclude_docs_values"`

// ====================
// Array Fields
Expand Down
4 changes: 2 additions & 2 deletions mmv1/products/accessapproval/go_FolderSettings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ examples:
folder_name: 'my-folder'
test_env_vars:
org_id: 'ORG_ID'
skip_test: true
exclude_test: true
- name: 'folder_access_approval_active_key_version'
primary_resource_id: 'folder_access_approval'
vars:
folder_name: 'my-folder'
test_env_vars:
org_id: 'ORG_ID'
skip_test: true
exclude_test: true
parameters:
- name: 'folder_id'
type: String
Expand Down
4 changes: 2 additions & 2 deletions mmv1/products/accessapproval/go_OrganizationSettings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ examples:
primary_resource_id: 'organization_access_approval'
test_env_vars:
org_id: 'ORG_ID'
skip_test: true
exclude_test: true
- name: 'organization_access_approval_active_key_version'
primary_resource_id: 'organization_access_approval'
test_env_vars:
org_id: 'ORG_ID'
skip_test: true
exclude_test: true
parameters:
- name: 'organization_id'
type: String
Expand Down
4 changes: 2 additions & 2 deletions mmv1/products/accessapproval/go_ProjectSettings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ examples:
test_env_vars:
project: 'PROJECT_NAME'
org_id: 'ORG_ID'
skip_test: true
exclude_test: true
- name: 'project_access_approval_active_key_version'
primary_resource_id: 'project_access_approval'
test_env_vars:
project: 'PROJECT_NAME'
org_id: 'ORG_ID'
skip_test: true
exclude_test: true
parameters:
- name: 'project_id'
type: String
Expand Down
2 changes: 1 addition & 1 deletion mmv1/products/accesscontextmanager/go_AccessLevel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ examples:
primary_resource_id: 'access-level'
vars:
access_level_name: 'chromeos_no_lock'
skip_test: true
exclude_test: true
parameters:
- name: 'parent'
type: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ examples:
vars:
access_level_name: 'chromeos_no_lock'
account_id: 'my-account-id'
skip_test: true
exclude_test: true
parameters:
- name: 'accessLevel'
type: ResourceRef
Expand Down
2 changes: 1 addition & 1 deletion mmv1/products/accesscontextmanager/go_AccessLevels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ examples:
vars:
access_level_name1: 'chromeos_no_lock'
access_level_name2: 'mac_no_lock'
skip_test: true
exclude_test: true
parameters:
- name: 'parent'
type: String
Expand Down
6 changes: 3 additions & 3 deletions mmv1/products/accesscontextmanager/go_AccessPolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ exclude_sweeper: true
examples:
- name: 'access_context_manager_access_policy_basic'
primary_resource_id: 'access-policy'
skip_test: true
exclude_test: true
- name: 'access_context_manager_access_policy_scoped'
primary_resource_id: 'access-policy'
test_env_vars:
org_id: 'ORG_ID'
project: 'PROJECT_NAME'
skip_test: true
skip_import_test: true
exclude_test: true
exclude_import_test: true
parameters:
- name: 'parent'
type: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ exclude_sweeper: true
examples:
- name: 'access_context_manager_authorized_orgs_desc_basic'
primary_resource_id: 'authorized-orgs-desc'
skip_test: true
exclude_test: true
parameters:
- name: 'parent'
type: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ examples:
org_id: 'ORG_ID'
org_domain: 'ORG_DOMAIN'
cust_id: 'CUST_ID'
skip_test: true
exclude_test: true
parameters:
- name: 'organizationId'
type: String
Expand Down
6 changes: 3 additions & 3 deletions mmv1/products/accesscontextmanager/go_ServicePerimeter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,17 @@ examples:
vars:
access_level_name: 'chromeos_no_lock'
service_perimeter_name: 'restrict_storage'
skip_test: true
exclude_test: true
- name: 'access_context_manager_service_perimeter_secure_data_exchange'
primary_resource_id: 'secure-data-exchange'
vars:
access_level_name: 'secure_data_exchange'
skip_test: true
exclude_test: true
- name: 'access_context_manager_service_perimeter_dry-run'
primary_resource_id: 'service-perimeter'
vars:
service_perimeter_name: 'restrict_bigquery_dryrun_storage'
skip_test: true
exclude_test: true
parameters:
- name: 'parent'
type: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ exclude_tgc: true
exclude_sweeper: true
examples:
- name: 'access_context_manager_service_perimeter_dry_run_egress_policy'
skip_test: true
exclude_test: true
parameters:
- name: 'perimeter'
type: ResourceRef
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ exclude_tgc: true
exclude_sweeper: true
examples:
- name: 'access_context_manager_service_perimeter_dry_run_ingress_policy'
skip_test: true
exclude_test: true
parameters:
- name: 'perimeter'
type: ResourceRef
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ examples:
primary_resource_id: 'service-perimeter-dry-run-resource'
vars:
service_perimeter_name: 'restrict_all'
skip_test: true
exclude_test: true
parameters:
- name: 'perimeterName'
type: ResourceRef
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ exclude_tgc: true
exclude_sweeper: true
examples:
- name: 'access_context_manager_service_perimeter_egress_policy'
skip_test: true
exclude_test: true
parameters:
- name: 'perimeter'
type: ResourceRef
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ exclude_tgc: true
exclude_sweeper: true
examples:
- name: 'access_context_manager_service_perimeter_ingress_policy'
skip_test: true
exclude_test: true
parameters:
- name: 'perimeter'
type: ResourceRef
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ examples:
primary_resource_id: 'service-perimeter-resource'
vars:
service_perimeter_name: 'restrict_all'
skip_test: true
exclude_test: true
parameters:
- name: 'perimeterName'
type: ResourceRef
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ examples:
vars:
access_level_name: 'chromeos_no_lock'
service_perimeter_name: 'restrict_storage'
skip_test: true
exclude_test: true
parameters:
- name: 'parent'
type: String
Expand Down
2 changes: 1 addition & 1 deletion mmv1/products/activedirectory/go_Domain.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ examples:
domain_name: 'tfgen'
ignore_read_extra:
- 'deletion_protection'
skip_test: true
exclude_test: true
virtual_fields:
- name: 'deletion_protection'
description: |
Expand Down
2 changes: 1 addition & 1 deletion mmv1/products/activedirectory/go_DomainTrust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ custom_code:
examples:
- name: 'active_directory_domain_trust_basic'
primary_resource_id: 'ad-domain-trust'
skip_test: true
exclude_test: true
parameters:
- name: 'domain'
type: String
Expand Down
4 changes: 2 additions & 2 deletions mmv1/products/activedirectory/go_Peering.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ examples:
test_env_vars:
org_id: 'ORG_ID'
billing_account: 'BILLING_ACCT'
skip_test: true
skip_import_test: true
exclude_test: true
exclude_import_test: true
parameters:
- name: 'peeringId'
type: String
Expand Down
8 changes: 4 additions & 4 deletions mmv1/products/alloydb/go_Backup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ examples:
ignore_read_extra:
- 'reconciling'
- 'update_time'
skip_test: true
exclude_test: true
- name: 'alloydb_backup_basic_test'
primary_resource_id: 'default'
vars:
Expand All @@ -65,7 +65,7 @@ examples:
ignore_read_extra:
- 'reconciling'
- 'update_time'
skip_docs: true
exclude_docs: true
- name: 'alloydb_backup_full'
primary_resource_id: 'default'
vars:
Expand All @@ -76,7 +76,7 @@ examples:
ignore_read_extra:
- 'reconciling'
- 'update_time'
skip_test: true
exclude_test: true
- name: 'alloydb_backup_full_test'
primary_resource_id: 'default'
vars:
Expand All @@ -89,7 +89,7 @@ examples:
ignore_read_extra:
- 'reconciling'
- 'update_time'
skip_docs: true
exclude_docs: true
skip_vcr: true
parameters:
- name: 'backupId'
Expand Down
6 changes: 3 additions & 3 deletions mmv1/products/alloydb/go_Cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,14 @@ examples:
ignore_read_extra:
- 'reconciling'
- 'update_time'
skip_test: true
exclude_test: true
- name: 'alloydb_secondary_cluster_basic'
primary_resource_id: 'secondary'
vars:
alloydb_primary_cluster_name: 'alloydb-primary-cluster'
alloydb_primary_instance_name: 'alloydb-primary-instance'
alloydb_secondary_cluster_name: 'alloydb-secondary-cluster'
skip_test: true
exclude_test: true
- name: 'alloydb_secondary_cluster_basic_test'
primary_resource_id: 'secondary'
vars:
Expand All @@ -106,7 +106,7 @@ examples:
network_name: 'alloydb-network'
test_vars_overrides:
'network_name': 'acctest.BootstrapSharedServiceNetworkingConnection(t, "alloydbinstance-network-config-1")'
skip_docs: true
exclude_docs: true
virtual_fields:
- name: 'deletion_policy'
description: |
Expand Down
Loading
Loading