Skip to content

Conversation

blueww
Copy link
Member

@blueww blueww commented Sep 4, 2025

Description

Mandatory Checklist

  • SHOULD update ChangeLog.md file(s) appropriately
    • Update src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.
      • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header in the past tense.
    • Should not change ChangeLog.md if no new release is required, such as fixing test case only.
  • SHOULD regenerate markdown help files if there is cmdlet API change. Instruction
  • SHOULD have proper test coverage for changes in pull request.
  • SHOULD NOT adjust version of module manually in pull request

@Copilot Copilot AI review requested due to automatic review settings September 4, 2025 08:17
Copy link

Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status.

Copy link
Contributor

@Copilot 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 adds support for Object Replication Service (ORS) metrics in Azure Storage, enabling users to control whether metrics are collected for object replication policies through a new -EnableMetric parameter.

  • Adds new -EnableMetric boolean parameter to the Set-AzStorageObjectReplicationPolicy cmdlet
  • Updates the object replication policy model to include metrics properties
  • Modifies the display format to show metrics status in table output

Reviewed Changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
SetAzStorageObjectReplicationPolicy.cs Adds -EnableMetric parameter and logic to set metrics properties on the policy
PSObjectReplicationPolicy.cs Adds metrics model class and integration with existing policy structure
Storage.Management.format.ps1xml Updates table display format to include metrics enabled status column
Set-AzStorageObjectReplicationPolicy.md Updates help documentation with new parameter and usage examples
ChangeLog.md Documents the new metrics support feature
StorageBlobTests.ps1 Updates tests to verify metrics functionality and fixes test location references

Comment on lines 21 to 22
* Supported Enable Metrics when set object replication policy
- `New-AzStorageObjectReplicationPolicyRule`
Copy link

Copilot AI Sep 4, 2025

Choose a reason for hiding this comment

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

The ChangeLog entry is incorrect. The feature was added to Set-AzStorageObjectReplicationPolicy, not New-AzStorageObjectReplicationPolicyRule. The cmdlet name should be corrected to match the actual changes made.

Suggested change
* Supported Enable Metrics when set object replication policy
- `New-AzStorageObjectReplicationPolicyRule`
- `Set-AzStorageObjectReplicationPolicy`

Copilot uses AI. Check for mistakes.

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

Mandatory = false,
HelpMessage = "Indicates whether object replication metrics feature is enabled for the policy.",
ParameterSetName = AccountObjectParameterSet)]
[ValidateNotNullOrEmpty]
Copy link

Copilot AI Sep 4, 2025

Choose a reason for hiding this comment

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

The [ValidateNotNullOrEmpty] attribute is inappropriate for a boolean parameter. This attribute is designed for string/collection validation and will cause validation errors since boolean values cannot be null or empty in this context.

Suggested change
[ValidateNotNullOrEmpty]

Copilot uses AI. Check for mistakes.

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

@VeryEarly VeryEarly self-assigned this Sep 5, 2025
@VeryEarly VeryEarly merged commit 0d3fb2f into Azure:main Sep 5, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants