Skip to content

fix: DNS record RRset display/deletion, egress create reporting, command reference validation#28

Merged
ditahkk merged 4 commits into
mainfrom
release/v0.0.22
Jul 6, 2026
Merged

fix: DNS record RRset display/deletion, egress create reporting, command reference validation#28
ditahkk merged 4 commits into
mainfrom
release/v0.0.22

Conversation

@ditahkk

@ditahkk ditahkk commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • DNS records now support record-set style data, with improved display and deletion by name/type.
    • Command reference examples were expanded and corrected across networking, DNS, monitoring, Kubernetes, support, and dashboard workflows.
    • Release documentation now includes clearer install, upgrade, and verification steps.
  • Bug Fixes

    • Improved DNS record handling for live backend responses, including relative names and canonical domain formatting.
    • Egress rule creation now retries automatically and shows clearer errors if a rule never appears.
    • Multiple CLI examples and command docs were aligned with the actual available commands.

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@ditahkk, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 36 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 16488115-fa0c-4864-948b-2b275e57afc0

📥 Commits

Reviewing files that changed from the base of the PR and between 19ae49c and 5162d82.

📒 Files selected for processing (10)
  • .gitattributes
  • .github/workflows/build.yml
  • CHANGELOG.md
  • RELEASE_NOTES.md
  • docs/commands.md
  • docs/development/RELEASE.md
  • internal/commands/dns.go
  • pkg/api/dns/dns.go
  • pkg/api/egress/egress.go
  • pkg/api/egress/egress_test.go
📝 Walkthrough

Walkthrough

This PR adds PowerDNS record-set support (new Contents field, custom JSON unmarshaling, DeleteRecordByName, CanonicalRecordFQDN), reworks dns record-delete/dns show/dns record-create CLI behavior, adds retry logic for egress rule visibility after creation, and updates release notes, changelog, and command documentation.

Changes

DNS Record-Set Support

Layer / File(s) Summary
DNS SDK decoding and deletion primitives
pkg/api/dns/dns.go, pkg/api/dns/dns_test.go
Adds Contents []string with custom UnmarshalJSON for RRset/legacy shapes, DeleteRecordByName, CanonicalRecordFQDN, deprecates DeleteRecord, and adds corresponding unit tests.
DNS CLI command updates
internal/commands/dns.go, docs/commands.md
Removes ID column from dns show/record-create tables, reworks dns record-delete to support legacy --record-id and new --name/--type deletion paths, adds runDNSRecordDeleteByName, and updates docs.

Egress Rule Creation Retry

Layer / File(s) Summary
Egress create retry logic
pkg/api/egress/egress.go, docs/commands.md
Adds bounded retry loop (3 attempts, 2s delay) when polling for a created rule, aborts on context cancellation, updates failure message, and documents the known issue.

Documentation and Release Notes

Layer / File(s) Summary
Changelog and release notes
CHANGELOG.md, RELEASE_NOTES.md
Adds v0.0.22 changelog entry and rewrites release notes covering DNS fixes, egress retry, installation steps, and command reference corrections.
Command reference docs
docs/commands.md
Rewrites Networking, DNS, Monitoring, Kubernetes, Support, and Dashboard command examples to match current CLI behavior.
Release process docs
docs/development/RELEASE.md
Adds pre-tagging content requirements and changes version tag format to require a v prefix.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • zsoftly/zcp-cli#7: Both PRs modify the DNS CLI delete flow in internal/commands/dns.go, particularly dns record-delete error handling and flag wiring.
  • zsoftly/zcp-cli#14: Both PRs modify pkg/api/egress/egress.go's post-create visibility/fallback logic in Service.Create.

Suggested reviewers: ditahm6, ClintonChe, godsonten

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main fixes: DNS RRset handling, egress create reporting, and command reference updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch release/v0.0.22

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (3)
pkg/api/egress/egress.go (2)

154-155: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider wrapping ctx.Err() for consistency.

Every other error path in this function uses fmt.Errorf with context (network slug, operation). Returning ctx.Err() bare loses that context when the caller needs to distinguish it from other egress errors.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/api/egress/egress.go` around lines 154 - 155, The ctx.Done() return in
egress behavior should match the other error paths by preserving operation
context instead of returning ctx.Err() directly. Update the ctx.Done() branch in
the egress flow to wrap ctx.Err() with fmt.Errorf, including the same
identifying details used elsewhere in this function such as the network slug and
current operation so callers can distinguish cancellation from other egress
failures.

152-158: 🩺 Stability & Availability | 🔵 Trivial | 💤 Low value

time.After inside the retry loop can leak a timer if ctx cancels first.

Since the timer is bounded to at most 2 iterations, the practical leak impact is negligible here, but time.NewTimer+Stop() is the idiomatic pattern for select inside loops.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/api/egress/egress.go` around lines 152 - 158, The retry wait in egress
list attempts currently uses time.After inside the loop, which can leave an
unneeded timer alive when ctx.Done() wins the select. Update the retry branch in
the egress listing logic to use time.NewTimer with a deferred/conditional Stop
and drain pattern, keeping the same 2-second delay behavior while ensuring the
timer is cleaned up properly. Focus on the select inside the listAttempts loop
in the egress retrieval flow.
internal/commands/dns.go (1)

339-370: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider marking --record-id deprecated via Cobra.

The flag is documented as legacy in its help text, but Cobra's MarkDeprecated would surface a runtime warning automatically instead of relying on users reading --help.

♻️ Suggested tweak
 	cmd.Flags().IntVar(&recordID, "record-id", 0, "Legacy: numeric record ID (most deployments do not expose IDs)")
+	_ = cmd.Flags().MarkDeprecated("record-id", "most deployments no longer expose record IDs; use --name/--type instead")
 	cmd.Flags().BoolVar(&yes, "yes", false, "Skip confirmation prompt")
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/commands/dns.go` around lines 339 - 370, Mark the legacy numeric
identifier flag in newDNSRecordDeleteCmd as deprecated using Cobra’s deprecation
support so users get a runtime warning automatically; keep the existing
runDNSRecordDelete legacy path for compatibility, but update the --record-id
flag registration to surface the deprecation notice instead of relying only on
the help text.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pkg/api/egress/egress.go`:
- Around line 140-151: The fallback rule match in the egress lookup is too broad
for ICMP traffic and can return the wrong rule when ICMPType or ICMPCode differ.
Update the matching logic in the egress rule scan (the loop in the egress API
lookup) so that, when req.Protocol indicates ICMP, it also compares the ICMPType
and ICMPCode fields in addition to protocol and CIDR, while keeping the existing
port-based behavior for non-ICMP protocols.

In `@RELEASE_NOTES.md`:
- Around line 5-10: The release note paragraph is too broad about record IDs and
should be scoped to the PowerDNS backend only. Update the wording in
RELEASE_NOTES so the no-ID and contents-array behavior is clearly tied to
PowerDNS, while leaving the legacy record-id path intact for backends that still
expose IDs; keep the phrasing consistent with the later notes about `dns
record-delete` and record tables.

---

Nitpick comments:
In `@internal/commands/dns.go`:
- Around line 339-370: Mark the legacy numeric identifier flag in
newDNSRecordDeleteCmd as deprecated using Cobra’s deprecation support so users
get a runtime warning automatically; keep the existing runDNSRecordDelete legacy
path for compatibility, but update the --record-id flag registration to surface
the deprecation notice instead of relying only on the help text.

In `@pkg/api/egress/egress.go`:
- Around line 154-155: The ctx.Done() return in egress behavior should match the
other error paths by preserving operation context instead of returning ctx.Err()
directly. Update the ctx.Done() branch in the egress flow to wrap ctx.Err() with
fmt.Errorf, including the same identifying details used elsewhere in this
function such as the network slug and current operation so callers can
distinguish cancellation from other egress failures.
- Around line 152-158: The retry wait in egress list attempts currently uses
time.After inside the loop, which can leave an unneeded timer alive when
ctx.Done() wins the select. Update the retry branch in the egress listing logic
to use time.NewTimer with a deferred/conditional Stop and drain pattern, keeping
the same 2-second delay behavior while ensuring the timer is cleaned up
properly. Focus on the select inside the listAttempts loop in the egress
retrieval flow.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0f2c1aa3-a391-491d-b28b-475c0d9dfbed

📥 Commits

Reviewing files that changed from the base of the PR and between cdd3ccf and 19ae49c.

📒 Files selected for processing (8)
  • CHANGELOG.md
  • RELEASE_NOTES.md
  • docs/commands.md
  • docs/development/RELEASE.md
  • internal/commands/dns.go
  • pkg/api/dns/dns.go
  • pkg/api/dns/dns_test.go
  • pkg/api/egress/egress.go

Comment thread pkg/api/egress/egress.go
Comment thread RELEASE_NOTES.md
@ditahkk ditahkk merged commit 69946bf into main Jul 6, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant