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

kobotoolbox / kpi / 37826658694
83%
master: 76%

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 08 Oct 2026 06:48PM UTC
Jobs 10
Files 914
Run time 3min
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

08 Oct 2026 06:44PM UTC coverage: 83.098% (+0.08%) from 83.018%
37826658694

push

github

web-flow
fix(attachments): stop storage counters from drifting and going negative DEV-3015 (#7680)

### 📣 Summary
Storage usage no longer goes below zero or drifts away from the files
actually stored.

### 📖 Description
Some accounts showed a negative storage usage, which gave them more room
than their plan allows. Others counted more or less than what they
really store. This happened when files were deleted, restored, or moved
to the trash at the same time as other changes, when a submission was
edited, when a project was emptied from the trash, or when a project was
transferred to another user. Storage usage is now always computed from
the projects themselves, and every change counts each file exactly once,
even when several happen at the same time.

### 👷 Description for instance maintainers
- The weekly `sync-storage-counters` task is removed, and a migration
deletes it from the Celery Beat schedule. It compared the user profile
counter with the sum of the user's projects; that profile counter is not
updated anymore, so the task would have found every profile out of sync
and suspended submissions while recounting them.
- Do not run `update_attachment_storage_bytes` (directly, or through
`soft_delete_orphan_attachments_2_023_37c_fix`) until the follow-up PR,
which rewrites it: the current version still resets and recounts
profiles, with submissions suspended.
- Counters that are already wrong are not repaired here. A follow-up PR
adds a long-running migration that recounts them.

10361 of 13680 branches covered (75.74%)

64 of 135 new or added lines in 15 files covered. (47.41%)

2775 existing lines in 85 files now uncovered.

33083 of 39812 relevant lines covered (83.1%)

5.5 hits per line

Uncovered Changes

Lines Coverage ∆ File
15
23.66
-37.87% kobo/apps/openrosa/apps/logger/utils/instance.py
10
39.9
1.34% kpi/deployment_backends/openrosa_backend.py
7
33.1
-0.74% kobo/apps/mass_emails/user_queries.py
7
48.0
-21.39% kobo/apps/openrosa/apps/logger/utils/counters.py
6
41.67
-7.27% kobo/apps/openrosa/apps/logger/utils/attachment.py
6
52.5
-3.38% kobo/apps/trash_bin/models/attachment.py
4
55.36
-34.23% kobo/apps/openrosa/libs/utils/logger_tools.py
4
54.05
5.22% kobo/apps/trash_bin/models/project.py
3
15.77
0.07% kobo/apps/superuser_stats/tasks.py
3
93.24
40.9% kpi/utils/django_orm_helper.py
2
52.42
-38.06% kobo/apps/openrosa/apps/logger/signals.py
2
25.41
-66.89% kobo/apps/openrosa/apps/logger/utils/attachment_restore.py
2
24.84
0.0% kobo/apps/trash_bin/utils/trash.py

Coverage Regressions

Lines Coverage ∆ File
312
0.0
-91.23% kobo/apps/openrosa/apps/viewer/pandas_mongo_bridge.py
226
55.36
-34.23% kobo/apps/openrosa/libs/utils/logger_tools.py
209
19.68
-56.33% kobo/apps/openrosa/libs/utils/export_tools.py
206
0.0
-86.19% kobo/apps/openrosa/libs/utils/briefcase_client.py
119
25.41
-66.89% kobo/apps/openrosa/apps/logger/utils/attachment_restore.py
87
0.0
-87.88% kobo/apps/openrosa/libs/utils/backup_tools.py
81
0.0
-93.1% kobo/apps/stripe/serializers.py
75
0.0
-41.9% kobo/apps/stripe/views.py
73
0.0
-96.05% kobo/apps/openrosa/apps/logger/utils/suspension.py
70
64.46
-24.39% kobo/apps/openrosa/apps/logger/xform_instance_parser.py
66
33.33
-59.46% kobo/apps/openrosa/apps/viewer/views.py
63
0.0
-51.64% kobo/apps/stripe/models.py
61
20.57
-43.26% kobo/apps/stripe/utils/subscription_limits.py
58
0.0
-90.63% kobo/apps/openrosa/libs/data/query.py
49
28.57
-43.75% kobo/apps/openrosa/apps/logger/views.py
47
0.0
-57.65% kobo/apps/openrosa/apps/logger/tasks.py
46
23.66
-37.87% kobo/apps/openrosa/apps/logger/utils/instance.py
45
52.42
-38.06% kobo/apps/openrosa/apps/logger/signals.py
44
45.72
-16.36% kobo/apps/openrosa/apps/viewer/models/data_dictionary.py
41
57.5
-17.08% kobo/apps/openrosa/apps/viewer/models/parsed_instance.py
40
0.0
-40.82% kobo/apps/openrosa/apps/viewer/xls_writer.py
40
23.29
-54.79% kobo/apps/openrosa/libs/utils/image_tools.py
39
39.9
1.34% kpi/deployment_backends/openrosa_backend.py
38
24.14
-32.76% kobo/apps/openrosa/apps/viewer/tasks.py
36
24.49
-73.47% kobo/apps/openrosa/apps/logger/import_tools.py
36
20.2
-36.36% kobo/apps/stripe/utils/billing_dates.py
33
49.02
-32.35% kobo/apps/openrosa/apps/viewer/models/export.py
30
59.68
-24.19% kobo/apps/openrosa/apps/logger/models/attachment.py
29
47.62
-17.26% kobo/apps/openrosa/apps/main/models/meta_data.py
28
30.14
-19.18% kobo/apps/openrosa/libs/utils/viewer_tools.py
28
28.01
-9.12% kpi/views/v2/data.py
27
62.73
-2.73% kpi/permissions.py
24
33.33
-66.67% kobo/apps/openrosa/libs/utils/decorators.py
24
29.67
-26.37% kobo/apps/openrosa/libs/utils/user_auth.py
21
71.79
-10.77% kobo/apps/openrosa/apps/logger/models/instance.py
19
74.41
-9.0% kobo/apps/openrosa/apps/logger/models/xform.py
19
55.0
-15.83% kobo/apps/openrosa/libs/utils/middleware.py
19
0.0
-65.52% kobo/apps/stripe/admin.py
17
16.22
-45.95% kobo/apps/openrosa/apps/logger/utils/database_query.py
16
31.82
-36.36% kobo/apps/stripe/utils/limit_enforcement.py
15
31.71
-36.59% kobo/apps/openrosa/apps/logger/xform_fs.py
15
0.0
-20.55% kobo/apps/stripe/signals.py
14
44.0
-56.0% kobo/apps/openrosa/libs/utils/model_tools.py
13
54.84
-41.94% kobo/apps/openrosa/libs/authentication.py
12
43.6
-2.7% kobo/apps/audit_log/models.py
12
35.0
-60.0% kobo/apps/stripe/utils/import_management.py
11
45.16
-17.74% kpi/views/v2/attachment.py
10
72.2
5.37% kpi/utils/mongo_helper.py
9
0.0
-29.03% kobo/apps/stripe/utils/manual_subscription.py
9
41.18
-52.94% kpi/utils/viewset_mixins.py
8
0.0
-100.0% kobo/apps/stripe/urls.py
7
0.0
-100.0% kobo/apps/stripe/apps.py
7
65.71
12.38% kpi/deployment_backends/base_backend.py
6
55.71
-4.29% kobo/apps/audit_log/signals.py
6
0.0
-100.0% kobo/apps/stripe/exceptions.py
6
0.0
-37.5% kobo/apps/stripe/utils/view_utils.py
5
84.75
-8.47% kobo/apps/openrosa/apps/logger/exceptions.py
5
72.22
-27.78% kobo/apps/openrosa/apps/logger/models/daily_xform_submission_counter.py
5
75.0
-25.0% kobo/apps/openrosa/apps/logger/models/monthly_xform_submission_counter.py
5
48.0
-21.39% kobo/apps/openrosa/apps/logger/utils/counters.py
5
0.0
-38.46% kobo/apps/openrosa/apps/main/context_processors.py
4
45.45
-36.36% kobo/apps/openrosa/koboform/__init__.py
4
56.22
-2.16% kobo/apps/organizations/models.py
3
95.76
-2.54% kobo/apps/openrosa/apps/api/viewsets/xform_submission_api.py
3
80.0
-20.0% kobo/apps/openrosa/apps/viewer/signals.py
3
31.43
-2.86% kobo/apps/organizations/admin/organization.py
3
50.0
-7.89% kobo/apps/organizations/utils.py
3
21.43
-10.71% kobo/apps/subsequences/utils/supplement_data.py
3
54.05
5.22% kobo/apps/trash_bin/models/project.py
3
24.84
0.0% kobo/apps/trash_bin/utils/trash.py
2
60.53
-5.26% kobo/apps/data_collectors/signals.py
2
0.0
-100.0% kobo/apps/openrosa/apps/logger/constants.py
2
52.5
-3.38% kobo/apps/trash_bin/models/attachment.py
2
83.33
0.0% kobo/urls.py
2
39.76
3.61% kpi/utils/storage.py
1
33.33
-1.19% kobo/apps/audit_log/base_views.py
1
88.24
-5.88% kobo/apps/audit_log/middleware.py
1
33.1
-0.74% kobo/apps/mass_emails/user_queries.py
1
91.3
-4.35% kobo/apps/openrosa/libs/permissions.py
1
94.12
-1.18% kobo/apps/openrosa/libs/renderers/renderers.py
1
68.75
-6.25% kobo/apps/openrosa/libs/utils/string.py
1
76.27
-1.69% kobo/apps/user_reports/utils/migrations.py
1
67.95
0.0% kpi/authentication.py
1
96.67
-3.33% kpi/fields/kpi_uid.py
1
94.44
-5.56% kpi/utils/files.py
Jobs
ID Job ID Ran Files Coverage
1 37826658694.1 08 Oct 2026 06:48PM UTC 909
43.66
2 37826658694.2 08 Oct 2026 06:50PM UTC 909
52.63
3 37826658694.3 08 Oct 2026 06:50PM UTC 911
53.87
4 37826658694.4 08 Oct 2026 06:51PM UTC 909
49.84
5 37826658694.5 08 Oct 2026 06:51PM UTC 911
44.94
6 37826658694.6 08 Oct 2026 06:52PM UTC 911
51.09
7 37826658694.7 08 Oct 2026 06:53PM UTC 909
58.4
8 37826658694.8 08 Oct 2026 06:54PM UTC 912
67.66
9 37826658694.9 08 Oct 2026 06:54PM UTC 911
59.47
10 37826658694.10 08 Oct 2026 06:55PM UTC 914
70.05
Source Files on build 37826658694
  • Tree
  • List 914
  • Changed 19
  • Source Changed 0
  • Coverage Changed 19
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • 0816f759 on github
  • Prev Build on release/2.026.37 (#37782134424)
  • Next Build on release/2.026.37 (#37955526365)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc