Skip to content

Publish a renderer-preset bitmask (File.included_presets) into the content database #6004

Description

@rtibbles

❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

Overview

Kolibri gates channel import by whether it can render a node's files. Add an included_presets bitmask to the exported content-database File mirror and populate it at publish, so new Kolibri (learningequality/kolibri#14893) can gate import by the renderers a device actually has. Ships alongside the 64-bit file-size export change (#5987) so both content-schema additions ride one hotfix release.

Complexity: Low
Target branch: hotfixes

Context

  • Studio generates the content database through the vendored kolibri_content schema (base_models.py).
  • create_associated_file_objects (publish.py:643) writes File rows through it.
  • Both the kolibri_content export mirror and the kolibri_public API mirror derive from base_models.File.
  • included_presets is a per-file bitmask of the preset renderers a file needs, including its own.
  • A normal file needs only its own preset's renderer.
  • le-utils 0.2.18 defines the ordering as RENDERABLE_PRESETS_ORDER (append-only, supplementary presets excluded).
  • A preset's bit is 2 ** RENDERABLE_PRESETS_ORDER.index(preset_id).
  • Kolibri ([QTI] Use File.included_presets for more comprehensive import renderability gating kolibri#14893) counts a node renderable when any file's included_presets is a subset of the device's presets.
  • The column is additive, so old Kolibri ignores it.

The Change

  • Bump le-utils 0.2.17 → 0.2.18 in requirements.in.
  • Recompile requirements.txt (uv pip compile).
  • Add a nullable included_presets column to base_models.py, inherited by both File mirrors.
  • In create_associated_file_objects (publish.py:669), set each renderable file's own preset bit.
  • Leave supplementary files NULL.
  • Advertise the schema version carrying included_presets so new Kolibri maps it.
  • Keep MIN_SCHEMA_VERSION at "1" (mirroring Publish file sizes into both legacy and 64-bit content database columns #5987).

Out of Scope

Acceptance Criteria

General

  • included_presets is present and populated on both the kolibri_content and kolibri_public File mirrors.
  • A channel published with this change imports into current Kolibri with renderability gated by the bitmask.

Testing

  • Publishing a renderable file writes its own preset bit.
  • Publishing a supplementary file (e.g. a thumbnail) leaves included_presets NULL.
  • The exported database imports with included_presets populated for renderable files.

References

AI usage

I used Claude (Opus 4.8, via le-skills:writing-github-issues) to locate the publish/export code and the le-utils 0.2.18 API and draft this issue.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions