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

kobotoolbox / kpi / 25687037878 / 5
81%
master: 76%

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 11 May 2026 05:51PM UTC
Files 910
Run time 1min
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

11 May 2026 05:44PM UTC coverage: 55.147% (-10.7%) from 65.885%
25687037878.5

push

github

web-flow
feat(metadata): ensure extra metadata fields are nested in asset settings DEV-2072  (#7027)

### đŸ“Ŗ Summary
Added extra project metadata fields to the asset settings under a
dedicated section to ensure a more organized and reliable data structure

### 💭 Notes
This backend update expects custom metadata fields to be passed from the
frontend under `settings.extra_metadata`. This avoids collisions when a
custom field has the same name as a core setting, such as `country`.

### 👀 Preview steps
To see the changes, test asset creation via the Django shell, as the
frontend isn't implemented yet.

1. â„šī¸ have an account
2. Open the Django shell
3. Get your user and create new asset with extra metadata:
```
user = User.objects.get(username='your_username')
asset = Asset.objects.create(
    name='test survey',
    owner=user,
    asset_type='survey',
    settings={
        'description': 'test',
        'country': [{'label': 'Canada', 'value': 'ca'}],
        'extra_metadata': {
            'ProjectManager': 'Alex',
            'Department': 'Research',
            'country': 'USA'
        }
    }
)
```
4. Obtain the newly created asset's uid and check out the endpoint:
`/api/v2/assets/{asset_uid}`
5. đŸŸĸ [on PR] Notice that the extra metadata is nicely nested under
settings. Should look something like:
```
"settings": {
    "sector": {},
    "country": [
      {
        "label": "Canada",
        "value": "ca"
      }
    ],
    "description": "test",
    "organization": "",
    "country_codes": [
      "ca"
    ],
    "extra_metadata": {
      "country": "USA",
      "Department": "Research",
      "ProjectManager": "Alex"
    }
  },
```
6. đŸŸĸ notice that we have two of the same keys 'country' that are not
colliding
7. Test filtering:
`api/v2/assets/?q=settings__extra_metadata__icontains:Alex` and ensure
that the correct asset is returned
8. Also test that library items are created with the correct nested
`extra_metadata`

5181 of 12156 branches covered (42.62%)

20207 of 36642 relevant lines covered (55.15%)

0.55 hits per line

Source Files on job 25687037878.5
  • Tree
  • List 910
  • Changed 300
  • Source Changed 0
  • Coverage Changed 300
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 25687037878
  • fdcfbb3f on github
  • Prev Job for on main (#25685067958.7)
  • Next Job for on main (#25693939151.6)
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