[DataProtectionBackup] Fix constant-format backup job duration parsing - #63305
Minghao Chen (HarveyLink) wants to merge 3 commits into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: Successfully started running 1 pipeline(s). 12 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: Successfully started running 1 pipeline(s). 12 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
Management SDK Review Summary
- Scope:
sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup - Versioning: pass (CHANGELOG.md updated under Bugs Fixed; no
ApiCompatVersion/major-version changes) - API surface: pass — no changes to
api/**; changed files are limited to generated serialization internals (src/Generated/Models/DataProtectionBackupJobProperties.Serialization.cs),tests/,CHANGELOG.md, andtsp-location.yaml - Contextual naming: not applicable — no new public types introduced
- ApiCompat / breaking changes: pass —
net - pullrequestCI check succeeded on head commit85964ea9; no public API surface changed, so no breaking-change risk
No blocking management SDK review issues were found. The change updates the Duration TimeSpan format specifier from "P" to "c" in the generated serializer/deserializer to match a companion TypeSpec draft PR that encodes the property as duration-constant, adds a unit test covering constant-format deserialization, and bumps tsp-location.yaml to the draft spec commit. This is internal serialization behavior only; the public API shape (DataProtectionBackupJobProperties.Duration as TimeSpan?) is unchanged.
Note: tsp-location.yaml currently points to a draft/unmerged spec PR (Azure/azure-rest-api-specs#46623) rather than a merged main commit — this should be updated to a merged spec commit before this SDK PR is finalized, per the standard TypeSpec-backed package workflow.
Analyzed by Azure .NET Management SDK PR Review: https://github.com/Azure/azure-sdk-for-net/actions/runs/35840829115
Summary
Fixes #59573.
AzureBackupJob.durationremains a RESTstring, but the C# client customization now maps it to aDurationConstantscalar encoded asduration-constant. The generated SDK consequently uses the .NET constant ("c") format forTimeSpanserialization/deserialization, accepting values such as00:34:34.9902732without changing the public API or Swagger contract.This PR includes the generated serializer/deserializer fix, regression coverage, changelog entry, and updates
tsp-location.yamlto companion REST-spec draft PR Azure/azure-rest-api-specs#46623 at commit2f91f918ab7a264dc01bd01635c74e1f684d2ec8.Testing
dotnet test sdk\\dataprotection\\Azure.ResourceManager.DataProtectionBackup\\tests\\Azure.ResourceManager.DataProtectionBackup.Tests.csproj --filter FullyQualifiedName~DeserializeBackupJobWithConstantDuration