fix(sdk,test): cascade-delete ephemeral chain validators (Bugbot high-sev follow-up to #428)#429
Conversation
…-sev) Bugbot (PR #428) caught a real leak: provision creates the genesis SeiNetwork, and teardown deletes that network — but the CRD defaults DeletionPolicy=Retain, and the controller strips the validator children's ownerRef under Retain (removeOwnerRef), so deleting the network ORPHANS the controller-created validator SeiNodes. Those validators never carry sei.io/harness-run (the harness doesn't create them), so neither t.Cleanup nor the label-GC sweep reaps them — leaking 4 validators + PVCs per run in the shared nightly namespace. Add DeletionPolicy to the SDK NetworkSpec (string + DeletionDelete/Retain constants, stdlib-only core; threaded into renderNetwork). The integration harness sets DeletionDelete so an ephemeral chain cascade-deletes its validators (+ PVCs) on teardown. Locked by a render_test assertion. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
PR SummaryLow Risk Overview The SDK gains Integration package comments in Reviewed by Cursor Bugbot for commit d9d6b00. Bugbot is set up for automated code reviews on this repo. Configure here. |
Two-lens comment-standards review (idiom D10 + prose dual-audience): - strip meta/ID cruft from code comments (review-tool + design-step/decision IDs belong in the PR, not source) - drop migration-history framing (present-state only) - fix one drift: TestBenchmark doc claimed seiload drive/report the body skips - trim the agent-verbose package doc + de-duplicate the DeletionPolicy rationale to a single canonical home No behavior change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Comment-standards expert review applied (idiom D10 + prose register)Per request, ran a two-lens review scoped to comment register across the WS-I harness + SDK surface. Both converged; all findings applied in
Vetted-clean and kept: the Durable follow-up the idiom lens recommended: graduate this into |
Follow-up to #428 — Bugbot high-severity finding
Bugbot flagged on #428 (verified valid): the integration harness's
teardownorphans validator SeiNodes.Root cause (confirmed in-tree)
provisioncreates the genesisSeiNetwork;teardowndeletes it + the RPCSeiNodes.DeletionPolicy=Retain(+kubebuilder:default=Retain,seinetwork_types.go:98), and under Retain the controller strips the validator children's ownerRef (removeOwnerRef,internal/controller/seinetwork/nodes.go:301) so they survive network deletion.sei.io/harness-run→ neithert.Cleanupnor the label-GC sweep reaps them. Leaks 4 validators + PVCs every run in the sharednightlynamespace.Fix
DeletionPolicyto the SDKNetworkSpec(plainstring+DeletionDelete/DeletionRetainconstants — core stays stdlib-only; threaded intorenderNetwork). Same additive one-way-door pattern asLabels(feat(test): WS-I sei integration suite — TestBenchmark provision spine [DRAFT] #428).DeletionDelete— an ephemeral chain cascade-deletes its validators (+ PVCs) on teardown. Correct for a throwaway test chain (distinct from production fleet nodes, which stay Retain).render_testassertion thatDeletionPolicythreads through.Verification
go build ./...clean ·go test ./sdk/...pass (incl. new assertion) ·go test -c -tags integrationcompiles · golangci-lint 0 issues.🤖 Generated with Claude Code