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

kobotoolbox / kpi / 12893591375
81%
master: 76%

Build:
Build:
LAST BUILD BRANCH: refactor-subsequences-2025
DEFAULT BRANCH: master
Ran 21 Jan 2025 07:14PM 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

21 Jan 2025 06:36PM UTC coverage: 80.515% (+0.02%) from 80.499%
12893591375

push

github

web-flow
feat(projectHistoryLogs): export project history logs TASK-1056 (#5430)

### đŸ“Ŗ Summary
Export project history logs to csv.


### 📖 Description
New endpoints for exporting project history logs. User can export logs
for a single project if they have the Manage Asset permission.
Superusers can export all project history logs.
Endpoint for exporting PH logs for a specific asset is
`/api/v2/assets/<uid>/history/export/`. Superuser-only endpoint for
exporting all PH logs is `/api/v2/project-history-logs/export`.


### 👷 Description for instance maintainers
One new migration to create the new type of export task. 


### 💭 Notes
Mostly a copy of the existing AccessLogExportTask, with some refactoring
to avoid too much repetition. New endpoints were added to existing views
rather than creating new views to avoid needing new entries in urls.py
and because the permissions were the same as the existing views.


### 👀 Preview steps

Feature/no-change template:
* Note: it's easiest to test this locally with kobo-compose, since that
will send all emails to the logs
* Note2: If testing locally, make sure to migrate kpi

1. â„šī¸ have a superuser account and at least 2 projects
2. To make life easier, you should set `CELERY_TASK_ALWAYS_EAGER` to
True in base.py.
3. Create a few logs for each project by updating the form, deploying,
adding submissions, etc.
4. In the terminal, run `curl -X POST -H 'Authorization: Token <your
token>' /api/v2/assets/<uid1>/history/export/`
5. đŸŸĸ It should return {"status":"created"}
6. In your kpi logs, you should see the text of an email, including a
link to a csv
7. đŸŸĸ Copy the link into your browser. It should download a csv with just
the project history logs from the first project. The columns should be
user_url
user_uid
username
action
date_created
source
ip_address
asset_uid
other_details
4. In the terminal, run `curl -X POST -H 'Authorization: Token <your
token>' /api/v2/project-history-logs/export/`
5. đŸŸĸ It should return {"status":"cr... (continued)

5847 of 9356 branches covered (62.49%)

55 of 57 new or added lines in 3 files covered. (96.49%)

3 existing lines in 1 file now uncovered.

22322 of 27724 relevant lines covered (80.52%)

0.81 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
2
97.83
-2.17% kobo/apps/audit_log/views.py

Uncovered Existing Lines

Lines Coverage ∆ File
3
93.79
-1.86% kobo/apps/stripe/views.py
Jobs
ID Job ID Ran Files Coverage
1 12893591375.1 21 Jan 2025 07:14PM UTC 623
80.52
Source Files on build 12893591375
  • Tree
  • List 623
  • Changed 4
  • Source Changed 0
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • 95b5da5b on github
  • Prev Build on main (#12872695165)
  • Next Build on main (#12893603836)
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