Skip to content

huaweicloud: Modernize record conversion - #4556

Merged
TomOnTime merged 10 commits into
release_candidate_v5from
mod_huaweicloud
Jul 27, 2026
Merged

huaweicloud: Modernize record conversion#4556
TomOnTime merged 10 commits into
release_candidate_v5from
mod_huaweicloud

Conversation

@TomOnTime

Copy link
Copy Markdown
Collaborator

Dear @huihuimoe. I could use your help. I'm doing upgrades to the code base and I have no way to test your provider. Please run the integration test and let me know the result. How to run integration tests is here: https://docs.dnscontrol.org/developer-info/integration-tests

Summary

  • replace legacy record construction with current domain-aware factories
  • replace the combined legacy getter with typed RDATA output
  • preserve raw TXT and provider metadata handling
  • add focused RRset conversion tests

Validation

  • ../../bin/is_modern.sh (Steps 1-7 clean)
  • go test ./providers/huaweicloud
  • bin/generate-all.sh
  • go test ./...

@TomOnTime
TomOnTime marked this pull request as ready for review July 24, 2026 03:26
@huihuimoe

huihuimoe commented Jul 24, 2026

Copy link
Copy Markdown
Member

The integration test failed.
It looks like there's a difference in how double quotes in TXT records are handled before and after the change.

log:

=== RUN   TestDNSProviders/dnscontroltest-hwc.org/09:TXT:Create_TXT
    helpers_integration_test.go:250:
        + CREATE testtxt.dnscontroltest-hwc.org TXT "simple" weight=1 line=default_view key= ttl=300
    helpers_integration_test.go:272: Expected 0 corrections on second run, but found 1.
    helpers_integration_test.go:274: UNEXPECTED #0: ± MODIFY testtxt.dnscontroltest-hwc.org TXT ("\"simple\"" ttl=300) -> ("simple" ttl=300)

P.S: I haven’t had time to investigate the exact difference yet, but I’ll take a closer look later.

@TomOnTime

Copy link
Copy Markdown
Collaborator Author

Take a look at convert.go. I think it should use NewRecordConfigParse() for TXT records too.

                if recType == "TXT" {
                        rc, err = dc.NewRecordConfig(label, ttl, recType, value)
                } else {
                        rc, err = dc.NewRecordConfigParse(label, ttl, recType, value)
                }

I've pushed a change to use NewRecordConfigParse() in both situations. PTAL

Thanks!

@huihuimoe

Copy link
Copy Markdown
Member
Testing Profile="HUAWEICLOUD" (TYPE="HUAWEICLOUD")
    provider_test.go:153: Skipping. Deduplication logic is not implemented for this provider.
--- SKIP: TestDuplicateNameservers (1.13s)
PASS
ok      github.com/DNSControl/dnscontrol/v5/integrationTest     601.171s

LGTM, now PASS integrationTest

@TomOnTime

Copy link
Copy Markdown
Collaborator Author

Thanks!

@TomOnTime
TomOnTime merged commit 33d8f21 into release_candidate_v5 Jul 27, 2026
24 checks passed
@TomOnTime
TomOnTime deleted the mod_huaweicloud branch July 27, 2026 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants