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

kobotoolbox / kpi / 13200267817
81%
master: 76%

Build:
Build:
LAST BUILD BRANCH: beccagraber/dev-1452-new_action
DEFAULT BRANCH: master
Ran 07 Feb 2025 01:31PM UTC
Jobs 1
Files 626
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

07 Feb 2025 12:54PM UTC coverage: 80.621% (+0.007%) from 80.614%
13200267817

push

github

web-flow
fix(submissions): verify submission exists before adding or modifying extras (#5491)

### đŸ“Ŗ Summary
Return 404 when retrieving or updating submission extras if submission
does not exist.

### 💭 Notes
Update the GET and POST endpoints for submission extras to check that an
`Instance` with the given `uuid` exists, otherwise 404. We can't enforce
this at a database level because `SubmissionExtra`s and `Instance`s live
in different databases, but this at least provides some gating to
prevent us from having orphaned `SubmissionExtra`s lying around. It also
will make project history logs easier if we can ensure that we always
have an `Instance` containing information about the updated submission.


Bug template:
1. â„šī¸ have an account and a project
2. In Django admin, add English (code 'en') as a language
3. Add an audio question to the project with the label "audio"
4. Create a submission to the project including an audio upload
5. Add a transcript to the submission
6. From the terminal, run `curl -X POST -H 'Authorization: Token <your
token>' -H 'Content-type: application/json'
kf.kobo.local:8080/advanced_submission_post/<asset_uid> -d
'{"submission": "bad-uuid", {"audio": {"transcript":
{"languageCode":"en", "value":"something"}}}}'`
7. 🔴 [on main] The request will succeed. In the shell, you will see a
SubmissionExtra object with a `submission_uuid` of `"bad-uuid"`
8. In the browser, go to
`kf.kobo.local:8080/advanced_submission_post/<asset_uid>?submission="also-bad"`
9. :red_circle: [on main] The response will be a 200 (though it will say
in the info that the submission doesn't exist)
10. đŸŸĸ [on PR] Both requests will 404

5972 of 9522 branches covered (62.72%)

5 of 5 new or added lines in 1 file covered. (100.0%)

4 existing lines in 2 files now uncovered.

22690 of 28144 relevant lines covered (80.62%)

0.81 hits per line

Uncovered Existing Lines

Lines Coverage ∆ File
1
83.1
4.31% kobo/apps/subsequences/api_view.py
3
93.79
-0.62% kobo/apps/stripe/views.py
Jobs
ID Job ID Ran Files Coverage
1 13200267817.1 07 Feb 2025 01:31PM UTC 626
80.62
Source Files on build 13200267817
  • Tree
  • List 626
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • bdf44a42 on github
  • Prev Build on main (#13199956551)
  • Next Build on main (#13223685434)
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