Skip to content

Plan stale wfctl DNS marker cleanup#42

Merged
intel352 merged 1 commit into
mainfrom
codex/cloudflare-marker-diff
Jun 16, 2026
Merged

Plan stale wfctl DNS marker cleanup#42
intel352 merged 1 commit into
mainfrom
codex/cloudflare-marker-diff

Conversation

@intel352

Copy link
Copy Markdown
Contributor

Summary

  • report stale wfctl-managed TXT markers as DNS record deletions during Diff even when manage_unlisted=false
  • keeps the cleanup scoped to _workflow-dns-managed records containing wfctl marker metadata and only when desired state includes a current marker
  • adds a regression matching gigbagg.rocks duplicate marker state

Verification

  • GOWORK=off go test ./internal/drivers -run 'TestDNSDriver_(DiffDetectsStaleWorkflowManagedMarkersWhenUnlistedRecordsArePreserved|UpdateDeletesStaleWorkflowManagedMarkersWhenUnlistedRecordsArePreserved|RecordBodiesSendQuotedTXTContentToCloudflare)' -count=1
  • GOWORK=off go test ./...
  • GOWORK=off go test ./... -race -count=1
  • git diff --check

Context

A gocodealone-dns plan using v0.1.20 did not include gigbagg.rocks, so apply would not enter the stale-marker cleanup path for already-converged resources. This makes the cleanup visible in the plan and executable by apply.

Copilot AI review requested due to automatic review settings June 16, 2026 23:22

Copilot AI 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.

Pull request overview

This PR makes stale wfctl-managed _workflow-dns-managed TXT marker records visible in Diff (as deletions) even when manage_unlisted=false, aligning plan output with the existing apply-time cleanup behavior.

Changes:

  • Track whether the desired state includes a current workflow-managed marker, and when manage_unlisted=false report any other workflow-managed markers in the zone as deletions during Diff.
  • Add a regression test covering the “duplicate marker” scenario (e.g., gigbagg.rocks) where one marker is desired and another is stale.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
internal/drivers/dns.go Extends diffRecords to surface stale workflow-managed marker deletions when unlisted records are otherwise preserved.
internal/drivers/dns_test.go Adds regression coverage ensuring Diff flags stale workflow marker records as deletions under manage_unlisted=false.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@intel352
intel352 merged commit 1c9399b into main Jun 16, 2026
4 checks passed
@intel352
intel352 deleted the codex/cloudflare-marker-diff branch June 16, 2026 23:26
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.

2 participants