Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Domainnameshop provider #1625

Merged
merged 20 commits into from
Aug 1, 2022
Merged

Conversation

SimenBai
Copy link
Contributor

Closes #1611

Most tests pass, except for the GeneralACD tests that change the TTLs as DomainNameShop only supports TTLs that are a multiple of 60 (i.e. TTL % 60 == 0). I am not quite sure what the best solution for handeling those instances. I am open for suggestions.

Other than that there are a few features that can be added later. But I can create issues for them once this PR has been resolved.

@tlimoncelli
Copy link
Contributor

Hi there! Thanks for writing this up!

The Linode provider has a similar situation with TTLs. You might take a look at how they handle that situation.

Tom

@SimenBai
Copy link
Contributor Author

Thank you for the tip on the TTL issue. Weirdly now 10:gentxt_TXT:Create_TXT_10 fails.

Not quite sure what the issue is.

--- FAIL: TestDNSProviders (1322.04s)
    --- FAIL: TestDNSProviders/simenbai.tech (1322.04s)
        --- PASS: TestDNSProviders/simenbai.tech/Clean_Slate:Empty (3.40s)
        --- PASS: TestDNSProviders/simenbai.tech/00:GeneralACD:Create_an_A_record (10.65s)
        --- PASS: TestDNSProviders/simenbai.tech/00:GeneralACD:Change_it (8.78s)
        --- PASS: TestDNSProviders/simenbai.tech/00:GeneralACD:Add_another (9.77s)
        --- PASS: TestDNSProviders/simenbai.tech/00:GeneralACD:Add_another(same_name) (10.14s)
        --- PASS: TestDNSProviders/simenbai.tech/00:GeneralACD:Change_a_ttl (8.69s)
        --- PASS: TestDNSProviders/simenbai.tech/00:GeneralACD:Change_single_target_from_set (9.20s)
        --- PASS: TestDNSProviders/simenbai.tech/00:GeneralACD:Change_all_ttls (13.02s)
        --- PASS: TestDNSProviders/simenbai.tech/00:GeneralACD:Delete_one (8.60s)
        --- PASS: TestDNSProviders/simenbai.tech/00:GeneralACD:Add_back_and_change_ttl (13.72s)
        --- PASS: TestDNSProviders/simenbai.tech/00:GeneralACD:Change_targets_and_ttls (11.04s)
        --- PASS: TestDNSProviders/simenbai.tech/Post_cleanup:Empty (5.08s)
        --- PASS: TestDNSProviders/simenbai.tech/01:WildcardACD:Create_wildcard (12.60s)
        --- PASS: TestDNSProviders/simenbai.tech/01:WildcardACD:Delete_wildcard (8.17s)
        --- PASS: TestDNSProviders/simenbai.tech/Post_cleanup:Empty#01 (4.54s)
        --- PASS: TestDNSProviders/simenbai.tech/02:CNAME:Create_a_CNAME (10.06s)
        --- PASS: TestDNSProviders/simenbai.tech/02:CNAME:Change_CNAME_target (9.12s)
        --- PASS: TestDNSProviders/simenbai.tech/02:CNAME:Empty (4.72s)
        --- PASS: TestDNSProviders/simenbai.tech/02:CNAME:Record_pointing_to_@ (10.20s)
        --- PASS: TestDNSProviders/simenbai.tech/Post_cleanup:Empty#02 (4.38s)
        --- PASS: TestDNSProviders/simenbai.tech/03:MX:MX_record (10.01s)
        --- PASS: TestDNSProviders/simenbai.tech/03:MX:Second_MX_record,_same_prio (9.81s)
        --- PASS: TestDNSProviders/simenbai.tech/03:MX:3_MX (10.41s)
        --- PASS: TestDNSProviders/simenbai.tech/03:MX:Delete_one (7.82s)
        --- PASS: TestDNSProviders/simenbai.tech/03:MX:Change_to_other_name (11.06s)
        --- PASS: TestDNSProviders/simenbai.tech/03:MX:Change_Preference (9.01s)
        --- PASS: TestDNSProviders/simenbai.tech/03:MX:Record_pointing_to_@ (12.06s)
        --- PASS: TestDNSProviders/simenbai.tech/Post_cleanup:Empty#03 (4.61s)
        --- PASS: TestDNSProviders/simenbai.tech/04:Null_MX:Null_MX (10.33s)
        --- PASS: TestDNSProviders/simenbai.tech/Post_cleanup:Empty#04 (4.67s)
        --- PASS: TestDNSProviders/simenbai.tech/05:NS:NS_for_subdomain (9.73s)
        --- PASS: TestDNSProviders/simenbai.tech/05:NS:Dual_NS_for_subdomain (9.78s)
        --- PASS: TestDNSProviders/simenbai.tech/05:NS:NS_Record_pointing_to_@ (16.18s)
        --- PASS: TestDNSProviders/simenbai.tech/Post_cleanup:Empty#05 (5.17s)
        --- PASS: TestDNSProviders/simenbai.tech/06:simple_TXT:Create_a_TXT (11.18s)
        --- PASS: TestDNSProviders/simenbai.tech/06:simple_TXT:Change_a_TXT (9.32s)
        --- PASS: TestDNSProviders/simenbai.tech/06:simple_TXT:Create_a_TXT_with_spaces (9.49s)
        --- PASS: TestDNSProviders/simenbai.tech/Post_cleanup:Empty#06 (4.41s)
        --- PASS: TestDNSProviders/simenbai.tech/07:simple_TXT-spf1:Create_a_TXT/SPF (9.20s)
        --- PASS: TestDNSProviders/simenbai.tech/Post_cleanup:Empty#07 (4.83s)
        --- PASS: TestDNSProviders/simenbai.tech/08:long_TXT:Create_long_TXT (10.31s)
        --- PASS: TestDNSProviders/simenbai.tech/08:long_TXT:Change_long_TXT (9.44s)
        --- PASS: TestDNSProviders/simenbai.tech/08:long_TXT:Create_long_TXT_with_spaces (9.39s)
        --- PASS: TestDNSProviders/simenbai.tech/Post_cleanup:Empty#08 (4.51s)
        --- PASS: TestDNSProviders/simenbai.tech/09:complex_TXT:TXT_with_0-octel_string (9.93s)
        --- PASS: TestDNSProviders/simenbai.tech/09:complex_TXT:Empty (4.02s)
        --- PASS: TestDNSProviders/simenbai.tech/09:complex_TXT:Create_a_254-byte_TXT (10.42s)
        --- PASS: TestDNSProviders/simenbai.tech/09:complex_TXT:Empty#01 (4.03s)
        --- PASS: TestDNSProviders/simenbai.tech/09:complex_TXT:Create_a_255-byte_TXT (10.09s)
        --- PASS: TestDNSProviders/simenbai.tech/09:complex_TXT:Empty#02 (4.30s)
        --- PASS: TestDNSProviders/simenbai.tech/09:complex_TXT:Create_a_256-byte_TXT (10.66s)
        --- PASS: TestDNSProviders/simenbai.tech/09:complex_TXT:Empty#03 (4.71s)
        --- PASS: TestDNSProviders/simenbai.tech/09:complex_TXT:Create_TXT_with_single-quote (10.27s)
        --- PASS: TestDNSProviders/simenbai.tech/09:complex_TXT:Empty#04 (4.63s)
        --- PASS: TestDNSProviders/simenbai.tech/09:complex_TXT:Create_TXT_with_backtick (11.11s)
        --- PASS: TestDNSProviders/simenbai.tech/09:complex_TXT:Empty#05 (4.27s)
        --- PASS: TestDNSProviders/simenbai.tech/09:complex_TXT:Create_TXT_with_double-quote (9.87s)
        --- PASS: TestDNSProviders/simenbai.tech/09:complex_TXT:Empty#06 (4.04s)
        --- PASS: TestDNSProviders/simenbai.tech/09:complex_TXT:Create_TXT_with_ws_at_end (10.02s)
        --- PASS: TestDNSProviders/simenbai.tech/Post_cleanup:Empty#09 (4.39s)
        --- PASS: TestDNSProviders/simenbai.tech/10:gentxt_TXT:Create_TXT_0 (11.34s)
        --- PASS: TestDNSProviders/simenbai.tech/10:gentxt_TXT:Create_TXT_1 (11.73s)
        --- FAIL: TestDNSProviders/simenbai.tech/10:gentxt_TXT:Create_TXT_10 (13.00s)
        --- PASS: TestDNSProviders/simenbai.tech/Post_cleanup:Empty#10 (4.07s)
        --- PASS: TestDNSProviders/simenbai.tech/11:long_TXT:Create_a_505_TXT (10.45s)
        --- PASS: TestDNSProviders/simenbai.tech/Post_cleanup:Empty#11 (4.30s)
        --- PASS: TestDNSProviders/simenbai.tech/12:TXTMulti:Create_TXTMulti_1 (10.63s)
        --- PASS: TestDNSProviders/simenbai.tech/Post_cleanup:Empty#12 (3.99s)
        --- PASS: TestDNSProviders/simenbai.tech/13:TXTMulti-same:Create_TXTMulti_1 (10.36s)
        --- PASS: TestDNSProviders/simenbai.tech/Post_cleanup:Empty#13 (4.44s)
        --- PASS: TestDNSProviders/simenbai.tech/14:TypeChange:Create_a_CNAME (10.52s)
        --- PASS: TestDNSProviders/simenbai.tech/Post_cleanup:Empty#14 (4.70s)
        --- PASS: TestDNSProviders/simenbai.tech/15:Case_Sensitivity:Create_CAPS (10.25s)
        --- PASS: TestDNSProviders/simenbai.tech/Post_cleanup:Empty#15 (4.26s)
        --- PASS: TestDNSProviders/simenbai.tech/16:IDNA:Internationalized_name (10.49s)
        --- PASS: TestDNSProviders/simenbai.tech/Post_cleanup:Empty#16 (4.76s)
        --- PASS: TestDNSProviders/simenbai.tech/17:IDNAs_in_CNAME_targets:IDN_CNAME_AND_Target (10.37s)
        --- PASS: TestDNSProviders/simenbai.tech/Post_cleanup:Empty#17 (4.71s)
        --- PASS: TestDNSProviders/simenbai.tech/18:pager101:99_records (347.62s)
        --- PASS: TestDNSProviders/simenbai.tech/Post_cleanup:Empty#18 (101.75s)
        --- PASS: TestDNSProviders/simenbai.tech/19:pager601_***SKIPPED(disabled_by_only)***:Empty (3.60s)
        --- PASS: TestDNSProviders/simenbai.tech/20:pager1201_***SKIPPED(disabled_by_only)***:Empty (3.81s)
        --- PASS: TestDNSProviders/simenbai.tech/21:CAA:CAA_record (10.28s)
        --- PASS: TestDNSProviders/simenbai.tech/Post_cleanup:Empty#19 (4.00s)
        --- PASS: TestDNSProviders/simenbai.tech/22:CAA_noflag:CAA_flag0 (10.22s)
        --- PASS: TestDNSProviders/simenbai.tech/Post_cleanup:Empty#20 (4.96s)
        --- PASS: TestDNSProviders/simenbai.tech/23:CAA_with_;:CAA_many_records (10.77s)
        --- PASS: TestDNSProviders/simenbai.tech/Post_cleanup:Empty#21 (4.40s)
        --- PASS: TestDNSProviders/simenbai.tech/24:CAA_Issue_1374:CAA_spaces (9.82s)
        --- PASS: TestDNSProviders/simenbai.tech/Post_cleanup:Empty#22 (4.40s)
        --- PASS: TestDNSProviders/simenbai.tech/25:NAPTR_***SKIPPED(CanUseNAPTR_not_supported)***:Empty (4.08s)
        --- PASS: TestDNSProviders/simenbai.tech/26:PTR_***SKIPPED(CanUsePTR_not_supported)***:Empty (3.70s)
        --- PASS: TestDNSProviders/simenbai.tech/27:SOA:Empty (3.15s)
        --- PASS: TestDNSProviders/simenbai.tech/Post_cleanup:Empty#23 (3.06s)
        --- PASS: TestDNSProviders/simenbai.tech/28:SRV:SRV_record (9.84s)
        --- PASS: TestDNSProviders/simenbai.tech/Post_cleanup:Empty#24 (4.41s)
        --- PASS: TestDNSProviders/simenbai.tech/29:SRV_w/_null_target:Null_Target (13.44s)
        --- PASS: TestDNSProviders/simenbai.tech/Post_cleanup:Empty#25 (5.30s)
        --- PASS: TestDNSProviders/simenbai.tech/30:SSHFP_***SKIPPED(CanUseSSHFP_not_supported)***:Empty (3.40s)
        --- PASS: TestDNSProviders/simenbai.tech/31:TLSA_***SKIPPED(CanUseTLSA_not_supported)***:Empty (3.28s)
        --- PASS: TestDNSProviders/simenbai.tech/32:DS_***SKIPPED(CanUseDS_not_supported)***:Empty (3.30s)
        --- PASS: TestDNSProviders/simenbai.tech/33:DS_(children_only)_***SKIPPED(CanUseDSForChildren_not_supported)***:Empty (4.04s)
        --- PASS: TestDNSProviders/simenbai.tech/34:DS_(children_only)_CLOUDNS_***SKIPPED(CanUseDSForChildren_not_supported)***:Empty (3.77s)
        --- PASS: TestDNSProviders/simenbai.tech/35:ALIAS_***SKIPPED(CanUseAlias_not_supported)***:Empty (3.44s)
        --- PASS: TestDNSProviders/simenbai.tech/36:AZURE_ALIAS_***SKIPPED(CanUseAzureAlias_not_supported)***:Empty (3.58s)
        --- PASS: TestDNSProviders/simenbai.tech/37:R53_ALIAS2_***SKIPPED(CanUseRoute53Alias_not_supported)***:Empty (3.14s)
        --- PASS: TestDNSProviders/simenbai.tech/38:R53_ALIAS_ORDER_***SKIPPED(CanUseRoute53Alias_not_supported)***:Empty (3.47s)
        --- PASS: TestDNSProviders/simenbai.tech/39:CF_REDIRECT_***SKIPPED(disabled_by_only)***:Empty (3.52s)
        --- PASS: TestDNSProviders/simenbai.tech/40:CF_PROXY_***SKIPPED(disabled_by_only)***:Empty (3.76s)
        --- PASS: TestDNSProviders/simenbai.tech/41:CF_WORKER_ROUTE_***SKIPPED(disabled_by_only)***:Empty (3.33s)
        --- PASS: TestDNSProviders/simenbai.tech/42:IGNORE_NAME_function:Create_some_records (12.98s)
        --- PASS: TestDNSProviders/simenbai.tech/Post_cleanup:Empty#26 (6.05s)
        --- PASS: TestDNSProviders/simenbai.tech/43:IGNORE_NAME_apex:Create_some_records (20.48s)
        --- PASS: TestDNSProviders/simenbai.tech/Post_cleanup:Empty#27 (7.35s)
        --- PASS: TestDNSProviders/simenbai.tech/44:IGNORE_TARGET_function:Create_some_records (13.74s)
        --- PASS: TestDNSProviders/simenbai.tech/Post_cleanup:Empty#28 (5.13s)


integration_test.go:241: UNEXPECTED #0: MODIFY TXT foo2ls.simenbai.tech: ("ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZshort" ttl=300) -> ("ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ" "short" ttl=300)

Copy link
Contributor

@tlimoncelli tlimoncelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good so far!

@tlimoncelli
Copy link
Contributor

Before we merge this I'd like to request that you reorganize the filenames (and move functions if needed). providers/cscglobal is the best example of how things should be done in the future. I'm in the process of updating the docs to reflect this. See #1636 for what I've written so far.

I know this is a big change, but doing it now is better than rewriting it all later. I'd really appreciate it!

Thanks!
Tom

@SimenBai
Copy link
Contributor Author

I will look into that, do you have any suggestions for how to fix the issue I mentioned with 10:gentxt_TXT:Create_TXT_10? Not quite sure how to fix it, I might be mistaken, but isn't those two the same thing? If so, how can I go about fixing the records given from dc?

integration_test.go:241: UNEXPECTED #0: MODIFY TXT foo2ls.simenbai.tech: ("ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZshort" ttl=300) -> ("ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ" "short" ttl=300)

@tlimoncelli
Copy link
Contributor

About gentxt_TXT:Create_TXT_10 : They are the same thing but the pkg/diff isn't smart enough to know that. If you call txtutil.SplitSingleLongTxt(), I believe that will take care of the problem.

See how other providers use is:

grep SplitSingleLong providers/*/*.go

HTH

@SimenBai
Copy link
Contributor Author

txtutil.SplitSingleLongTxt() takes care of the problem with gentxt_TXT:Create_TXT_10 but it does not not fix problem with 10:gentxt_TXT:Create_TXT_100. I.e. lss test. as the two short gets added together

@tlimoncelli
Copy link
Contributor

Suggestion: Skip that test. Nobody depends on that behavior and I'm considering eliminating that test.

@SimenBai
Copy link
Contributor Author

SimenBai commented Jul 27, 2022

Would another option potentially be to have a loop over dc.Records that merges the TXTStrings?

i.e

	for _, rc := range dc.Records {
		if rc.HasFormatIdenticalToTXT() {
			rc.SetTargetTXT(strings.Join(rc.TxtStrings, ""))
		}
	}

@tlimoncelli
Copy link
Contributor

I think that might work. Give it a try!

@SimenBai
Copy link
Contributor Author

That made it pass the tests!
All tests seem to pass now. Doing final round of testing before rewriting like requested.

@SimenBai SimenBai marked this pull request as draft July 27, 2022 22:56
@SimenBai SimenBai marked this pull request as ready for review July 29, 2022 13:19
@SimenBai
Copy link
Contributor Author

All checks passed and I think it is restructured like you intended.

@SimenBai SimenBai requested a review from tlimoncelli July 29, 2022 13:20
Copy link
Contributor

@tlimoncelli tlimoncelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Ready to merge?

@SimenBai
Copy link
Contributor Author

SimenBai commented Aug 1, 2022

Yup, should be ready to go

@tlimoncelli tlimoncelli merged commit e9510da into StackExchange:master Aug 1, 2022
@tlimoncelli
Copy link
Contributor

Thanks for contributing the new provider! I'm excited to see this new addition!

I'd like to have your email address in case Github has a problem. Can you send it to tlimoncelli at stack over flow dot com ? Thanks!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DNS Provider Request: DomainNameShop / DomeneShop
2 participants