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

kobotoolbox / kpi / 14225121148
81%
master: 76%

Build:
Build:
LAST BUILD BRANCH: dev-1257-remove-v1-forms-endpoint
DEFAULT BRANCH: master
Ran 02 Apr 2025 05:30PM UTC
Jobs 1
Files 639
Run time 24min
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

02 Apr 2025 04:50PM UTC coverage: 80.849% (+0.05%) from 80.802%
14225121148

push

github

web-flow
feat(massEmails): Query for users reaching nlp usage limits TASK-152 (#5633)

### 📣 Summary
Create the query for retrieving users who are >90% and >100% of their
nlp usage limits.



### 📖 Description
The query returns a list of user uids. It will be used as part of a
MassEmailConfig. Emails that use that query will be sent to the list of
users generated by it. The usage calculated is the same as what is shown
on the Usage page.

### 💭 Notes

Similar to previous PRs, refactors nlp usage calculations to get nlp
usage for multiple organizations at once.
ALso updates how we calculate usage limits to include one time addons if
needed (since it's needed for nlp usage limits). The total effective
usage limit for an organization is `max(plan_limit, addon_limit) +
sum(all onetime addons)`



### 👀 Preview steps

* Note: after every "purchase," make sure to resync the subscriber

1. Enable stripe and NLP on your local setup
2. Have at least 1 user on the community plan.
3. Create a project with an audio question and add a few submissions
with an audio attachment.
4. In admin, go to Djstripe -> Product -> Community (5 prices) and edit
the metadata with `"mt_characters_limit": "10"`
6. Open an audio submission for editing.
7. Manually add an English transcript with your favorite 9-letter word
(eg "pineapple").
8. Create an automatic Spanish translation.
9. In the a python shell, import and run
`get_users_over_90_percent_of_nlp_limits()`
10. :green_circle: the list should have your userid
11. Run `get_users_over_100_percent_of_nlp_limits()`
12. :green_circle: Your userid should not be in the list
13. Open another audio submission for editing.
14. Add another English transcript (however many characters) and create
an automatic Spanish translation.
15. In a python shell, import and run
`get_users_over_90_percent_of_nlp_limits()`
10. :green_circle: Your user id should not be in the list
11. Run `get_users_over_100_percent_of_nlp_limits()`
12. The list should contain... (continued)

6124 of 9717 branches covered (63.02%)

101 of 107 new or added lines in 5 files covered. (94.39%)

1 existing line in 1 file now uncovered.

23286 of 28802 relevant lines covered (80.85%)

0.81 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
6
80.33
-2.28% kobo/apps/mass_emails/user_queries.py

Uncovered Existing Lines

Lines Coverage ∆ File
1
80.33
-2.28% kobo/apps/mass_emails/user_queries.py
Jobs
ID Job ID Ran Files Coverage
1 14225121148.1 02 Apr 2025 05:30PM UTC 639
80.85
Source Files on build 14225121148
  • Tree
  • List 639
  • Changed 7
  • Source Changed 0
  • Coverage Changed 7
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • e7e814fe on github
  • Prev Build on main (#14224600088)
  • Next Build on main (#14242803993)
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