Skip to content

Fix naming inconsistency in DnsRecordType enum#59354

Merged
ArthurMa1978 merged 3 commits into
mainfrom
copilot/fix-enum-backward-compatibility
May 20, 2026
Merged

Fix naming inconsistency in DnsRecordType enum#59354
ArthurMa1978 merged 3 commits into
mainfrom
copilot/fix-enum-backward-compatibility

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 20, 2026

Fixes #59353

  • Understand CI failure: generated code check fails because DnsRecordType.Serialization.cs was manually edited to use new PascalCase names but generator produces old uppercase names
  • Run dotnet build /t:GenerateCode to regenerate
  • Update serialization file to match generator output (uses CAA/PTR/SOA/SRV/TXT which are aliases to Caa/Ptr/Soa/Srv/Txt with same int values)
  • Verify build succeeds

Add correctly-named enum values AAAA, CNAME, TLSA, NAPTR and mark
old values Aaaa, Cname, Tlsa, Naptr as EditorBrowsable(Never) for
backward compatibility.

Agent-Logs-Url: https://github.com/Azure/azure-sdk-for-net/sessions/f2102d54-dcdb-45e4-9f75-1078d1c0939c

Co-authored-by: ArthurMa1978 <20514459+ArthurMa1978@users.noreply.github.com>
Per naming conventions, acronyms with more than 2 letters should
only uppercase the first character. Add Caa, Ptr, Soa, Srv, Txt
and mark old all-caps values CAA, PTR, SOA, SRV, TXT as
EditorBrowsable(Never) for backward compatibility.

Revert incorrect previous changes that added AAAA, CNAME, TLSA,
NAPTR (these were already correctly named as Aaaa, Cname, Tlsa,
Naptr).

Agent-Logs-Url: https://github.com/Azure/azure-sdk-for-net/sessions/cae2a6a3-52bd-477b-ada2-a474f9cfe72b

Co-authored-by: ArthurMa1978 <20514459+ArthurMa1978@users.noreply.github.com>
The generated serialization file must use the original enum member
names (CAA, PTR, SOA, SRV, TXT) as the generator produces them,
since both old and new names map to the same integer values.

Agent-Logs-Url: https://github.com/Azure/azure-sdk-for-net/sessions/884c83b6-d546-4d3a-a0f7-b96a241714bd

Co-authored-by: ArthurMa1978 <20514459+ArthurMa1978@users.noreply.github.com>
@ArthurMa1978 ArthurMa1978 marked this pull request as ready for review May 20, 2026 07:46
Copilot AI review requested due to automatic review settings May 20, 2026 07:46
@ArthurMa1978 ArthurMa1978 requested a review from live1206 as a code owner May 20, 2026 07:46
Copy link
Copy Markdown
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 PR resolves a naming inconsistency in Azure.ResourceManager.Dns.Models.DnsRecordType by introducing correctly cased enum members (for acronyms longer than 2 letters) while keeping the legacy uppercase members available for backwards compatibility.

Changes:

  • Added new DnsRecordType members (Caa, Ptr, Soa, Srv, Txt) and assigned explicit numeric values to stabilize aliases.
  • Kept legacy members (CAA, PTR, SOA, SRV, TXT) and marked them as EditorBrowsable(Never) to discourage new usage without breaking existing code.
  • Updated public API baselines and documented the change in the changelog.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
sdk/dns/Azure.ResourceManager.Dns/src/Customization/Models/DnsRecordType.cs Adds new properly-cased enum members and hides legacy uppercase aliases via EditorBrowsable(Never).
sdk/dns/Azure.ResourceManager.Dns/CHANGELOG.md Documents the new enum members and the hidden legacy aliases.
sdk/dns/Azure.ResourceManager.Dns/api/Azure.ResourceManager.Dns.netstandard2.0.cs Updates public API baseline to include the new enum members.
sdk/dns/Azure.ResourceManager.Dns/api/Azure.ResourceManager.Dns.net8.0.cs Updates public API baseline to include the new enum members.
sdk/dns/Azure.ResourceManager.Dns/api/Azure.ResourceManager.Dns.net10.0.cs Updates public API baseline to include the new enum members.

@ArthurMa1978 ArthurMa1978 merged commit 500d090 into main May 20, 2026
28 checks passed
@ArthurMa1978 ArthurMa1978 deleted the copilot/fix-enum-backward-compatibility branch May 20, 2026 23:56
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.

Naming inconsistency in DnsRecordType

4 participants