Skip to content

[DataProtectionBackup] Fix constant-format backup job duration parsing - #63305

Open
Minghao Chen (HarveyLink) wants to merge 3 commits into
Azure:mainfrom
HarveyLink:issue59573
Open

Minghao Chen (HarveyLink) wants to merge 3 commits into
Azure:mainfrom
HarveyLink:issue59573

Conversation

@HarveyLink

@HarveyLink Minghao Chen (HarveyLink) commented Sep 23, 2026

Copy link
Copy Markdown
Member

Summary

Fixes #59573.

AzureBackupJob.duration remains a REST string, but the C# client customization now maps it to a DurationConstant scalar encoded as duration-constant. The generated SDK consequently uses the .NET constant ("c") format for TimeSpan serialization/deserialization, accepting values such as 00:34:34.9902732 without changing the public API or Swagger contract.

This PR includes the generated serializer/deserializer fix, regression coverage, changelog entry, and updates tsp-location.yaml to companion REST-spec draft PR Azure/azure-rest-api-specs#46623 at commit 2f91f918ab7a264dc01bd01635c74e1f684d2ec8.

Testing

  • dotnet test sdk\\dataprotection\\Azure.ResourceManager.DataProtectionBackup\\tests\\Azure.ResourceManager.DataProtectionBackup.Tests.csproj --filter FullyQualifiedName~DeserializeBackupJobWithConstantDuration

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@azure-pipelines

Copy link
Copy Markdown
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.

@github-actions github-actions Bot added the Mgmt This issue is related to a management-plane library. label Sep 23, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@azure-pipelines

Copy link
Copy Markdown
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.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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, and tsp-location.yaml
  • Contextual naming: not applicable — no new public types introduced
  • ApiCompat / breaking changes: pass — net - pullrequest CI check succeeded on head commit 85964ea9; 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

This branch has not been deployed

No deployments
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.

[BUG] DataProtectionBackup: DataProtectionBackupJobProperties.Duration mis-generated as TimeSpan, throws FormatException enumerating backup jobs

1 participant