feat: export included_presets renderable bitmask for content-schema import gating#6040
Merged
rtibbles merged 5 commits intoJul 13, 2026
Merged
Conversation
Provides RENDERABLE_PRESETS_ORDER for the included_presets bitmask. The new le-utils adds a QTI question type to exercises.question_choices, which Django picks up as an assessmentitem.type AlterField migration. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add a nullable included_presets IntegerField to the abstract kolibri_content.base_models.File, inherited by both the kolibri_content (sqlite export) and kolibri_public (import-metadata API) File mirrors. It holds a bitmask of the renderable presets a device needs to render a file. The column is additive and nullable, so old Kolibri ignores it. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
In create_associated_file_objects, set each renderable (non-supplementary) file's own-preset bit (2 ** RENDERABLE_PRESETS_ORDER.index(preset_id)) and leave supplementary files NULL. A preset missing from the append-only ordering is logged and skipped rather than aborting the channel publish. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add VERSION_6 carrying included_presets and set it as CONTENT_SCHEMA_VERSION so new Kolibri knows an export carries the column. MIN_CONTENT_SCHEMA_VERSION stays VERSION_5 since the column is additive and returned regardless. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
New Kolibri gates channel import by whether a device can render a node's files, but the exported content database carries no per-file signal of which renderers a file needs. This adds a nullable
included_presetsbitmask to the exportedFilemirror and populates each renderable file's own-preset bit at publish, leaving supplementary filesNULL. It also advertises content schema version6so new Kolibri knows an export carries the column; the column is additive, so old Kolibri ignores it.References
Fixes #6004. Kolibri import-gating counterpart: learningequality/kolibri#14893. Ships alongside the 64-bit file-size export change #5987.
Reviewer guidance
contentcuration/contentcuration/utils/publish.py:669—included_presetsis set only for non-supplementary files; confirm supplementary files (e.g. thumbnails) stayNULLand a preset absent from the append-onlyRENDERABLE_PRESETS_ORDERis logged-and-skipped rather than aborting the publish.contentcuration/kolibri_content/constants/schema_versions.py—CONTENT_SCHEMA_VERSIONmoves to"6"whileMIN_CONTENT_SCHEMA_VERSIONstays"5"; confirm the version string matches Kolibri #14893 and that both additive columns riding this hotfix share one version bump (noVERSION_7).contentcuration/contentcuration/migrations/0168_alter_assessmentitem_type.py— the le-utils 0.2.18 bump adds aQTIentry toexercises.question_choices, so Django emits a choices-onlyAlterFieldonassessmentitem.type; confirm carrying that no-op-DDL migration here is acceptable.AI usage
Used Claude Code to implement the pre-approved plan with test-driven development, prompting it to follow the existing
create_associated_file_objectsandbase_models.Filepatterns. Verified with the export-channel and import-metadata test suites andmakemigrations --check.@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly
How was this generated?
🟡 Waiting for feedback
Last updated: 2026-07-12 22:57 UTC