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

kobotoolbox / kpi / 12810244921
81%
master: 76%

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

16 Jan 2025 01:47PM UTC coverage: 80.492% (+0.01%) from 80.482%
12810244921

push

github

web-flow
feat(projectHistoryLogs): log new submissions (#5416)

### đŸ“Ŗ Summary
Create logs when new submissions are added to projects.


### 👷 Description for instance maintainers
Allow null user_uids in AuditLogs so we can log anonymous submissions.


### 💭 Notes
We previously had no need for null users in audit logs because the
actions we logged were all restricted to authenticated users, but since
we allow anonymous submissions, we needed a way to log those.



### 👀 Preview steps

Feature/no-change template:
1. â„šī¸ have an account and a project. Make sure the account username is
not `admin` (see [this notion
task](https://www.notion.so/kobotoolbox/Anonymous-submissions-dont-work-if-user-named-admin-owns-asset-1767e515f65480608dfcee76ba9b3710?pvs=4))
2. Deploy the project
3. Add a submission to the project
4. Go to `api/v2/asset/<asset-uid>/history`
5. đŸŸĸ There should be a new project history log with
`action='add-submission'` and all the usual metadata, plus
```
"submission": {
    "submitted_by": "user1"
}
```
6. Enable submissions without username/email to the project
7. To make sure you're submitting anonymously, copy and paste the enketo
link into a new private tab and add a new submission
8. đŸŸĸ Reload the endpoint. There should be a new audit log with
`action='add-submission'`
a. The user should be
`http://kf.kobo.local:8080/api/v2/users/AnonymousUser/`
  b. The user_uid will be the uid of the anonymous user in the database
  c. The username should be `AnonymousUser`
d. The metadata should contain `{"submission": {"submitted_by":
"AnonymousUser"}` in addition to the usual

5828 of 9329 branches covered (62.47%)

9 of 9 new or added lines in 3 files covered. (100.0%)

22272 of 27670 relevant lines covered (80.49%)

0.8 hits per line

Jobs
ID Job ID Ran Files Coverage
1 12810244921.1 16 Jan 2025 02:24PM UTC 623
80.49
Source Files on build 12810244921
  • Tree
  • List 623
  • Changed 5
  • Source Changed 0
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • 11ee6768 on github
  • Prev Build on main (#12800479341)
  • Next Build on main (#12868832497)
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