Skip to content

fix(dns): Call Resolver.query, which dnspython 1.x has (backport #7898) - #7899

Merged
balamurali27 merged 1 commit into
masterfrom
mergify/bp/master/pr-7898
Oct 28, 2026
Merged

balamurali27 merged 1 commit into
masterfrom
mergify/bp/master/pr-7898

Conversation

@mergify

@mergify mergify Bot commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

b8c335a (#7876) changed every DNS lookup to Resolver.resolve. That method exists only in dnspython 2, and production still runs 1.x. The broad except in check_dns_cname and check_dns_a hides the AttributeError, so every custom domain check fails. TLS renewals of custom domains fail too.

This changes the calls back to query. It works on 1.x and 2.x (on 2.x it only gives a deprecation warning). The new test patches the real Resolver class, because a mock has every attribute and would hide a missing method. I reverted one call to resolve and the test failed.

Tested locally on dnspython 1.16.0, with real DNS lookups in bench console:

Check Result
Resolver.resolve (before) AttributeError: 'Resolver' object has no attribute 'resolve'
check_dns_cname("github.com", "www.github.com") Matched: www.github.com. IN CNAME github.com.
check_dns_a("github.com", "github.com") Matched: github.com. IN A 20.207.73.82
check_dns_a("frappe.io", "frappe.io") "Multiple A records" error, which is correct (two Cloudflare IPs). The SOA lookup for the DNS provider hint also worked.
get_mx_ip("gmail.com") Returned the 5 Gmail MX hosts

press.utils.test_dns passes (4 tests). Not run: selfhosted.py, the audit script, and the CAA and AAAA checks. They have the same one-word change.

Custom domains whose TLS renewal failed after the deploy need a retry after this merges.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VhJqVgj53KVnJy9MFACx9m


This is an automatic backport of pull request #7898 done by [Mergify](https://mergify.com).

b8c335a (#7876) moved every DNS lookup to Resolver.resolve, which
only exists in dnspython 2. Production still runs 1.x. The broad except
in check_dns_cname and check_dns_a hides the AttributeError, so every
custom domain check fails, and TLS renewals of custom domains do too.

Query works on both versions. On 2.x it only gives a deprecation warning.
The test patches the real Resolver class, because a mock has every
attribute and would hide a missing method.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VhJqVgj53KVnJy9MFACx9m
(cherry picked from commit 2cb2bed)
@balamurali27
balamurali27 merged commit 2ca1aec into master Oct 28, 2026
5 of 7 checks passed
@balamurali27
balamurali27 deleted the mergify/bp/master/pr-7898 branch October 28, 2026 07:08
@frappe-pr-bot

Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 0.169.12 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@codecov-commenter

codecov-commenter commented Oct 28, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 63.15789% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.15%. Comparing base (db4fbc1) to head (cb7651d).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
press/utils/dns.py 16.66% 5 Missing ⚠️
press/api/selfhosted.py 0.00% 1 Missing ⚠️
press/utils/email_validator.py 0.00% 1 Missing ⚠️

❌ Your patch status has failed because the patch coverage (63.15%) is below the target coverage (75.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7899      +/-   ##
==========================================
+ Coverage   65.14%   65.15%   +0.01%     
==========================================
  Files        1114     1114              
  Lines      110339   110348       +9     
  Branches     2094     2094              
==========================================
+ Hits        71876    71897      +21     
+ Misses      38407    38395      -12     
  Partials       56       56              
Flag Coverage Δ
dashboard 86.75% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants