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

kobotoolbox / kpi / 18134468695
81%
master: 76%

Build:
Build:
LAST BUILD BRANCH: beccagraber/dev-1452-new_action
DEFAULT BRANCH: master
Ran 30 Sep 2025 03:38PM UTC
Jobs 2
Files 863
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

30 Sep 2025 03:05PM UTC coverage: 81.102% (-0.1%) from 81.199%
18134468695

push

github

web-flow
feat(usageLimits): Check all users storage usage to get their ExceededLimitCounter's DEV-916 (#6267)

### 📣 Summary
A new long running process is added to backfill exceeded limits counters
for storage usage type.

### 💭 Notes
The long running job goes through users in the platform that are
organization owners and have not got a flag in their ExtraDetails data
with the key 'done_storage_limits_check'. Users with pending
ExceededLimitCounter object for the storage usage type are put through
the function
`kobo.apps.stripe.utils.limit_enforcement.check_exceeded_limit` in order
to generate the counter entry if necessary. This may be a very long
running process, depending on the amount of users registered in the
system.

### 👀 Preview steps
1. Ensure stripe is enabled in your dev environment
2. Restart your kpi container in order to make it run the migrations,
this will ensure you get the long running process created
3. Execute the long running migration from the shell. Run it twice to
ensure that it does not process the same users twice.
```
In [1]: lrm = LongRunningMigration.objects.filter(name__contains='0011').first()

In [2]: lrm.status
Out[2]: 'created'

In [3]: lrm.execute()
Checking exceeded limits for user_a...
Checking exceeded limits for user_b_b...
Checking exceeded limits for user_b_f...
...
Done. Created 8 counters.

In [4]: lrm.status
Out[4]: LongRunningMigrationStatus.COMPLETED

In [5]: lrm.status = 'created'; lrm.save()

In [6]: lrm.execute()
Done. Created 0 counters.

```

6915 of 10910 branches covered (63.38%)

0 of 42 new or added lines in 2 files covered. (0.0%)

26732 of 32961 relevant lines covered (81.1%)

1.6 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
2
27.5
-1.45% kobo/apps/stripe/utils/limit_enforcement.py
40
0.0
kobo/apps/long_running_migrations/jobs/0011_backfill_exceeded_limit_counters.py
Jobs
ID Job ID Ran Files Coverage
1 18134468695.1 30 Sep 2025 03:38PM UTC 863
78.77
2 18134468695.2 30 Sep 2025 03:41PM UTC 863
81.08
Source Files on build 18134468695
  • Tree
  • List 863
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • 251a5fda on github
  • Prev Build on main (#18134087871)
  • Next Build on main (#18141864226)
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