perf: batch deployment pruning - #13980
Draft
HzaRashid wants to merge 6 commits into
Draft
Conversation
Contributor
|
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:
✨ 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 |
Contributor
|
✅ Migration Validation Passed All migrations follow the Expand-Contract pattern correctly. |
HzaRashid
force-pushed
the
wxo-sync-batch
branch
from
July 10, 2026 00:26
119e1dd to
8a10f81
Compare
…Lite SQLite func.now() wrote whole-second strings that failed keyset equality against SQLAlchemy DateTime binds; rewrite existing rows and switch deployment-family models to Python utc_now defaults.
- Add provider-neutral deployment list sync settings for batch size and max refill rounds. - Validate larger local deployment batches against the provider before shaping the response page. - Use keyset refill reads after the first offset page to avoid offset races when stale rows are pruned concurrently. - Prune stale deployments in O(1) DB calls instead of per-round and per-owner cleanup calls. - Cover batch sizing, refill limits, keyset cursor behavior, owner-scoped stale cleanup, and settings composition in tests.
- Filter list/count and sync by deployment_type in SQL so type-scoped sync can prune provider-unknown rows without a Python type skip. - Keep list sync alive on provider round failures; backfill remaining page slots from local rows after sync (may be stale; tune batch size / max rounds to reduce padding). - Bind attachment cleanup/recount to provider-confirmed IDs only (no needless snapshot copy before backfill). - Soften DELETE rowcount handling with UnknownDeleteCount when the driver does not report an int. - Document that deployment_list_sync_batch_size should stay within the provider's ID-filtered list limit. - Stop writing deployment-family timestamps with server_default=func.now(); use Column default/onupdate=utc_now (Field stays default=None) so SQLite stores microsecond DateTime strings matching later query parameters. - Add SQLite migration a8f3c2d1e4b5: rewrite existing second-level timestamp strings through DateTime binds, and drop CURRENT_TIMESTAMP server defaults on all dialects. - Cover type filter, keyset after rewrite, ORM microsecond writes, sync backfill/failure paths, and the server_default drop in unit tests; extend integration coverage for the sync path.
HzaRashid
force-pushed
the
wxo-sync-batch
branch
from
July 10, 2026 17:43
8a10f81 to
072f1a6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
prune stale deployments in a single db call instead of per-round and per-owner