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

kobotoolbox / kpi / 12869843423
81%
master: 76%

Build:
Build:
LAST BUILD BRANCH: dev-1257-remove-v1-forms-endpoint
DEFAULT BRANCH: master
Ran 20 Jan 2025 02:48PM UTC
Jobs 1
Files 623
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

20 Jan 2025 02:11PM UTC coverage: 80.488% (-0.004%) from 80.492%
12869843423

push

github

web-flow
feat(projectHistoryLogs): log deleted submissions (#5423)

### đŸ“Ŗ Summary
Create logs when submissions are deleted.


### 📖 Description
Each deletion is logged individually even if it was done in bulk. Unlike
other actions, even failed deletions will be logged as long as the
process of deletion was started, since some of the submissions may have
been deleted before the failure. In this case, we prefer false positives
to missing logs.


### 💭 Notes
The more robust way to handle this would probably be to redo the
bulk-deletion process entirely such that each deletion is done as a
single transaction with deletion from mongo, deleting docs from storage,
creating a log. This would obviously take a lot more time and probably
would work better as a celery task than an API endpoint.. At this moment
we did not think it was worth it to rethink the whole process, and
instead settled on just logging every *attempt* to delete, even if that
attempt failed. This is in-keeping with our logging strategy so far,
which has focused on intent more than effect.

For single deletes, this just adds a listener on the post_delete signal
for Instances which attaches the necessary information to the request,
similar to how individual updates were handled.


### 👀 Preview steps
Feature/no-change template:
1. â„šī¸ have 2 accounts and a project
2. Give user2 permission to add submissions to the project
3. Add at least 2 submissions as user1 and 2 as user 2
4. Enable anonymous submissions
5. Add at least 2 anonymous submissions 
6. Go to Project > Data and get the _ids of 1 submission each for user1,
user2, and anonymous
7. For each submission, in the terminal, run `curl -X DELETE -H
'Authorization: Token <your token>'
localhost/api/v2/assets/<asset_uid>/data/<submission _id>/ `
8. Go to `api/v2/assets/<asset_uid>/history`
9. đŸŸĸ There should be a project history log with
`action="delete-submission"` and the usual metadata, along with
`"submission":{"submitted_by": <user1/user2/Anonymous... (continued)

5830 of 9332 branches covered (62.47%)

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

3 existing lines in 1 file now uncovered.

22275 of 27675 relevant lines covered (80.49%)

0.8 hits per line

Uncovered Existing Lines

Lines Coverage ∆ File
3
93.79
-1.86% kobo/apps/stripe/views.py
Jobs
ID Job ID Ran Files Coverage
1 12869843423.1 20 Jan 2025 02:48PM UTC 623
80.49
Source Files on build 12869843423
  • Tree
  • List 623
  • Changed 7
  • Source Changed 0
  • Coverage Changed 7
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • 1d9c3166 on github
  • Prev Build on main (#12868832497)
  • Next Build on main (#12872695165)
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