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

kobotoolbox / kpi / 30332723373 / 3
82%
master: 76%

Build:
Build:
LAST BUILD BRANCH: dev-2566-reduce-refresh-frequency-and-harden-reliability-of-the-billingusage
DEFAULT BRANCH: master
Ran 28 Jul 2026 05:53AM UTC
Files 892
Run time 18s
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 Jul 2026 05:47AM UTC coverage: 45.479% (+1.3%) from 44.134%
30332723373.3

push

github

web-flow
feat(assetVersion): add version_number to `/api/v2/assets/<uid>/versions/` DEV-1825 (#7300)

### 📣 Summary
This PR adds a `version_number` field to the asset versions API,
returning "12" for deployed versions and "11.4" for undeployed versions
(numbered relative to the deployment that precedes them), computed
server-side so the numbering stays correct regardless of pagination.

### 📖 Description
#### Why this needed to be done in the backend
The Form History UI (Project → Form tab) needs to label each version
like v12, v11.4, etc. - deployed versions get a whole "major" number,
and undeployed (draft) versions get a "minor" number counting up since
the last deployment.

The frontend currently derives this from array index, which only works
because the full list is loaded at once. We're moving this list to
paginated infinite scroll, and a version's correct number depends on the
entire history of the asset before it - not just the versions on the
current page. The frontend has no way to know, from a single page of
results, how many deployments happened earlier in history, so it can't
reliably compute this itself once pagination is introduced.

#### What changed
Added a `version_number` field to the versions serializer. For each
request, we fetch the asset's full version history as a lightweight (id,
deployed) list in a single ordered query, then walk it once in Python to
build a map of version id → label: deployed versions increment the major
number and reset the minor, undeployed versions increment the minor. The
serializer looks up each row's label from that map, so both the
paginated list endpoint and retrieve return identical,
pagination-independent numbers with no per-row queries.

#### Why computed on the fly instead of stored on the model
I considered storing these numbers as columns on AssetVersion, populated
at save time like the existing _content_hash field, but ruled it out
because the table has millions of rows and would need a long, risky
ba... (continued)

3847 of 12686 branches covered (30.32%)

17111 of 37624 relevant lines covered (45.48%)

0.45 hits per line

Source Files on job 30332723373.3
  • Tree
  • List 892
  • Changed 29
  • Source Changed 0
  • Coverage Changed 29
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 30332723373
  • 48db28bb on github
  • Prev Job for on main (#30307597177.1)
  • Next Job for on main (#30332765934.1)
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