Skip to content

Conversation

@jliusan
Copy link
Member

@jliusan jliusan commented Nov 24, 2025

checking migration breaking change

Copilot AI review requested due to automatic review settings November 24, 2025 06:22
@github-actions github-actions bot added the Mgmt This issue is related to a management-plane library. label Nov 24, 2025
Copilot finished reviewing on behalf of jliusan November 24, 2025 06:23
@github-actions
Copy link

API Change Check

APIView identified API level changes in this PR and created the following API reviews

sdk/resourcemanager/redisenterprise/armredisenterprise

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR migrates the Redis Enterprise ARM client from v3 to v4.0.0-beta.1, transitioning from AutoRest code generation to the Go Code Generator. The changes include updating the API version from 2025-07-01 to 2025-08-01-preview and introducing new migration functionality.

Key Changes

  • Version bump from v3.0.0 to v4.0.0-beta.1
  • API version update from 2025-07-01 to 2025-08-01-preview
  • New MigrationClient with support for Azure Cache for Redis migration operations
  • Response and options type naming simplified (removed client-specific prefixes)
  • Added maintenance window configuration support

Reviewed changes

Copilot reviewed 45 out of 46 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
version.go Updates module version to v4.0.0-beta.1
go.mod Updates module path to v4 and azcore dependency
models.go Adds migration types, maintenance configuration; contains critical bugs with duplicated PrivateEndpointConnection fields
models_serde.go Updates serialization code; contains critical bugs with duplicated marshal/unmarshal logic
responses.go Simplifies response type names (removes client prefixes)
options.go Simplifies options type names (removes client prefixes)
migration_client.go New client for migration operations
*_client.go Updates API version, comment formatting, and type references
fake/* Updates fake server implementations for testing
constants.go Adds migration-related constants and documentation comments
Comments suppressed due to low confidence (1)

sdk/resourcemanager/redisenterprise/armredisenterprise/models_serde.go:1810

  • The PrivateEndpointConnection UnmarshalJSON method has duplicated case statements in the switch. Each field (id, name, properties, systemData, type) appears twice, which will cause the second case to never be reached. Remove the duplicate case statements.
		case "id":
			err = unpopulate(val, "ID", &p.ID)
			delete(rawMsg, key)
		case "id":
			err = unpopulate(val, "ID", &p.ID)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &p.Name)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &p.Name)
			delete(rawMsg, key)
		case "properties":
			err = unpopulate(val, "Properties", &p.Properties)
			delete(rawMsg, key)
		case "properties":
			err = unpopulate(val, "Properties", &p.Properties)
			delete(rawMsg, key)
		case "systemData":
			err = unpopulate(val, "SystemData", &p.SystemData)
			delete(rawMsg, key)
		case "systemData":
			err = unpopulate(val, "SystemData", &p.SystemData)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &p.Type)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &p.Type)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", p, err)
		}
	}
	return nil
}

Comment on lines +722 to 747
// The private endpoint connection properties
Properties *PrivateEndpointConnectionProperties

// READ-ONLY; READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
ID *string

// READ-ONLY; READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
ID *string

// READ-ONLY; READ-ONLY; The name of the resource
Name *string

// READ-ONLY; READ-ONLY; The name of the resource
Name *string

// READ-ONLY; READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
SystemData *SystemData

// READ-ONLY; READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
SystemData *SystemData

// READ-ONLY; READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
Type *string

// READ-ONLY; READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
Type *string
Copy link

Copilot AI Nov 24, 2025

Choose a reason for hiding this comment

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

The PrivateEndpointConnection struct has duplicated fields. Each field (ID, Name, Properties, SystemData, Type) appears twice in the struct definition. This will cause compilation errors. Remove the duplicate field declarations.

Suggested change
// The private endpoint connection properties
Properties *PrivateEndpointConnectionProperties
// READ-ONLY; READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
ID *string
// READ-ONLY; READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
ID *string
// READ-ONLY; READ-ONLY; The name of the resource
Name *string
// READ-ONLY; READ-ONLY; The name of the resource
Name *string
// READ-ONLY; READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
SystemData *SystemData
// READ-ONLY; READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
SystemData *SystemData
// READ-ONLY; READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
Type *string
// READ-ONLY; READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
Type *string
// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
ID *string
// READ-ONLY; The name of the resource
Name *string
// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
SystemData *SystemData
// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
Type *string

Copilot uses AI. Check for mistakes.
Comment on lines +1753 to 1761
populate(objectMap, "id", p.ID)
populate(objectMap, "name", p.Name)
populate(objectMap, "name", p.Name)
populate(objectMap, "properties", p.Properties)
populate(objectMap, "properties", p.Properties)
populate(objectMap, "systemData", p.SystemData)
populate(objectMap, "systemData", p.SystemData)
populate(objectMap, "type", p.Type)
populate(objectMap, "type", p.Type)
Copy link

Copilot AI Nov 24, 2025

Choose a reason for hiding this comment

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

The PrivateEndpointConnection MarshalJSON method has duplicated populate calls for each field. Each field is populated twice, which is unnecessary and incorrect. Remove the duplicate populate calls for id, name, properties, systemData, and type.

Suggested change
populate(objectMap, "id", p.ID)
populate(objectMap, "name", p.Name)
populate(objectMap, "name", p.Name)
populate(objectMap, "properties", p.Properties)
populate(objectMap, "properties", p.Properties)
populate(objectMap, "systemData", p.SystemData)
populate(objectMap, "systemData", p.SystemData)
populate(objectMap, "type", p.Type)
populate(objectMap, "type", p.Type)
populate(objectMap, "name", p.Name)
populate(objectMap, "properties", p.Properties)
populate(objectMap, "systemData", p.SystemData)
populate(objectMap, "type", p.Type)

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Mgmt This issue is related to a management-plane library.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants