-
-
Notifications
You must be signed in to change notification settings - Fork 66
[BREAKING CHNAGES] feat: use txt record instead of comments to mark managed record #191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: STRRL <im@strrl.dev>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #191 +/- ##
==========================================
+ Coverage 40.28% 42.91% +2.62%
==========================================
Files 10 10
Lines 772 804 +32
==========================================
+ Hits 311 345 +34
+ Misses 437 435 -2
Partials 24 24 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this 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 introduces a breaking change by replacing the use of DNS record comments with TXT records to mark managed records. Key changes include:
- Updating the tunnel-client to fetch and pass TXT records into the DNS sync process.
- Refactoring dns.go to remove comment-based management in favor of TXT records.
- Updating tests in dns_test.go to validate the new dual-record (CNAME/TXT) behavior.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pkg/cloudflare-controller/tunnel-client.go | Adds TXT record fetching and updates DNS record creation/update to support TXT records. |
| pkg/cloudflare-controller/dns_test.go | Modifies test inputs and expected outputs to account for separate CNAME and TXT record handling. |
| pkg/cloudflare-controller/dns.go | Refactors syncDNSRecord to incorporate TXT record logic and removes legacy comment-based management. |
Signed-off-by: STRRL <im@strrl.dev>
…s-instead-of-comments
|
Claude finished @STRRL's task —— View job Code Review CompleteI've analyzed the PR that replaces DNS record comments with TXT records for marking managed records. This is a well-designed breaking change that improves DNS record management safety. Review Checklist:
SummaryThis PR introduces a breaking change replacing comment-based DNS record management with TXT records. The implementation creates companion TXT records with the prefix ✅ StrengthsArchitecture & Design
Code Quality
🐛 Issues & RecommendationsCritical Issues
Moderate Issues
Minor Issues
🔒 Security Considerations
🚀 Performance Considerations
🧪 Test Coverage AssessmentExcellent test coverage with comprehensive scenarios:
Missing test cases (consider adding):
📋 Migration ConsiderationsSince this is marked as BREAKING CHANGES, consider:
🎯 Final VerdictThis is a well-implemented breaking change that significantly improves DNS record management safety. The use of TXT records follows DNS best practices and the implementation is thorough with good test coverage. Recommended Actions:
The code quality is high and the architectural decision is sound. After addressing the critical issues, this PR will be ready for production deployment. |
|
Claude finished @STRRL's task —— View job Claude finished @unknown's task —— View job Code Review CompleteI've analyzed the PR that replaces DNS record comments with TXT records for marking managed records. This is a well-designed breaking change that improves DNS record management safety. Review Checklist:
SummaryThis PR introduces a breaking change replacing comment-based DNS record management with TXT records. The implementation creates companion TXT records with the prefix ✅ StrengthsArchitecture & Design
Code Quality
🐛 Issues & RecommendationsCritical Issues
Moderate Issues
Minor Issues
🔒 Security Considerations
🚀 Performance Considerations
🧪 Test Coverage AssessmentExcellent test coverage with comprehensive scenarios:
Missing test cases (consider adding):
📋 Migration ConsiderationsSince this is marked as BREAKING CHANGES, consider:
🎯 Final VerdictThis is a well-implemented breaking change that significantly improves DNS record management safety. The use of TXT records follows DNS best practices and the implementation is thorough with good test coverage. Recommended Actions:
The code quality is high and the architectural decision is sound. After addressing the critical issues, this PR will be ready for production deployment. |
|
Claude finished @STRRL's task —— View job Code Review CompleteI've analyzed the PR that replaces DNS record comments with TXT records for marking managed records. This is a well-designed breaking change that improves DNS record management safety. Review Checklist:
SummaryThis PR introduces a breaking change replacing comment-based DNS record management with TXT records. The implementation creates companion TXT records with the prefix ✅ StrengthsArchitecture & Design
Code Quality
🐛 Issues & RecommendationsCritical Issues
Moderate Issues
Minor Issues
🔒 Security Considerations
🚀 Performance Considerations
🧪 Test Coverage AssessmentExcellent test coverage with comprehensive scenarios:
Missing test cases (consider adding):
📋 Migration ConsiderationsSince this is marked as BREAKING CHANGES, consider:
🎯 Final VerdictThis is a well-implemented breaking change that significantly improves DNS record management safety. The use of TXT records follows DNS best practices and the implementation is thorough with good test coverage. Recommended Actions:
The code quality is high and the architectural decision is sound. After addressing the critical issues, this PR will be ready for production deployment. |
There was a problem hiding this 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 refactors DNS record management by replacing comment-based marking with TXT records and adds an end-to-end test suite.
- Adds listing, syncing, and deletion of TXT records alongside CNAME records in
syncDNSRecordandTunnelClient. - Removes all uses of DNS record comments and updates corresponding tests.
- Introduces E2E test harness with setup/cleanup scripts, Makefile targets, and documentation updates.
Reviewed Changes
Copilot reviewed 11 out of 17 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pkg/cloudflare-controller/dns.go | Updated syncDNSRecord to manage TXT records and removed comment logic |
| pkg/cloudflare-controller/dns_test.go | Expanded tests for TXT record create/update/delete cases |
| pkg/cloudflare-controller/tunnel-client.go | Dropped comment field in Create/Update DNS calls; added TXT listing |
| test/e2e/suite_test.go | New E2E test suite harness |
| test/e2e/setup.sh, test/e2e/cleanup.sh | Scripts to set up and tear down the E2E environment |
| test/e2e/.env.example | Example environment variables for E2E tests |
| image/cloudflare-tunnel-ingress-controller/Dockerfile | Bumped Go base image from 1.23 to 1.24 |
| go.mod | Added github.com/joho/godotenv for E2E config loading |
| Makefile | Added e2e-* targets |
| CLAUDE.md | Documented new E2E commands |
Comments suppressed due to low confidence (3)
pkg/cloudflare-controller/dns_test.go:341
- [nitpick] There is no test case covering the scenario where a TXT record exists without a matching CNAME. Adding a test for orphan TXT cleanup (or non-cleanup, depending on intended behavior) would improve coverage.
gotCreate, gotUpdate, gotDelete, err := syncDNSRecord(tt.args.logger, tt.args.exposures, tt.args.existedCNAMERecords, tt.args.existedTXTRecords, tt.args.tunnelId, tt.args.tunnelName)
pkg/cloudflare-controller/dns.go:3
- The
syncDNSRecordfunction usesfmt.Sprintfandstrings.ToLowerbut neitherfmtnorstringsare imported, which will cause a compilation error. Please addimport "fmt"andimport "strings".
import (
pkg/cloudflare-controller/dns.go:137
- [nitpick] Indentation is inconsistent in the nested
if targetTXTRecord != nilblock. Align the twotoDeleteappends to the same level for readability.
toDelete = append(toDelete, DNSOperationDelete{
| contains, _ := exposureContainsHostname(effectiveExposures, item.Name) | ||
| if !contains { | ||
| if item.Comment == renderDNSRecordComment(tunnelName) { | ||
| // delete CNAME/TXT record for exposures should offline |
Copilot
AI
Jun 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Currently, orphaned TXT records (with no corresponding CNAME) are not cleaned up. Consider adding logic to delete TXT records whose CNAME record no longer exists to avoid stale management markers.
close #168