Skip to content

feat: support libdns v1#2

Merged
kmpm merged 2 commits into
mainfrom
dev/version1
May 15, 2025
Merged

feat: support libdns v1#2
kmpm merged 2 commits into
mainfrom
dev/version1

Conversation

@kmpm

@kmpm kmpm commented May 15, 2025

Copy link
Copy Markdown
Collaborator
  • update libdns interface to v1
  • rework some logic
  • optional logging

@kmpm kmpm requested a review from Copilot May 15, 2025 07:12

Copilot AI 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.

Pull Request Overview

This PR updates the code to support libdns v1 while reworking some internal logic and adding optional logging.

  • Updated file operations to use io.ReadAll/os.ReadFile.
  • Refactored DNS record conversions and tests to align with the new libdns v1 types.
  • Added an optional logger method and updated the go.mod dependency and Makefile targets.

Reviewed Changes

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

Show a summary per file
File Description
server_test.go Replaced deprecated file reading functions with updated ones in tests.
provider_test.go Updated test cases to use new libdns record types; noted commented-out cases.
provider.go Refactored record handling and added tracing for better debugging.
models.go Updated DNS record conversion functions for libdns v1.
loopify.go / loopify_test.go Removed obsolete loopify functions and corresponding tests.
logger.go Added new logging method Infow for optional logging support.
go.mod Upgraded the libdns dependency to v1.0.0.
_examples/acme-like/main.go Adapted record creation for libdns v1.
_examples/acme-cleanup/main.go Updated sample usage reflecting the refactored provider behavior.
Makefile Added new tidy and audit targets for improved maintenance.
Comments suppressed due to low confidence (2)

provider_test.go:171

  • The valid deletion record test case is commented out, which may reduce test coverage for the DeleteRecords functionality. Consider reinstating or replacing this test case to ensure the behavior is adequately verified.
// {"valid records", tc.getProvider(), args{context.TODO(), "test.local", []libdns.Record{{Name: "test", ID: "12345"}}}, []libdns.Record{{Name: "test", ID: "12345"}}, false},

loopify_test.go:80

  • The tests for loopifyRecords and unLoopifyRecords were removed, which might lower the coverage of domain transformation logic if that functionality is still used elsewhere. If these functions are still relevant, consider adding new tests to ensure their behavior remains correct.
/* Removal of loopifyRecords and unLoopifyRecords tests */

@kmpm kmpm merged commit c8dfd9a into main May 15, 2025
1 check passed
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.

3 participants