CICD: Add golangci-lint-action to PR pipeline#11
Closed
cafferata wants to merge 438 commits into
Closed
Conversation
This reverts commit e0e610c.
Co-authored-by: Klett IT <git@klett-it.net>
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
This reverts commit 51b5056.
…(POSSIBLE BREAKING CHANGE) (DNSControl#3693)
…s to suggest safer onboarding process. (DNSControl#3691)
## Summary Hey! This adds support for Gidinet, an Italian domain registrar. I needed it for managing my domains so figured I'd contribute it back. It works as both DNS provider and registrar: - DNS side handles the usual records (A, AAAA, CNAME, MX, NS, TXT, SRV) - Registrar side manages nameserver delegation The API is SOAP-based which was fun to work with... Their docs are a bit sparse but I got it working after some trial and error. ## Notes - Apex NS records can't be managed via DNS API (they're read-only), so I filter them out with a warning. Nameserver changes go through the registrar instead. - TTL values get rounded to what the API accepts - No CAA support unless you have their premium service Tested with my own domains and it's been working fine. Happy to address any feedback! Please create the GitHub label "provider-gidinet" --------- Co-authored-by: Tom Limoncelli <6293917+tlimoncelli@users.noreply.github.com>
<!--
## Before submiting a pull request
Please make sure you've run the following commands from the root
directory.
bin/generate-all.sh
(this runs commands like "go generate", fixes formatting, and so on)
## Release changelog section
Help keep the release changelog clear by pre-naming the proper section
in the GitHub pull request title.
Some examples:
* CICD: Add required GHA permissions for goreleaser
* DOCS: Fixed providers with "contributor support" table
* ROUTE53: Allow R53_ALIAS records to enable target health evaluation
More examples/context can be found in the file .goreleaser.yml under the
'build' > 'changelog' key.
!-->
…rol#4045) ## Summary - Fixes comment and tag removal not actually clearing values via the Cloudflare API, causing `preview`/`push` to show the same correction on every run without converging - `preprocessConfig` now ensures metadata keys exist (set to `""`) on every desired record when `CF_MANAGE_COMMENTS` or `CF_MANAGE_TAGS` is enabled, so `modifyRecord` correctly sends empty values to the API - `modifyRecord` tags path now sends an empty slice (`[]string{}`) to clear tags, matching the comment pattern which already sent `&""` to clear comments Fixes DNSControl#4039 ## Test plan - [x] Unit tests for `preprocessConfig` metadata key initialization (4 tests) - [x] Unit tests for `genComparableWithMgmt` edge cases (6 subtests) - [x] All existing cloudflare provider tests pass - [x] Broader test suite passes (`commands`, `models`, `pkg`) - [x] Manual test: removing `CF_COMMENT` from a record clears the comment in Cloudflare - [x] Manual test: removing `CF_TAGS` from a record clears all tags in Cloudflare - [x] Manual test: subsequent `preview`/`push` shows 0 corrections (convergence verified)
Linode supports Service (`SRV`) records. Code already exists for `SRV` records in the linode provider but it was disabled by a lack of `CanUseSRV` capability.
<!--
## Before submiting a pull request
Please make sure you've run the following commands from the root
directory.
bin/generate-all.sh
(this runs commands like "go generate", fixes formatting, and so on)
## Release changelog section
Help keep the release changelog clear by pre-naming the proper section
in the GitHub pull request title.
Some examples:
* CICD: Add required GHA permissions for goreleaser
* DOCS: Fixed providers with "contributor support" table
* ROUTE53: Allow R53_ALIAS records to enable target health evaluation
More examples/context can be found in the file .goreleaser.yml under the
'build' > 'changelog' key.
!-->
Allow domains with Certification Authority Authorization (`CAA`) records
that have flags. Previously `dnscontrol` reported:
> LINODE rejects domain example.com: caa flag is non-zero".
Linode does not, or no longer, rejects `CAA` records with non-zero
flags. The flags are dropped by Linode but the `CAA` records are
created.
In the example below, the flag `iodef_critical` is discarded by Linode.
Otherwise the `CAA` records are populated as expected:
``` js
CAA_BUILDER({
label: "@",
iodef: "mailto:test@example.com",
iodef_critical: true,
issue: ["letsencrypt.org"],
issuewild: "none",
})
```
<!--
## Before submiting a pull request
Please make sure you've run the following commands from the root
directory.
bin/generate-all.sh
(this runs commands like "go generate", fixes formatting, and so on)
## Release changelog section
Help keep the release changelog clear by pre-naming the proper section
in the GitHub pull request title.
Some examples:
* CICD: Add required GHA permissions for goreleaser
* DOCS: Fixed providers with "contributor support" table
* ROUTE53: Allow R53_ALIAS records to enable target health evaluation
More examples/context can be found in the file .goreleaser.yml under the
'build' > 'changelog' key.
!-->
<!--
## Before submiting a pull request
Please make sure you've run the following commands from the root
directory.
bin/generate-all.sh
(this runs commands like "go generate", fixes formatting, and so on)
## Release changelog section
Help keep the release changelog clear by pre-naming the proper section
in the GitHub pull request title.
Some examples:
* CICD: Add required GHA permissions for goreleaser
* DOCS: Fixed providers with "contributor support" table
* ROUTE53: Allow R53_ALIAS records to enable target health evaluation
More examples/context can be found in the file .goreleaser.yml under the
'build' > 'changelog' key.
!-->
This PR adds support for the Bunny DNS custom record type `PullZone` (or
`PZ`), which maps a domain name to a Bunny CDN pull zone.
It looks like this in the config:
```js
D("example.com", REG_NONE, DnsProvider(DSP_BUNNY_DNS),
BUNNY_DNS_PZ("@", 12345),
);
```
Where `12345` is the ID of the CDN pull zone, which can be retrieved
from the Bunny dashboard URL (e.g.
`https://dash.bunny.net/cdn/5269987/general/hostnames`).
It looks like this in the UI:
<img width="1483" height="207" alt="image"
src="https://github.com/user-attachments/assets/d24e640f-8694-48a5-864f-2f75df6a69cb"
/>
Two things for reviewers:
- The Bunny DNS API for PZ records is very messy: when you create a PZ
record you specify `PullZoneID` as an int64, but when you retrieve the
zone records the ID is returned as a string in a field named `LinkName`.
This isn't clearly documented so I'll confirm with Bunny support if this
is the right way to do it and will report back with a comment in this
PR.
- Given the above inconsistency, I've added a unit test for the
conversion and an integration test for the custom record. The
integration test however requires the IDs of 2 pull zones to work
(create+change). I suppose these IDs should be made configurable through
`profiles.json`, but at a first glance I don't see other tests requiring
options so for now I've left the 2 IDs hardcoded (which work only on my
test account).
I may have also missed something else since this is my first
contribution to this project.
Thanks!
P.S. the following integration test is failing with Bunny DNS but I
believe this is unrelated to this PR:
```
--- FAIL: TestDNSProviders/dmw-testdnscontrol.com/25:NS_only_APEX:Single_NS_at_apex (0.17s)
```
---------
Co-authored-by: Tom Limoncelli <6293917+tlimoncelli@users.noreply.github.com>
…nto it (DNSControl#4052) ## Summary Fixes the INWX registrar provider to replace nameservers instead of merging existing and desired nameservers. ## Problem The `GetRegistrarCorrections()` function was merging the currently registered nameservers with the desired nameservers from the configuration. This caused nameserver updates to fail when migrating a domain from one DNS provider to another. Example failure: Update nameservers arely.ns.cloudflare.com,pablo.ns.cloudflare.com -> arely.ns.cloudflare.com,ns.inwx.de,ns2.inwx.de,ns3.inwx.eu,pablo.ns.cloudflare.com FAILURE! (2306) ## Solution Changed the logic to use only the configured nameservers (`dc.Nameservers`) instead of creating a union with the existing registrar nameservers. ### Before ```go combined := map[string]bool{} for _, ns := range dc.Nameservers { combined[ns.Name] = true } for _, rs := range regNameservers { combined[rs] = true } ``` ### After ```go var expected []string for _, ns := range dc.Nameservers { expected = append(expected, ns.Name) } ```
…trol#4056) Bumps @isaacs/brace-expansion from 5.0.0 to 5.0.1. [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/StackExchange/dnscontrol/network/alerts). </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Matteo Contrini <matteo@contrini.it>
72f9749 to
c7e8ba0
Compare
0d22aad to
129a2a2
Compare
129a2a2 to
cb7e89c
Compare
Rename function `new` to `newAutoDNSProvider` to avoid shadowing the predeclared identifier.
Remove unused function `cfCommentAndTagsA`.
Use strings.ReplaceAll instead of strings.Replace with -1.
Omit type from variable declaration where it can be inferred.
Remove redundant embedded field names from selectors.
Apply De Morgan's law to simplify boolean expressions.
Convert if/else chains on single variables to switch statements.
Merge conditional assignments into variable declarations.
cb7e89c to
6e8b53e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
golangci-lint-action@v9as a new PR workflow (.github/workflows/pr_lint.yml)..golangci.ymlwith additional linters:predeclared,godot,asasalint,asciicheck,bidichk,decorder, anddurationcheck.Closes DNSControl#3313
Test plan
PR: Lintworkflow triggers on this PR.