From 553713d240715310542fc2b3747fe384b1e7b9e2 Mon Sep 17 00:00:00 2001 From: Tom Limoncelli Date: Wed, 18 Dec 2024 15:58:39 -0500 Subject: [PATCH 01/12] DOC: NEW: How to test a branch --- documentation/SUMMARY.md | 1 + documentation/test-a-branch.md | 65 ++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 documentation/test-a-branch.md diff --git a/documentation/SUMMARY.md b/documentation/SUMMARY.md index 55c8babf4f..a65e5b34eb 100644 --- a/documentation/SUMMARY.md +++ b/documentation/SUMMARY.md @@ -186,6 +186,7 @@ * [Writing new DNS providers](writing-providers.md) * [Creating new DNS Resource Types (rtypes)](adding-new-rtypes.md) * [Integration Tests](integration-tests.md) +* [Test a branch](test-a-branch.md) * [Unit Testing DNS Data](unittests.md) * [Bug Triage Process](bug-triage.md) * [Bring-Your-Own-Secrets for automated testing](byo-secrets.md) diff --git a/documentation/test-a-branch.md b/documentation/test-a-branch.md new file mode 100644 index 0000000000..b14c8d8489 --- /dev/null +++ b/documentation/test-a-branch.md @@ -0,0 +1,65 @@ +### Test A Branch + +Instructions for testing DNSControl at a particular PR or branch. + +## Using Docker + +Using Docker assures you're using the latest version of Go and doesn't require you to install anything on your machine, other than Docker! + +Assumptions: +* `/THE/PATH` -- Change this to the full path to where your dnsconfig.js and other files are located. +* `INSERT_BRANCH_HERE` -- The branch you want to test. The branch associated with a PR is listed on [https://github.com/StackExchange/dnscontrol/branches](https://github.com/StackExchange/dnscontrol/branches). + +``` +docker run -it -v /THE/PATH:/dns golang +git clone https://github.com/StackExchange/dnscontrol.git +cd dnscontrol +git checkout INSERT_BRANCH_HERE +go install + +cd /dns +dnscontrol preview +``` + +If you want to run the integration tests, follow the +[Integration Tests](https://docs.dnscontrol.org/developer-info/integration-tests) document +as usual. The directory to be in is `/go/dnscontrol/integrationTest`. + +``` +cd /go/dnscontrol/integrationTest +go test -v -verbose -provider INSERT_PROVIDER_NAME -start 1 -end 3 +``` + +Change `INSERT_PROVIDER_NAME` to the name of your provider (BIND, ROUTE53, GCLOUD, etc.) + + +## Not using Docker + +Assumptions: +* `/THE/PATH` -- Change this to the full path to where your dnsconfig.js and other files are located. +* `INSERT_BRANCH_HERE` -- The branch you want to test. The branch associated with a PR is listed on [https://github.com/StackExchange/dnscontrol/branches](https://github.com/StackExchange/dnscontrol/branches). + +Step 1: Install Go + +[https://go.dev/dl/](https://go.dev/dl/) + +Step 2: Check out the software + +``` +git clone https://github.com/StackExchange/dnscontrol.git +cd dnscontrol +git checkout INSERT_BRANCH_HERE +go install + +cd /THE/PATH +dnscontrol preview +``` + +Step 3: Clean up + +`go install` put the `dnscontrol` program in your `$HOME/bin` directory. You probably want to remove it. + +``` +$ rm -i $HOME/bin/dnscontrol +``` + From 2a91497c823feaab748004926f4761a3b26f1781 Mon Sep 17 00:00:00 2001 From: Tom Limoncelli Date: Wed, 18 Dec 2024 16:02:47 -0500 Subject: [PATCH 02/12] more --- documentation/test-a-branch.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/documentation/test-a-branch.md b/documentation/test-a-branch.md index b14c8d8489..774481cddd 100644 --- a/documentation/test-a-branch.md +++ b/documentation/test-a-branch.md @@ -63,3 +63,7 @@ Step 3: Clean up $ rm -i $HOME/bin/dnscontrol ``` +## Other useful docs + +* How to run the integrations tests: + * [https://docs.dnscontrol.org/developer-info/integration-tests](https://docs.dnscontrol.org/developer-info/integration-tests) From 84f8e48460b406379decf851c0a1f539d1982557 Mon Sep 17 00:00:00 2001 From: Tom Limoncelli Date: Wed, 18 Dec 2024 16:04:40 -0500 Subject: [PATCH 03/12] empty From b66cca2c192c5aade2f31a37c17e617e466726d4 Mon Sep 17 00:00:00 2001 From: Jeffrey Cafferata Date: Thu, 19 Dec 2024 16:25:59 +0100 Subject: [PATCH 04/12] DOCS: Code syntax highlighting. --- documentation/test-a-branch.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/documentation/test-a-branch.md b/documentation/test-a-branch.md index 774481cddd..8185e8ac18 100644 --- a/documentation/test-a-branch.md +++ b/documentation/test-a-branch.md @@ -10,13 +10,15 @@ Assumptions: * `/THE/PATH` -- Change this to the full path to where your dnsconfig.js and other files are located. * `INSERT_BRANCH_HERE` -- The branch you want to test. The branch associated with a PR is listed on [https://github.com/StackExchange/dnscontrol/branches](https://github.com/StackExchange/dnscontrol/branches). -``` +```shell docker run -it -v /THE/PATH:/dns golang git clone https://github.com/StackExchange/dnscontrol.git cd dnscontrol git checkout INSERT_BRANCH_HERE go install +``` +```shell cd /dns dnscontrol preview ``` @@ -25,12 +27,12 @@ If you want to run the integration tests, follow the [Integration Tests](https://docs.dnscontrol.org/developer-info/integration-tests) document as usual. The directory to be in is `/go/dnscontrol/integrationTest`. -``` +```shell cd /go/dnscontrol/integrationTest go test -v -verbose -provider INSERT_PROVIDER_NAME -start 1 -end 3 ``` -Change `INSERT_PROVIDER_NAME` to the name of your provider (BIND, ROUTE53, GCLOUD, etc.) +Change `INSERT_PROVIDER_NAME` to the name of your provider (`BIND`, `ROUTE53`, `GCLOUD`, etc.) ## Not using Docker @@ -45,12 +47,14 @@ Step 1: Install Go Step 2: Check out the software -``` +```shell git clone https://github.com/StackExchange/dnscontrol.git cd dnscontrol git checkout INSERT_BRANCH_HERE go install +``` +```shell cd /THE/PATH dnscontrol preview ``` @@ -59,8 +63,8 @@ Step 3: Clean up `go install` put the `dnscontrol` program in your `$HOME/bin` directory. You probably want to remove it. -``` -$ rm -i $HOME/bin/dnscontrol +```shell +rm -i $HOME/bin/dnscontrol ``` ## Other useful docs From 01388c888b159dc39f2fe8de620f663f663eaf61 Mon Sep 17 00:00:00 2001 From: Jeffrey Cafferata Date: Thu, 19 Dec 2024 16:26:59 +0100 Subject: [PATCH 05/12] DOCS: Deduplication of the assumptions. --- documentation/test-a-branch.md | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/documentation/test-a-branch.md b/documentation/test-a-branch.md index 8185e8ac18..3e56048e53 100644 --- a/documentation/test-a-branch.md +++ b/documentation/test-a-branch.md @@ -2,14 +2,14 @@ Instructions for testing DNSControl at a particular PR or branch. -## Using Docker - -Using Docker assures you're using the latest version of Go and doesn't require you to install anything on your machine, other than Docker! - Assumptions: * `/THE/PATH` -- Change this to the full path to where your dnsconfig.js and other files are located. * `INSERT_BRANCH_HERE` -- The branch you want to test. The branch associated with a PR is listed on [https://github.com/StackExchange/dnscontrol/branches](https://github.com/StackExchange/dnscontrol/branches). +## Using Docker + +Using Docker assures you're using the latest version of Go and doesn't require you to install anything on your machine, other than Docker! + ```shell docker run -it -v /THE/PATH:/dns golang git clone https://github.com/StackExchange/dnscontrol.git @@ -34,13 +34,8 @@ go test -v -verbose -provider INSERT_PROVIDER_NAME -start 1 -end 3 Change `INSERT_PROVIDER_NAME` to the name of your provider (`BIND`, `ROUTE53`, `GCLOUD`, etc.) - ## Not using Docker -Assumptions: -* `/THE/PATH` -- Change this to the full path to where your dnsconfig.js and other files are located. -* `INSERT_BRANCH_HERE` -- The branch you want to test. The branch associated with a PR is listed on [https://github.com/StackExchange/dnscontrol/branches](https://github.com/StackExchange/dnscontrol/branches). - Step 1: Install Go [https://go.dev/dl/](https://go.dev/dl/) From cad7e8325d6dab4bccdc88ca8e4a79fa195aa608 Mon Sep 17 00:00:00 2001 From: Jeffrey Cafferata Date: Thu, 19 Dec 2024 16:28:45 +0100 Subject: [PATCH 06/12] DOCS: This link should be relative. --- documentation/test-a-branch.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/test-a-branch.md b/documentation/test-a-branch.md index 3e56048e53..dff9023643 100644 --- a/documentation/test-a-branch.md +++ b/documentation/test-a-branch.md @@ -24,7 +24,7 @@ dnscontrol preview ``` If you want to run the integration tests, follow the -[Integration Tests](https://docs.dnscontrol.org/developer-info/integration-tests) document +[Integration Tests](integration-tests.md) document as usual. The directory to be in is `/go/dnscontrol/integrationTest`. ```shell From 4479a3b0e79214c7cfb4224ee52e39281be3291e Mon Sep 17 00:00:00 2001 From: Jeffrey Cafferata Date: Thu, 19 Dec 2024 16:31:41 +0100 Subject: [PATCH 07/12] DOCS: The `git checkout` command can be combined with the `git clone` command. --- documentation/test-a-branch.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/documentation/test-a-branch.md b/documentation/test-a-branch.md index dff9023643..0850850844 100644 --- a/documentation/test-a-branch.md +++ b/documentation/test-a-branch.md @@ -12,9 +12,8 @@ Using Docker assures you're using the latest version of Go and doesn't require y ```shell docker run -it -v /THE/PATH:/dns golang -git clone https://github.com/StackExchange/dnscontrol.git +git clone -b INSERT_BRANCH_HERE https://github.com/StackExchange/dnscontrol.git cd dnscontrol -git checkout INSERT_BRANCH_HERE go install ``` @@ -43,9 +42,8 @@ Step 1: Install Go Step 2: Check out the software ```shell -git clone https://github.com/StackExchange/dnscontrol.git +git clone -b INSERT_BRANCH_HERE https://github.com/StackExchange/dnscontrol.git cd dnscontrol -git checkout INSERT_BRANCH_HERE go install ``` From c802a915adbdbdde4e8e61861901f6dacbda2237 Mon Sep 17 00:00:00 2001 From: Jeffrey Cafferata Date: Thu, 19 Dec 2024 16:32:53 +0100 Subject: [PATCH 08/12] DOCS: Add `--single-branch` to prevent fetching of all branches. --- documentation/test-a-branch.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/documentation/test-a-branch.md b/documentation/test-a-branch.md index 0850850844..07f7e3dbcb 100644 --- a/documentation/test-a-branch.md +++ b/documentation/test-a-branch.md @@ -12,7 +12,7 @@ Using Docker assures you're using the latest version of Go and doesn't require y ```shell docker run -it -v /THE/PATH:/dns golang -git clone -b INSERT_BRANCH_HERE https://github.com/StackExchange/dnscontrol.git +git clone -b INSERT_BRANCH_HERE --single-branch https://github.com/StackExchange/dnscontrol.git cd dnscontrol go install ``` @@ -42,7 +42,7 @@ Step 1: Install Go Step 2: Check out the software ```shell -git clone -b INSERT_BRANCH_HERE https://github.com/StackExchange/dnscontrol.git +git clone -b INSERT_BRANCH_HERE --single-branch https://github.com/StackExchange/dnscontrol.git cd dnscontrol go install ``` From 6c0a4abbcb6400ad8f72e1450ad6240d58a3e333 Mon Sep 17 00:00:00 2001 From: Tom Limoncelli Date: Wed, 18 Dec 2024 15:58:39 -0500 Subject: [PATCH 09/12] DOC: NEW: How to test a branch --- documentation/test-a-branch.md | 41 +++++++++++++++++----------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/documentation/test-a-branch.md b/documentation/test-a-branch.md index 07f7e3dbcb..b14c8d8489 100644 --- a/documentation/test-a-branch.md +++ b/documentation/test-a-branch.md @@ -2,52 +2,55 @@ Instructions for testing DNSControl at a particular PR or branch. -Assumptions: -* `/THE/PATH` -- Change this to the full path to where your dnsconfig.js and other files are located. -* `INSERT_BRANCH_HERE` -- The branch you want to test. The branch associated with a PR is listed on [https://github.com/StackExchange/dnscontrol/branches](https://github.com/StackExchange/dnscontrol/branches). - ## Using Docker Using Docker assures you're using the latest version of Go and doesn't require you to install anything on your machine, other than Docker! -```shell +Assumptions: +* `/THE/PATH` -- Change this to the full path to where your dnsconfig.js and other files are located. +* `INSERT_BRANCH_HERE` -- The branch you want to test. The branch associated with a PR is listed on [https://github.com/StackExchange/dnscontrol/branches](https://github.com/StackExchange/dnscontrol/branches). + +``` docker run -it -v /THE/PATH:/dns golang -git clone -b INSERT_BRANCH_HERE --single-branch https://github.com/StackExchange/dnscontrol.git +git clone https://github.com/StackExchange/dnscontrol.git cd dnscontrol +git checkout INSERT_BRANCH_HERE go install -``` -```shell cd /dns dnscontrol preview ``` If you want to run the integration tests, follow the -[Integration Tests](integration-tests.md) document +[Integration Tests](https://docs.dnscontrol.org/developer-info/integration-tests) document as usual. The directory to be in is `/go/dnscontrol/integrationTest`. -```shell +``` cd /go/dnscontrol/integrationTest go test -v -verbose -provider INSERT_PROVIDER_NAME -start 1 -end 3 ``` -Change `INSERT_PROVIDER_NAME` to the name of your provider (`BIND`, `ROUTE53`, `GCLOUD`, etc.) +Change `INSERT_PROVIDER_NAME` to the name of your provider (BIND, ROUTE53, GCLOUD, etc.) + ## Not using Docker +Assumptions: +* `/THE/PATH` -- Change this to the full path to where your dnsconfig.js and other files are located. +* `INSERT_BRANCH_HERE` -- The branch you want to test. The branch associated with a PR is listed on [https://github.com/StackExchange/dnscontrol/branches](https://github.com/StackExchange/dnscontrol/branches). + Step 1: Install Go [https://go.dev/dl/](https://go.dev/dl/) Step 2: Check out the software -```shell -git clone -b INSERT_BRANCH_HERE --single-branch https://github.com/StackExchange/dnscontrol.git +``` +git clone https://github.com/StackExchange/dnscontrol.git cd dnscontrol +git checkout INSERT_BRANCH_HERE go install -``` -```shell cd /THE/PATH dnscontrol preview ``` @@ -56,11 +59,7 @@ Step 3: Clean up `go install` put the `dnscontrol` program in your `$HOME/bin` directory. You probably want to remove it. -```shell -rm -i $HOME/bin/dnscontrol +``` +$ rm -i $HOME/bin/dnscontrol ``` -## Other useful docs - -* How to run the integrations tests: - * [https://docs.dnscontrol.org/developer-info/integration-tests](https://docs.dnscontrol.org/developer-info/integration-tests) From 8c03858b00cb6f2d3f9d145b41f6c1ae80c18173 Mon Sep 17 00:00:00 2001 From: Tom Limoncelli Date: Wed, 18 Dec 2024 16:04:40 -0500 Subject: [PATCH 10/12] empty From 04b8560785f8448b369b3ca3d3bcc9d39fbf1c8b Mon Sep 17 00:00:00 2001 From: Tom Limoncelli Date: Wed, 18 Dec 2024 16:04:40 -0500 Subject: [PATCH 11/12] empty From f219b8156456749dbb4fd614e03fdca9cf4cdacb Mon Sep 17 00:00:00 2001 From: Tom Limoncelli Date: Thu, 19 Dec 2024 11:37:09 -0500 Subject: [PATCH 12/12] GANDI_V5: Increase error verbosity (#3267) --- providers/gandiv5/gandi_v5Provider.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/providers/gandiv5/gandi_v5Provider.go b/providers/gandiv5/gandi_v5Provider.go index 8baa5a96a4..4220e6f5cb 100644 --- a/providers/gandiv5/gandi_v5Provider.go +++ b/providers/gandiv5/gandi_v5Provider.go @@ -244,7 +244,7 @@ func (client *gandiv5Provider) GetZoneRecordsCorrections(dc *models.DomainConfig F: func() error { res, err := g.CreateDomainRecord(domain, shortname, rtype, ttl, values) if err != nil { - return fmt.Errorf("%+v: %w", res, err) + return fmt.Errorf("%+v ret=%03d: %w", res, res.Code, err) } return nil }, @@ -263,7 +263,7 @@ func (client *gandiv5Provider) GetZoneRecordsCorrections(dc *models.DomainConfig F: func() error { res, err := g.UpdateDomainRecordsByName(domain, shortname, ns) if err != nil { - return fmt.Errorf("%+v: %w", res, err) + return fmt.Errorf("%+v ret=%03d: %w", res, res.Code, err) } return nil },