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

kobotoolbox / kpi / 15010315543
81%
master: 76%

Build:
Build:
LAST BUILD BRANCH: dev-1257-remove-v1-forms-endpoint
DEFAULT BRANCH: master
Ran 14 May 2025 02:14AM UTC
Jobs 1
Files 654
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

14 May 2025 01:37AM UTC coverage: 78.787% (-2.1%) from 80.903%
15010315543

push

github

web-flow
refactor(attachments): bulk and single attachment deletion endpoints TASK-1822 (#5733)

### 💭 Notes
Refactored endpoints for remove attachments:

- delete all attachments of a list of submissions, endpoint:
`/api/v2/assets/<asset_uid>/attachments/bulk/`

  -   receives a list of submission root_uuids as the payload
  -   users can only make `DELETE` requests
  -   returns a `202 ACCEPTED`

- delete a single attachment on an asset: 
`/api/v2/assets/<asset_uid>/attachments/<attachment_uid>/`
  - does not take any payload
  -  users can only make `DELETE` requests
  - returns a `204 NO CONTENT`



### 👀 Preview steps

#### Test: `/api/v2/assets/<asset_uid>/attachments/<attachment_uid>/`
1. â„šī¸ have account and a project that has multiple attachments
2. Make some submissions with a few attachments
4. đŸŸĸ Make a `DELETE` request using the uid of one attachment and verify
that you receive a `200 OK` response with the message: "1 attachments
deleted"
6. Check out the database 
7. Verify that the attachment is no longer present 
8. Verify that AttachmentTrash.objects.all().count() should be a least 1
11. Share the project with **another user** and grant them permission to
edit submissions
12. đŸŸĸ Make a `DELETE` request as ** another user** and verify that you
receive a `200 OK`
13.  Grant  **partial user** partial permissions to edit submissions
12. đŸŸĸ Make a `DELETE` request as ** partial user** and verify that you
receive a `200 OK`

#### Test: `/api/v2/assets/<asset_uid>/attachments/bulk/`
1. â„šī¸ have account and a project that has attachments 
2. Make some submissions with a few attachments
3. Check out the new endpoint for the project:
`/api/v2/assets/<asset_uid>/attachments/bulk/`
4. đŸŸĸ Make a `DELETE` request with a list of submission root uuids (see
example below) as a payload and verify that you receive a `202 ACCEPTED`
response with the message: "2 attachments deleted"
```
{
    "submission_root_uuids":
        [
        "3ed2e8de-b493-4367-a78d-346u687239... (continued)

6092 of 9933 branches covered (61.33%)

60 of 65 new or added lines in 4 files covered. (92.31%)

1 existing line in 1 file now uncovered.

23109 of 29331 relevant lines covered (78.79%)

0.79 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
5
87.8
kpi/serializers/v2/attachment_delete.py

Uncovered Existing Lines

Lines Coverage ∆ File
1
73.57
-0.18% kpi/deployment_backends/openrosa_backend.py
Jobs
ID Job ID Ran Files Coverage
1 15010315543.1 14 May 2025 02:14AM UTC 654
78.79
Source Files on build 15010315543
  • Tree
  • List 654
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • 3550e73a on github
  • Prev Build on main (#14999187649)
  • Next Build on main (#15031508809)
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