feat: added pagination, transactions and deletion guard#7615
Conversation
…n running experimentations
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
Docker builds report
|
There was a problem hiding this comment.
Code Review
This pull request introduces pagination, query parameter validation, and transactional safety to the experiment endpoints, alongside preventing the deletion of running experiments and avoiding redundant audit logs. The reviewer identified a critical race condition across several methods where audit logs are created inside transaction.atomic() blocks. This can trigger Celery tasks before the database transaction commits, leading to DoesNotExist errors. To resolve this, the reviewer recommends using transaction.on_commit to defer audit log creation until after successful commits, and also suggests returning early in perform_update when no fields have changed to avoid redundant database writes.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7615 +/- ##
=======================================
Coverage 98.51% 98.52%
=======================================
Files 1439 1439
Lines 54690 54733 +43
=======================================
+ Hits 53880 53923 +43
Misses 810 810 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
|
Visual Regression19 screenshots compared. See report for details. |
Thanks for submitting a PR! Please check the boxes below:
docs/if required so people know about the feature.Changes
transaction.atomic, and return409(instead of 500) on concurrent-createraces.
?status=againstExperimentStatus, blockDELETEon running experiments, and skip the audit log on no-opPATCH.CustomPaginationand use_get_environment()per request.How did you test this code?