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

kobotoolbox / kpi / 36392937532
83%
master: 76%

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 28 Sep 2026 07:44AM UTC
Jobs 10
Files 920
Run time 3min
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

28 Sep 2026 07:40AM UTC coverage: 83.076% (+0.003%) from 83.073%
36392937532

push

github

web-flow
perf(billing): compute usage balances once per limit check DEV-926 (#7637)

### đŸ“Ŗ Summary
Checking whether a project owner is over their plan limit now does less
repeated work in some submission paths.

### 📖 Description
When a submission comes in, the server checks whether the project owner
is over their submission or storage limit. Some paths, like imports and
backups, worked out the owner's usage more than once for the same check.
They now do it once. Which submissions get accepted or refused stays the
same.

### 💭 Notes
- New `check_exceeded_limits(user, usage_types)` checks several usage
types in one call and computes fresh balances at most once, only when a
type gets past its 15-min gate. `check_exceeded_limit` stays as a thin
wrapper for the NLP trackers and LRM 0011.
- In a web request, `@cache_for_request` already deduplicated the two
calls, so nothing changes there. Outside a request (imports, backups,
briefcase) that memo does nothing, and main computes twice.
- Counters on the 402 path still come from a fresh read, not from the
cached balances that decided the 402. Storage can drop (file deletes)
without clearing that cache, and storage counters drive attachment
auto-delete. `test_over_limit_rejection_counts_on_fresh_usage` covers
it.

### 👀 Preview steps
Backend only. Watch how many times usage gets computed for one refused
submission outside a web request.
1. â„šī¸ have a project whose owner is over their submission limit
2. submit to it without the request middlewares (like an import does)
and get a 402
3. 🔴 [on main] usage computed 3 times
4. đŸŸĸ [on PR] computed 2 times, same 402
5. đŸŸĸ `test_check_exceeded_limits_computes_balances_once` and
`test_over_limit_rejection_counts_on_fresh_usage` cover it

10448 of 13809 branches covered (75.66%)

26 of 31 new or added lines in 2 files covered. (83.87%)

33335 of 40126 relevant lines covered (83.08%)

5.51 hits per line

Uncovered Changes

Lines Coverage ∆ File
5
70.37
2.19% kobo/apps/stripe/utils/limit_enforcement.py
Jobs
ID Job ID Ran Files Coverage
1 36392937532.1 28 Sep 2026 07:44AM UTC 915
43.6
2 36392937532.2 28 Sep 2026 07:45AM UTC 915
52.67
3 36392937532.3 28 Sep 2026 07:45AM UTC 915
49.65
4 36392937532.4 28 Sep 2026 07:46AM UTC 917
44.88
5 36392937532.5 28 Sep 2026 07:47AM UTC 917
50.9
6 36392937532.6 28 Sep 2026 07:47AM UTC 917
53.92
7 36392937532.7 28 Sep 2026 07:48AM UTC 915
58.48
8 36392937532.8 28 Sep 2026 07:48AM UTC 918
67.99
9 36392937532.9 28 Sep 2026 07:50AM UTC 917
59.56
10 36392937532.10 28 Sep 2026 07:52AM UTC 920
70.31
Source Files on build 36392937532
  • Tree
  • List 920
  • Changed 4
  • Source Changed 0
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • 11fbd75b on github
  • Prev Build on main (#36137076149)
  • Next Build on main (#36449264106)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc