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

kobotoolbox / kpi / 25750860804
82%
master: 76%

Build:
Build:
LAST BUILD BRANCH: dev-2199-simplify-nlp-api-location-and-implement-toggle
DEFAULT BRANCH: master
Ran 12 May 2026 05:30PM UTC
Jobs 10
Files 913
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

12 May 2026 05:25PM UTC coverage: 81.906% (-0.2%) from 82.137%
25750860804

push

github

web-flow
fix(subsequences): migrate qpath to xpath in SubmissionSupplements DEV-2094 (#7046)

### 📣 Summary
Ensure old NLP data and QA question responses get exported.


### 📖 Description
Fixes a bug wherein older transcripts, translations, and qa question
responses were not showing up in exports or the data table.


### 💭 Notes
A previous migration from `qpath`s to `xpath`s was done on the fly, so
submission supplements that were not accessed were not updated. However,
the `advanced_features` dict of the corresponding assets were updated to
have xpaths, and no reference to the old qpaths.

The subsequent migration to the new subsequence version (`20240820`)
looked at old submission supplements
to gather `(xpath, action)` pairs to determine what QAFs needed to be
created, then used the `advanced_features` dict on the asset to populate
the `params` of the new QAF. This led to the creation of QAFs that had a
qpath instead of an xpath in `question_xpath` and an empty `params`
list.

This PR queries all submission supplements for anything with a hyphen in
the question name using `extra` and `rawSQL`. This is because there is
no Django-native way of querying for keys in a JSONField that match a
particular regex. While this does mean using postgres specific code, it
prevents us from having to use a whole new schema version for what is
essentially an edge case.

The PR also creates any missing QAFs that may have not been created if
every submission supplement for an asset used the old qpath. For safety,
the QAFs are created in an `atomic` block while updating the submission
supplement that necessitated them, so if something kills the update
mid-process, we will still know they need to be created. We use a simple
set to keep track of which QAFs were already created so we don't hit the
DB more than necessary.

There is one small risk where we could end up with the migration
infinitely in progress:
If there is a submission supplement with a qpath that has no xpath
equiv... (continued)

7800 of 12051 branches covered (64.72%)

1 of 98 new or added lines in 2 files covered. (1.02%)

29618 of 36161 relevant lines covered (81.91%)

5.77 hits per line

Uncovered Changes

Lines Coverage ∆ File
74
0.0
kobo/apps/long_running_migrations/jobs/0024_migrate_submission_supplement_qpaths.py
23
19.9
-2.2% kobo/apps/subsequences/utils/versioning.py
Jobs
ID Job ID Ran Files Coverage
1 25750860804.1 12 May 2026 05:30PM UTC 909
52.55
2 25750860804.2 12 May 2026 05:30PM UTC 909
54.08
3 25750860804.3 12 May 2026 05:31PM UTC 911
55.32
4 25750860804.4 12 May 2026 05:31PM UTC 911
53.76
5 25750860804.5 12 May 2026 05:31PM UTC 909
52.78
6 25750860804.6 12 May 2026 05:32PM UTC 909
60.06
7 25750860804.7 12 May 2026 05:33PM UTC 911
54.12
8 25750860804.8 12 May 2026 05:34PM UTC 913
68.03
9 25750860804.9 12 May 2026 05:34PM UTC 911
61.18
10 25750860804.10 12 May 2026 05:44PM UTC 911
65.81
Source Files on build 25750860804
  • Tree
  • List 913
  • Changed 3
  • Source Changed 0
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • 0ac32a75 on github
  • Prev Build on release/2.026.12 (#25515255167)
  • Next Build on release/2.026.12 (#25811572309)
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