-
Notifications
You must be signed in to change notification settings - Fork 363
Fix DNSExit provider when provided with a zone and a non-identical hostname #674
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
Fix DNSExit provider when provided with a zone and a non-identical hostname #674
Conversation
633df13
to
5b63b88
Compare
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.
Thanks for the contribution!
b08acdb
to
ab56cde
Compare
aae2dab
to
4fb98cd
Compare
Amazing work @rhansen 🤩 , it's looking great! |
c16af73
to
8dd811f
Compare
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.
@jortkoopmans Thanks for reviewing. I squashed all of the commits together then split into four:
- Add tests (marked as expected to fail)
- Fix bug (and mark tests as expected to pass)
- Don't skip remaining hosts on HTTP error. This commit exists mostly to simplify the next commit: a
next
can be simply converted into areturn
whereaslast
needs additional logic in the calling function. - Move the body of the
for
loop to a separate function
I split this PR into multiple commits for the following reasons:
- It makes it easier for downstreams to cherry-pick a minimal diff to fix the issue.
- It makes it easier for future developers to see what changed.
git bisect
andgit revert
will be more useful if this PR breaks something.
Please review the commits one last time (especially the commit messages), make any changes you deem appropriate (force push is OK), and let me know if everything looks OK.
LGTM @rhansen . I have reviewed the commits, commit messages and re-tested the final solution just to be sure; all is good. |
Needs LWP::UserAgent.
Trim the zone from the hostname in the request to fix issue.
A non-2xx status code might be host-specific, so ddclient should continue with the next host. We could skip the remaining hosts if there is a connection failure, but it doesn't hurt to retry.
For improved readability.
8dd811f
to
73a67b7
Compare
This PR proposes a fix for issue #673. The fix involves trimming the zone from the hostname in the request. In addition to the bug fix, this PR includes refactoring for readability and the addition of a testing harness.
Testing
The actual bugfix is fairly limited, however, I ended up refactoring quite a lot to be able to write some tests. The current architecture of the application made it challenging to test the provider implementation due to:
Despite these challenges, I've included some tests in this PR. I understand that this may trigger a discussion about how to improve the structure of the software, which I hope will be to the benefit of this program altogether.
fixes #673