feat(reconcile): add a Webhook kind#1772
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
Coverage Report for CI Build 29637005218Coverage increased (+0.3%) to 46.363%Details
Uncovered Changes
Coverage Regressions1 previously-covered line in 1 file lost coverage.
Coverage Stats
💛 - Coveralls |
What
Adds a
Webhookkind to the reconcile flow, so webhook endpoints can be managed from adesired-state file like platform users, permissions, roles, and preferences.
How it behaves
This follows the rules in RFC 0001 (
docs/rfcs/0001-declarative-reconcile.md), whichalready named webhooks as a future kind that fails the plan on a missing entry and deletes
by flag.
the plan fails and names their ids, because the URL can no longer tell them apart. Clean
up the extra one by hand.
state (
enabledordisabled). A field you leave out keeps its server value.marked
delete: true. Nothing is removed just because a line is gone.delete: true.read, so it is never in the file, never in a plan, and never in an export. Headers and
metadata set through other tools are carried through an update untouched.
statewhen it is the defaultenabled, so itround-trips to no changes.
Changes
internal/reconcile/webhook.go,webhook_reconciler.go: the kind, its diff, and export.cmd/reconcile.go: register the kind and update the help text.check that a secret never reaches the output.
Testing
go test ./internal/reconcile/...passes.go build,go vet,gofmt, andgolangci-lintare clean.