Skip to content

[DataProtection] Fix C# backup job duration format - #46623

Open
Minghao Chen (HarveyLink) wants to merge 2 commits into
Azure:mainfrom
HarveyLink:issue59573-duration
Open

Minghao Chen (HarveyLink) wants to merge 2 commits into
Azure:mainfrom
HarveyLink:issue59573-duration

Conversation

@HarveyLink

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

Copy link
Copy Markdown
Member

Summary

Fixes Azure/azure-sdk-for-net#59573.

The REST contract remains unchanged: AzureBackupJob.duration is still a string and generated Swagger is unchanged. This client-only customization defines a DurationConstant scalar with duration-constant encoding and applies it only to the C# alternate type for AzureBackupJob.duration. A targeted known-encoding suppression documents why this service-specific encoding is required. The C# generator therefore emits constant-format ("c") TimeSpan parsing without changing other language SDKs.

Companion SDK draft PR: Azure/azure-sdk-for-net#63305

@github-actions

github-actions Bot commented Sep 23, 2026

Copy link
Copy Markdown

Next Steps to Merge

Next steps that must be taken to merge this PR:
  • ❌ This PR targets either the main branch of the public specs repo or the RPSaaSMaster branch of the private specs repo. These branches are not intended for iterative development. Therefore, you must acknowledge you understand that after this PR is merged, the APIs are considered shipped to Azure customers. Any further attempts at in-place modifications to the APIs will be subject to Azure's versioning and breaking change policies. Additionally, for control plane APIs, you must acknowledge that you are following all the best practices documented by ARM at aka.ms/armapibestpractices. If you do intend to release the APIs to your customers by merging this PR, add the PublishToCustomers label to your PR in acknowledgement of the above. Otherwise, retarget this PR onto a feature branch, i.e. with prefix release- (see aka.ms/azsdk/api-versions#release--branches).


Comment generated by summarize-checks workflow run.

@github-actions github-actions Bot added resource-manager TypeSpec Authored with TypeSpec labels Sep 23, 2026
@github-actions

github-actions Bot commented Sep 23, 2026

Copy link
Copy Markdown

API Change Check

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

Language API Review for Package
Python azure-mgmt-dataprotection

Comment generated by After APIView workflow run.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@HarveyLink Minghao Chen (HarveyLink) changed the title [DataProtection] Emit constant format for backup job duration [DataProtection] Fix C# backup job duration format Sep 23, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

TypeSpec suppressions requiring review (testing, non-blocking)

Status: ❌ Approval required (currently under testing, review NOT enforced) — 1 suppression

⚠️ This check is currently in testing mode and is non-blocking — it will not prevent this PR from merging. This PR adds or updates the TypeSpec suppressions listed below. Suppressions are strongly discouraged — they bypass linter rules that protect API quality and consistency. Authors should avoid adding new suppressions and prefer fixing the underlying issue; reviewers should approve only when there is a clear, compelling justification and no reasonable alternative. Review each linked rule and source location, then apply Approved-TypeSpecSuppression only if every justification is acceptable. The Status column shows ✅ once the label is applied and ❌ while approval is pending.

New suppressions (1)

StatusRuleSourceJustification
@azure-tools/typespec-azure-core/known-encoding
Check for supported encodings.
client.tsp#L8The Data Protection service returns .NET constant-format durations, and this encoding is used only by the C# client alternate type.

For an overview of TypeSpec linting rules click here.
For a mapping from ARM lintdiff rules to corresponding TypeSpec linting rules click here.

💬 Have feedback on the TypeSpec suppression flow? Let us know.

@HarveyLink
Minghao Chen (HarveyLink) marked this pull request as ready for review September 23, 2026 08:35
@github-actions github-actions Bot added ARMReview WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required labels Sep 23, 2026
@gary-x-li Gary Li (gary-x-li) added ARMSignedOff <valid label in PR review process>add this label when ARM approve updates after review and removed WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required labels Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ARMAutoSignedOff-Test ARMAutoSignedOff-Trivial ARMReview ARMSignedOff <valid label in PR review process>add this label when ARM approve updates after review resource-manager TypeSpec Authored with TypeSpec

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

2 participants