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

kobotoolbox / kpi / 29028964036 / 1
81%
master: 76%

Build:
Build:
LAST BUILD BRANCH: beccagraber/dev-2432-no-version-update
DEFAULT BRANCH: master
Ran 09 Jul 2026 03:23PM UTC
Files 889
Run time 38s
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

09 Jul 2026 03:18PM UTC coverage: 49.592% (-0.04%) from 49.631%
29028964036.1

push

github

web-flow
fix(supplement): add UUID query fallback to supplement view DEV-2320 (#7222)

### 📣 Summary
Use the fallback query in the supplement view to avoid throwing a 404
error for submissions that didn't get the rootUuid backfilled in mongo.

### 📖 Description
In `kpi/views/v2/data.py`, the method `DataViewSet.supplement` I
replaced the strict `meta/rootUuid` MongoDB query with the method
`_get_submission_by_id_or_root_uuid` that searches both `meta/rootUuid`
and `meta/instanceID` as a fallback. Also added logic to safely inject
the matched uuid into `submission['meta/rootUuid']` if it was missing.

### 👀 Preview steps
Hard to preview, but you could manually remove the `meta/rootUuid` from
a mongodb instance record and then request the supplement endpoint to
test the fallback:

1. Have a deployed asset and submit a record to it.

2. Execute in shell_plus the following snippet to manually strip the
`meta/rootUuid` from MongoDB for that submission:

```
   from django.conf import settings
   
   asset = Asset.objects.get(uid='ASSET_UID')
   submission = list(asset.deployment.get_submissions(asset.owner))[0]
   instance_id = submission['_uuid']
   mongo_id = submission['_id']

   settings.MONGO_DB.instances.update_one(
       {'_id': mongo_id}, 
       {'$unset': {'meta/rootUuid': ""}}
   )
   
   print(f"Use this Instance ID for the URL: {instance_id}")
```
3. Request the supplement endpoint using the instanceID printed above.
You can do this via curl, or by navigating in the browser to:
`https://kf.local.kbtdev.org/api/v2/assets/{YOUR_ASSET_UID}/data/{INSTANCE_ID}/supplement/`.

5. Before this PR the endpoint would return a 404 Not Found because it
strictly queried meta/rootUuid. After this PR it will return a 200 OK
because it successfully falls back to matching the provided UUID against
`meta/instanceID`

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

4407 of 12463 branches covered (35.36%)

18375 of 37052 relevant lines covered (49.59%)

0.5 hits per line

Source Files on job 29028964036.1
  • Tree
  • List 889
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 29028964036
  • ff9e6efe on github
  • Prev Job for on release/2.026.27 (#28865799815.1)
  • Next Job for on release/2.026.27 (#29029441589.5)
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