• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

kobotoolbox / kpi / 22775989014
81%
master: 76%

Build:
Build:
LAST BUILD BRANCH: dev-1815-groups-serviceproviderconfig-endpoints
DEFAULT BRANCH: master
Ran 06 Mar 2026 06:47PM UTC
Jobs 2
Files 887
Run time 2min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

06 Mar 2026 06:11PM UTC coverage: 81.248% (-0.009%) from 81.257%
22775989014

push

github

web-flow
fix(migrations): fix materialized view migration conflict DEV-1822 (#6796)

### 📣 Summary
Fixes a database locking issue caused by the
`user_reports_userreportsmv` materialized view that could block
migrations during upgrades or local setup.

### 📖 Description
This update resolves a technical conflict where the background
materialized view used for user reports (`user_reports_userreportsmv`)
would lock database tables, preventing database migrations from applying
successfully.

This PR automates the resolution:
1. Adds a management command (`manage_user_reports_mv`) to safely handle
dropping and recreating the view.
2. Updates `scripts/migrate.sh` to automatically intercept the
`django.db.utils.NotSupportedError`. When detected, the script drops the
view, safely applies the blocked migrations, and then manages the
recreation.
3. Respects `SKIP_HEAVY_MIGRATIONS`: To prevent container orchestrators
from timing out during deployment, if heavy migrations are skipped, the
view recreation is deferred to a Celery Long-Running Migration
background task (`0019_recreate_user_reports_mv`), ensuring instant
container startup.
---------

Co-authored-by: Olivier Léger <olivierleger@gmail.com>

7282 of 11422 branches covered (63.75%)

0 of 6 new or added lines in 1 file covered. (0.0%)

27973 of 34429 relevant lines covered (81.25%)

1.6 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
6
0.0
kobo/apps/long_running_migrations/jobs/0019_recreate_user_reports_mv.py
Jobs
ID Job ID Ran Files Coverage
1 22775989014.1 06 Mar 2026 06:47PM UTC 885
78.91
2 22775989014.2 06 Mar 2026 06:50PM UTC 887
81.21
Source Files on build 22775989014
  • Tree
  • List 887
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • be291045 on github
  • Prev Build on release/2.026.03 (#22725085698)
  • Next Build on release/2.026.03 (#22857660450)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc