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

kobotoolbox / kpi / 17156228046
81%
master: 76%

Build:
Build:
LAST BUILD BRANCH: beccagraber/dev-1497-show-most-recently-created-qual-answer
DEFAULT BRANCH: master
Ran 22 Aug 2025 01:50PM UTC
Jobs 2
Files 670
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

22 Aug 2025 01:11PM UTC coverage: 81.407% (-0.04%) from 81.448%
17156228046

push

github

web-flow
feat(dataCollectors): set up initial models and admin DEV-786 (#6142)

### đŸ“Ŗ Summary
Add new data collector models to Django admin.

### 📖 Description
Adds DataCollector and DataCollectorGroup models to Django admin. A
DataCollectorGroup may have several DataCollectors and be associated
with several Assets. Every DataCollector has a token, which may be
rotated using Django admin.

### 💭 Notes
The admin for DataCollectors and DataCollectorGroups is extremely
rudimentary because it turns out making a nice interface for one-to-many
relationships is hard. For this PR, the user can add assets to a
DataCollectorGroup by selecting from a giant checklist of all available
assets. Hopefully in the future, this will be enhanced with an
autocomplete that allows them to search for assets before adding them.
Also in the future, users will be able to add DataCollectors on the
DataCollectorGroup page rather than having to go add the group to the
DataCollector objects. These efforts are part of DEV-920 in Linear.

For now, making sure the owner of the DataCollectorGroup has
manage_asset permissions is only validated at the admin level. Later on
we will probably want to do so with the serializer or even on the model
itself but that raises questions about what to do when the owner of a DC
group changes or is removed which we do not need to worry about for the
pre-MVP. For now, we just filter the list of assets shown down to ones
the DC group owner has access to if the owner is already set, and raise
validation errors if the owner changes to one without the proper
permissions. We also filter the list to assets that don't already have a
DC group set since each asset can only have one.

The new classes were added to kobo_auth since they are a type of user
(sort of) and we mostly care about them for authentication purposes.


### 👀 Preview steps
Make sure to run migrations and undo them afterwards

1. â„šī¸ have an admin account
2. In Django admin, create a new DataCollectorGr... (continued)

6462 of 10157 branches covered (63.62%)

68 of 99 new or added lines in 4 files covered. (68.69%)

24540 of 30145 relevant lines covered (81.41%)

1.6 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
96.3
kobo/apps/data_collectors/models.py
30
51.61
kobo/apps/data_collectors/admin.py
Jobs
ID Job ID Ran Files Coverage
1 17156228046.1 22 Aug 2025 01:50PM UTC 670
78.89
2 17156228046.2 22 Aug 2025 01:52PM UTC 670
81.39
Source Files on build 17156228046
  • Tree
  • List 670
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • 71946664 on github
  • Prev Build on main (#17153976939)
  • Next Build on main (#17157008162)
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

© 2025 Coveralls, Inc