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

kobotoolbox / kpi / 29867541075
81%
master: 76%

Build:
Build:
LAST BUILD BRANCH: dev-1635-cleanup-legacy-kobocat-kml-logic
DEFAULT BRANCH: master
Ran 21 Jul 2026 08:56PM UTC
Jobs 10
Files 892
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

21 Jul 2026 08:51PM UTC coverage: 81.488% (+0.006%) from 81.482%
29867541075

push

github

web-flow
fix(logger): resolve `root_uuid` conflicts in dedup command DEV-2450 (#7292)

### 📣 Summary

A background data-repair task could fail on forms that contain certain
duplicate submissions, leaving those forms unrepaired. It now resolves
the conflict and continues.

### 💭 Notes

The `clean_duplicated_submissions` management command (run by
long-running migration 0027) could raise `unique_root_uuid_per_xform`
while assigning `root_uuid`, which aborted the whole form and left it
flagged as failed.

Two root causes are fixed:
- `_replace_duplicates` gave a divergent duplicate a new unique `uuid`
but left its `root_uuid` pointing at the shared value, because
`_populate_root_uuid()` is a no-op once `root_uuid` is already set. It
now sets `root_uuid` to the new uuid and updates the XML `rootUuid` node
when that node exists.
- `_delete_duplicates` backfilled the reference `root_uuid` without
handling a collision with another submission in the same form.

Both now fall back to a shared helper, `resolve_root_uuid_conflict()` in
`logger.utils.instance`, which assigns a unique `CONFLICT-<uuid4>-...`
`root_uuid` (hashed when it would exceed the column length, and never
using the sequential pk) and keeps Postgres, the XML `rootUuid` node
(when present) and the Mongo `meta/rootUuid` in sync.
`_resolve_conflict_by_pk` in `clean_duplicated_submissions_root_uuid`
now uses the same helper instead of duplicating the logic.

The conflicting `.update()` runs in its own `kc_transaction_atomic`
block so a caught `IntegrityError` cannot poison an enclosing
transaction: it is a savepoint when the command runs inside a
transaction (for example under `TestCase`, which is what surfaced this),
or its own transaction when run standalone in autocommit. Without it,
the conflict resolution below would run on an aborted transaction. In
`_replace_duplicates`, only the identity fields change, so after the
Postgres bulk update Mongo is synced with a single bulk `$set` on
`_uuid`, `meta/inst... (continued)

9309 of 12656 branches covered (73.55%)

19 of 19 new or added lines in 2 files covered. (100.0%)

1007 existing lines in 55 files now uncovered.

30343 of 37236 relevant lines covered (81.49%)

5.51 hits per line

Coverage Regressions

Lines Coverage ∆ File
97
29.35
-48.26% kobo/apps/project_ownership/models/transfer.py
80
71.12
-21.8% kpi/mixins/object_permission.py
67
25.35
-31.46% kpi/filters.py
64
12.36
-71.91% kobo/apps/reports/report_data.py
63
32.52
-51.22% kobo/apps/accounts/forms.py
57
32.58
-64.04% kpi/deployment_backends/mock_backend.py
53
38.71
-8.73% kpi/deployment_backends/openrosa_backend.py
50
54.57
-12.35% kpi/deployment_backends/base_backend.py
41
45.06
-9.43% kobo/apps/audit_log/models.py
38
34.52
-45.24% kobo/apps/audit_log/base_views.py
35
52.28
-17.77% kpi/mixins/formpack_xlsform_utils.py
27
0.0
-72.97% kobo/apps/accounts/adapter.py
27
16.67
-18.0% kobo/apps/project_ownership/utils.py
24
40.0
-53.33% kpi/fields/jsonschema_form_field.py
20
52.38
-31.75% hub/models/extra_user_detail.py
20
0.0
-68.97% kobo/apps/audit_log/tasks.py
18
35.56
-40.0% kpi/fields/file.py
17
46.99
-10.24% kobo/apps/organizations/views.py
16
60.0
-11.43% kobo/apps/audit_log/signals.py
13
37.14
-18.57% hub/utils/i18n.py
13
26.09
-56.52% kpi/fields/relative_prefix_hyperlinked_related.py
12
43.06
-16.67% kobo/apps/project_ownership/serializers/invite.py
10
60.71
-35.71% kobo/apps/audit_log/utils.py
10
66.2
-14.08% kobo/apps/project_ownership/models/invite.py
10
14.8
-5.1% kobo/apps/subsequences/utils/versioning.py
7
61.76
-20.59% kobo/apps/storage_backends/base.py
7
32.14
-25.0% kobo/apps/subsequences/utils/supplement_data.py
7
57.14
-33.33% kpi/fields/paginated_api.py
7
53.33
-46.67% kpi/maintenance_tasks.py
6
57.58
-3.64% kobo/apps/organizations/models.py
6
43.75
-37.5% kobo/apps/project_ownership/filters.py
6
72.09
-13.95% kobo/apps/project_ownership/serializers/transfer.py
6
0.0
-100.0% kobo/apps/project_views/tasks.py
6
74.51
-11.76% kpi/context_processors.py
6
42.86
-42.86% kpi/mixins/asset.py
5
30.0
-7.14% kobo/apps/organizations/permissions.py
5
47.22
-13.89% kobo/apps/organizations/tasks.py
5
74.4
47.2% kobo/apps/stripe/utils/subscription_limits.py
5
53.85
-6.41% kpi/deployment_backends/kc_access/utils.py
5
57.14
-23.81% kpi/fields/writable_json.py
4
53.85
-30.77% kobo/apps/accounts/templatetags/customize_email_content.py
4
77.5
-10.0% kobo/apps/kobo_auth/signals.py
4
50.0
-10.53% kobo/apps/organizations/utils.py
4
89.47
-7.02% kpi/deployment_backends/mixin.py
3
65.79
-7.89% kobo/apps/data_collectors/signals.py
3
89.19
-8.11% kobo/apps/project_views/models/project_view.py
2
64.21
-2.11% kobo/apps/openrosa/libs/utils/middleware.py
2
91.3
-8.7% kobo/apps/project_ownership/views/invite.py
2
83.33
-6.67% kobo/urls.py
2
85.84
-1.77% kpi/exceptions.py
2
64.52
-6.45% kpi/mixins/standardize_searchable_field.py
1
44.44
-5.56% kobo/apps/accounts/templatetags/get_provider_appname.py
1
86.11
-2.78% kobo/apps/openrosa/apps/logger/fields.py
1
67.95
-1.28% kpi/authentication.py
1
57.89
-2.63% kpi/db_routers.py
Jobs
ID Job ID Ran Files Coverage
1 29867541075.1 21 Jul 2026 08:56PM UTC 888
44.28
2 29867541075.2 21 Jul 2026 08:56PM UTC 888
49.48
3 29867541075.3 21 Jul 2026 08:57PM UTC 890
45.64
4 29867541075.4 21 Jul 2026 08:57PM UTC 888
52.79
5 29867541075.5 21 Jul 2026 08:58PM UTC 890
50.81
6 29867541075.6 21 Jul 2026 08:58PM UTC 890
54.05
7 29867541075.7 21 Jul 2026 08:59PM UTC 888
58.78
8 29867541075.8 21 Jul 2026 09:01PM UTC 890
66.73
9 29867541075.9 21 Jul 2026 09:01PM UTC 890
59.94
10 29867541075.10 21 Jul 2026 09:03PM UTC 892
69.06
Source Files on build 29867541075
  • Tree
  • List 892
  • Changed 3
  • Source Changed 0
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • c3fc382a on github
  • Prev Build on release/2.026.27 (#29766524809)
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