Skip to content

linters - AZS004 complete enum lists to PossibleValuesFor<Enum>() 3/4 - services h-n (hdinsight ... network) - #33208

Open
katbyte wants to merge 2 commits into
mainfrom
kt/azs004-3of4
Open

linters - AZS004 complete enum lists to PossibleValuesFor<Enum>() 3/4 - services h-n (hdinsight ... network)#33208
katbyte wants to merge 2 commits into
mainfrom
kt/azs004-3of4

Conversation

@katbyte

@katbyte katbyte commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Part 3/4 of splitting #33162 (services hdinsight through network, 76 files).

Converts complete hand-written validation.StringInSlice enum value lists to the generated PossibleValuesFor<Enum>() helpers, so new enum values are picked up automatically on SDK upgrades. No validation behavior changes - only lists proven complete by the AZS004 check are converted.

Deliberately left as-is across the series: 235 lists missing values from their enum (accepting new values is a behavior change needing per-case review) and 69 lists referencing track-1 SDK enums whose Possible<Enum>Values() helpers return typed slices rather than []string. AZS004 stays disabled in .golangci.yml until these are resolved (comment updated in part 4/4).

…ValuesFor<Enum>() 3/4 - services h-n (hdinsight ... network)
@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

PR Guide Suggestions

Result for commit 7c72460 · workflow run

Linter output
==> Resolving base branch 'main'...
    base = origin/main (508192c96f48991d6cfa670a64e16e968705e4c0)
==> Building the schema linter...

==> Linting schema properties added since 'main'...

internal/services/machinelearning/machine_learning_compute_cluster_resource.go:67:4: warning [SL010] property "vm_priority" uses an abbreviation; prefer full words ("virtual_machine_priority")
→ fix: rename "vm_priority" to "virtual_machine_priority"
internal/services/mssql/mssql_virtual_machine_group_resource.go:91:3: warning [SL012] azurerm_mssql_virtual_machine_group: property "wsfc_domain_profile" has a redundant "_profile" suffix ("wsfc_domain")
→ fix: rename "wsfc_domain_profile" to "wsfc_domain"
internal/services/mssql/mssql_virtual_machine_resource.go:117:10: warning [SL007] array property "auto_backup.manual_schedule.days_of_week" does not set MaxItems; declare MinItems/MaxItems based on the API constraints
internal/services/network/application_gateway_resource.go:59:5: warning [SL007] array property "ssl_policy.disabled_protocols" does not set MaxItems; declare MinItems/MaxItems based on the API constraints
internal/services/network/application_gateway_resource.go:88:5: warning [SL010] property "ssl_policy.min_protocol_version" uses an abbreviation; prefer full words ("minimum_protocol_version")
→ fix: rename "min_protocol_version" to "minimum_protocol_version"
internal/services/network/application_gateway_resource.go:1561:4: warning [SL010] property "waf_configuration" uses an abbreviation; prefer full words ("web_application_firewall_configuration")
→ fix: rename "waf_configuration" to "web_application_firewall_configuration"
internal/services/network/network_connection_monitor_resource.go:112:6: warning [SL006] block "endpoint.filter" has no required fields and no AtLeastOneOf/ExactlyOneOf; add conditional validation so it cannot be configured empty
internal/services/network/network_connection_monitor_resource.go:118:9: warning [SL006] block "endpoint.filter.item" has no required fields and no AtLeastOneOf/ExactlyOneOf; add conditional validation so it cannot be configured empty
internal/services/network/network_connection_monitor_resource.go:208:6: warning [SL006] block "test_configuration.http_configuration" has no required fields and no AtLeastOneOf/ExactlyOneOf; add conditional validation so it cannot be configured empty
internal/services/network/virtual_hub_connection_resource.go:138:7: warning [SL010] property "routing.static_vnet_local_route_override_criteria" uses an abbreviation; prefer full words ("static_virtual_network_local_route_override_criteria")
→ fix: rename "static_vnet_local_route_override_criteria" to "static_virtual_network_local_route_override_criteria"
internal/services/network/virtual_network_gateway_resource.go:440:7: warning [SL007] array property "vpn_client_configuration.vpn_client_protocols" does not set MaxItems; declare MinItems/MaxItems based on the API constraints
internal/services/network/virtual_network_resource.go:130:3: warning [SL002] block "encryption" has a single nested property "enforcement" (MaxItems 1); consider flattening it
→ fix: flatten "encryption" into a single top-level "encryption_enforcement" property
internal/services/network/vpn_server_configuration_resource.go:55:4: warning [SL007] array property "vpn_authentication_types" does not set MaxItems; declare MinItems/MaxItems based on the API constraints
internal/services/network/web_application_firewall_policy_resource.go:301:4: warning [SL006] block "policy_settings" has no required fields and no AtLeastOneOf/ExactlyOneOf; add conditional validation so it cannot be configured empty

14 finding(s): 0 error(s), 14 warning(s)

See the Provider Contribution Guidelines for the provider's schema conventions.

@catriona-m catriona-m left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @katbyte - I found one property where a value is getting dropped, otherwise this looks good.

Type: pluginsdk.TypeString,
Optional: true,
Computed: true,
ValidateFunc: validation.StringInSlice(servers.PossibleValuesForServerVersion(), false),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the validate.ServerVersionEightPointFour value is getitng dropped here

…erset carrying 8.4 ahead of the SDK enum, so the swap changed validation behavior

@catriona-m catriona-m left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @katbyte LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants