Skip to content

Conversation

@jliusan
Copy link
Member

@jliusan jliusan commented Sep 18, 2025

…generation from spec commit: ba6bab2e42a47a66de7df007a6811b19064f7344
Copilot AI review requested due to automatic review settings September 18, 2025 04:53
@github-actions github-actions bot added the Mgmt This issue is related to a management-plane library. label Sep 18, 2025
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 pull request releases version 4.0.0 of the Azure Data Protection SDK for Go. The update upgrades the SDK from API version 2024-04-01 to 2025-07-01, introducing new types, operations, and improvements while maintaining backward compatibility in most areas.

Key changes include:

  • Update to API version 2025-07-01 with new client generation tooling
  • Addition of new ADLS blob backup datasource parameters and validation operations
  • Enhanced operation responses with better structured response types
  • Improved error handling and documentation updates

Reviewed Changes

Copilot reviewed 87 out of 89 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
version.go Updates module version to v4.0.0
models.go Adds new types like AdlsBlobBackupDatasourceParameters and ValidateForModifyBackupRequest
responses.go Introduces new response types and removes inline JSON unmarshaling
*_client.go Updates API version references and improves parameter handling
*_example_test.go Updates examples with new response structures and subscription IDs

Comment on lines +59 to +61
if len(data) == 0 {
return nil
}
Copy link

Copilot AI Sep 18, 2025

Choose a reason for hiding this comment

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

Magic number 0 should be replaced with a named constant for better code maintainability. Consider defining const emptyDataLength = 0 or use a more descriptive check like if data == nil || len(data) == 0.

Copilot uses AI. Check for mistakes.
}
ctx := context.Background()
clientFactory, err := armdataprotection.NewClientFactory("<subscription-id>", cred, nil)
clientFactory, err := armdataprotection.NewClientFactory("04cf684a-d41f-4550-9f70-7708a3a2283b", cred, nil)
Copy link

Copilot AI Sep 18, 2025

Choose a reason for hiding this comment

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

Hard-coded subscription ID in example code should be replaced with a placeholder like <subscription-id> to avoid potential security issues if this example is copied to production code.

Suggested change
clientFactory, err := armdataprotection.NewClientFactory("04cf684a-d41f-4550-9f70-7708a3a2283b", cred, nil)
clientFactory, err := armdataprotection.NewClientFactory("<subscription-id>", cred, nil)

Copilot uses AI. Check for mistakes.
}
ctx := context.Background()
clientFactory, err := armdataprotection.NewClientFactory("<subscription-id>", cred, nil)
clientFactory, err := armdataprotection.NewClientFactory("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil)
Copy link

Copilot AI Sep 18, 2025

Choose a reason for hiding this comment

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

Hard-coded subscription ID in example code should be replaced with a placeholder like <subscription-id> to avoid potential security issues if this example is copied to production code.

Copilot uses AI. Check for mistakes.
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdataprotection.NewClientFactory("04cf684a-d41f-4550-9f70-7708a3a2283b", cred, nil)
Copy link

Copilot AI Sep 18, 2025

Choose a reason for hiding this comment

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

Hard-coded subscription ID in example code should be replaced with a placeholder like <subscription-id> to avoid potential security issues if this example is copied to production code.

Suggested change
clientFactory, err := armdataprotection.NewClientFactory("04cf684a-d41f-4550-9f70-7708a3a2283b", cred, nil)
clientFactory, err := armdataprotection.NewClientFactory("<subscription-id>", cred, nil)

Copilot uses AI. Check for mistakes.
}
ctx := context.Background()
clientFactory, err := armdataprotection.NewClientFactory("<subscription-id>", cred, nil)
clientFactory, err := armdataprotection.NewClientFactory("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil)
Copy link

Copilot AI Sep 18, 2025

Choose a reason for hiding this comment

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

Hard-coded subscription ID in example code should be replaced with a placeholder like <subscription-id> to avoid potential security issues if this example is copied to production code.

Suggested change
clientFactory, err := armdataprotection.NewClientFactory("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil)
clientFactory, err := armdataprotection.NewClientFactory("<subscription-id>", cred, nil)

Copilot uses AI. Check for mistakes.
}
ctx := context.Background()
clientFactory, err := armdataprotection.NewClientFactory("<subscription-id>", cred, nil)
clientFactory, err := armdataprotection.NewClientFactory("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil)
Copy link

Copilot AI Sep 18, 2025

Choose a reason for hiding this comment

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

Hard-coded subscription ID in example code should be replaced with a placeholder like <subscription-id> to avoid potential security issues if this example is copied to production code.

Suggested change
clientFactory, err := armdataprotection.NewClientFactory("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil)
clientFactory, err := armdataprotection.NewClientFactory("<subscription-id>", cred, nil)

Copilot uses AI. Check for mistakes.
}
ctx := context.Background()
clientFactory, err := armdataprotection.NewClientFactory("<subscription-id>", cred, nil)
clientFactory, err := armdataprotection.NewClientFactory("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil)
Copy link

Copilot AI Sep 18, 2025

Choose a reason for hiding this comment

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

Hard-coded subscription ID in example code should be replaced with a placeholder like <subscription-id> to avoid potential security issues if this example is copied to production code.

Copilot uses AI. Check for mistakes.
}
ctx := context.Background()
clientFactory, err := armdataprotection.NewClientFactory("<subscription-id>", cred, nil)
clientFactory, err := armdataprotection.NewClientFactory("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil)
Copy link

Copilot AI Sep 18, 2025

Choose a reason for hiding this comment

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

Hard-coded subscription ID in example code should be replaced with a placeholder like <subscription-id> to avoid potential security issues if this example is copied to production code.

Suggested change
clientFactory, err := armdataprotection.NewClientFactory("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil)
clientFactory, err := armdataprotection.NewClientFactory("<subscription-id>", cred, nil)

Copilot uses AI. Check for mistakes.
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdataprotection.NewClientFactory("62b829ee-7936-40c9-a1c9-47a93f9f3965", cred, nil)
Copy link

Copilot AI Sep 18, 2025

Choose a reason for hiding this comment

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

Hard-coded subscription ID in example code should be replaced with a placeholder like <subscription-id> to avoid potential security issues if this example is copied to production code.

Suggested change
clientFactory, err := armdataprotection.NewClientFactory("62b829ee-7936-40c9-a1c9-47a93f9f3965", cred, nil)
clientFactory, err := armdataprotection.NewClientFactory("<subscription-id>", cred, nil)

Copilot uses AI. Check for mistakes.
@github-actions
Copy link

API Change Check

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

sdk/resourcemanager/dataprotection/armdataprotection

@jliusan
Copy link
Member Author

jliusan commented Sep 18, 2025

The breaking changes are introduced and approved in this PR, @jhendrixMSFT , please approve this major version release by adding label of Approved Major Version, thanks.

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

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants