refactor(lineage-gc): split scheduler to tombstone-only (Phase 2) - #259
Conversation
…retention → enterprise)
…in OSS deployments
… to enterprise scheduler) The governance-retention gating logic was stripped from LineageGCScheduler; its remaining valid coverage (tombstone gating, dead-knob warning, legacy config, never-runs-governance-retention) already lives in test_gc_scheduler.py. The 4 governance-specific tests here now fail against the reduced scheduler.
|
Important Review skippedNo new commits to review since the last review. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthrough
ChangesTombstone-only scheduler and governance-retention contract tests
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@tests/server/services/lineage/test_gc_scheduler.py`:
- Around line 337-447: The dead-knob tests are triggering the real lineage GC
scheduler, which spawns background threads and leaks noise across tests. Update
the `_config`/`_ctx` test helpers and the `maybe_start_lineage_gc` call sites so
these cases only exercise the warning path without starting `_run_loop`; include
the missing `poll_interval_seconds` on the fake `lineage_gc` config or mock the
startup path so no daemon thread is created. Use the existing
`maybe_start_lineage_gc`, `_config`, and `_ctx` helpers to keep the tests
isolated.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: e3b51814-c7ec-4890-9e59-401b0d8b73ab
📒 Files selected for processing (5)
reflexio/models/config_schema.pyreflexio/server/services/lineage/gc_scheduler.pytests/server/services/lineage/test_gc_scheduler.pytests/server/services/lineage/test_governance_retention_gates.pytests/server/services/storage/test_storage_contract_gc_governance_retention.py
💤 Files with no reviewable changes (1)
- tests/server/services/lineage/test_governance_retention_gates.py
…threads Use lineage_gc_enabled=False in the three dead-knob warning tests that had lineage_gc_enabled=True, so maybe_start_lineage_gc returns None immediately after emitting the warning (the warning fires before the enabled gate) without spawning a real LineageGCScheduler daemon thread. Also fix pre-existing ruff N814 (SimpleNamespace imported as _NS alias) and nine pre-existing pyright arg-type/assignment errors throughout the file.
|
@coderabbitai review |
✅ Action performedReview finished.
|
Phase 2 — Premium reclaimer split (OSS side)
Reduces the shared lineage GC daemon to tombstone-GC only (core local data hygiene), splitting the premium governance-retention reclaimer out to an enterprise
Capability(see the enterprise PR).What changed
LineageGCScheduler/maybe_start_lineage_gcreduced to tombstone-only — dropped thegc_governance_retentionbranch, the_is_governance_retention_enabledhelper, and theGovernanceRetentionConfigimport; gate is nowif not cfg.lineage_gc.enabled. Tombstone GC is unchanged (same entity loop, cutoff, high-volume tripwire, per-org resilience) and still default-on in all modes — no tombstone/PII-retention regression.audit_events_retention_enabled=Truenow gets a one-time startup warning (the reclaimer lives in enterprise); the config field is documented enterprise-only.gc_governance_retentionstays an OSS abstract storage method (consumed by the enterprise capability via the publicctx.storageinterface) + a new backend-agnostic cross-backend contract test.Tests
gc_governance_retentioneven with retention enabled, while tombstone GC still runs.LineageGCConfig().enabled is Truedefault-flip tripwire.gc_governance_retentioncontract test (SQLite via the shared fixture; auto-covers Supabase when that param is added).Behavior-preserving for tombstone GC; design doc reviewed across 3 rounds (incl. a focused verification that caught + closed a managed-tenant silent-skip risk).
Summary by CodeRabbit